[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xfree-fonts
Subject:    Re: [Fonts] Complex text layout and mapping screen coordinates
From:       Keyur Shroff <keyur_shroff () yahoo ! com>
Date:       2002-02-26 6:30:53
[Download RAW message or body]

Hello,

--- Keith Packard <keithp@keithp.com> wrote:
> > In client side approach, since client has to find
> relative (x,y) position
> > for each glyph from GPOS table, a separate request need
> to be sent for each
> > character (or glyph?) code over the wire.
> 
> It's not a separate request, the entire string can be set
> in a single 
> request with appropriate offsets.  In fact, for proper AA
> text display, 
> the entire string must be sent as a single request to get
> overlapping 
> glyphs rendered correctly.

I don't understand this fully. Will you please explain how
it can be done? As per my understanding, GPOS table in
OpenType font contains relative offsets values for each
glyph in a glyph cluster. This requires changing both x and
y position values for each glyph. Since all glyphs need not
have non-zero (x,y) value, they can be batched in a single
request. But if (x,y) value pairs have non-zero values then
current Xlib functions doesn't support to send them in a
single request. In XDrawText, we can specify only DeltaX
position not DeltaY. So how can entire string be set in a
single request with overlapping glyphs with modified (x,y)
values?

> 
> > For (b), again only one request need to be sent for
> each
> > run in the string. Client can maintain cache (as it is
> > doing in Gtk) so that we can send request for querying
> text
> > extents only when text string is modified.
> 
> To compute line breaks, applications must incrementally
> add characters to 
> a string, computing the string metrics after each
> character; this will now 
> require numerous round trips.

As I said earlier, client can maintain cache and only a few
requests will be sent (min. 1 and max. 3) to recompute
offsets of substrings in newly modified string.

> If the client isn't involved in text layout, there is no
> way it can tell 
> what portion of the string needs to be retransmitted for
> the server to 
> layout the glyphs.  Languages like Devanagari require a
> significant amount 
> of non-local context when editing text; how can the
> client known what text 
> needs to be transmitted in this case?  
> 
> For Pango, the library and the application usually
> interact at the
> paragraph level with Pango holding the entire content of
> the document so
> that application editing can be properly reflected in the
> output.
> 

I never said that client will not involve in text layout.
But server side approach will make the things easier for
client applications. Complexity with font formats like
OpenType fonts will be hidden from the clients. This will
allow minimum or no modification in client to allow complex
text layout. Also with server side approach we are not
forcing client applications to use a particular library.
Text can be drawn simply by using existing Xlib functions
(e.g., XDrawString). I know that if a library is superior
to other libraries then it will dominate the market. But
having wide range of libraries and tools is what I think is
strength of Linux.

> > For client side approach no request will be sent for
> finding text extents
> > but we have to send a separate request to draw glyph
> for all characters
> > starting from the modification point.
> 
> Network traffic is almost irrelevant for X; it's all
> about round trips, 
> not the size of glyph data on the wire.  Glyph data will
> always be 
> completely swamped by image data.  If this weren't the
> case, we'd have a 
> stored mode X protocol (like PHIGS) and we'd all spend
> our lives editing 
> display lists.  I'll take a hundred extra requests to
> save a single round trip.

Can you please explain this in more detail? I am keen to
know about "bulk of data" v/s. "round trips".

Thanks,
Keyur



__________________________________________________
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com
_______________________________________________
Fonts mailing list
Fonts@XFree86.Org
http://XFree86.Org/mailman/listinfo/fonts
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic