[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:       Keith Packard <keithp () keithp ! com>
Date:       2002-02-26 16:08:12
[Download RAW message or body]


Around 22 o'clock on Feb 25, Keyur Shroff wrote:

> 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?

Client-side text cannot be drawn with XDrawText or any core requests,
instead the Render extension is used. The Render extension text requests
include X and Y positions for each fragment instead of only X adjustments.

> 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.

Because the client isn't involved in layout, it has no idea what portion of
the string is needed to recompute the metrics.  Unless the server stores
all of the client's data, the client must pass the entire "unit" back to
the server for metric computation.  In Pango, this "unit" is often an
entire paragraph.

> 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.

If the client is involved in layout, then the client needs to be able to 
compute many metrics locally, or spend a lot of time waiting for 
synchronous X requests.  Computing metrics locally requires a lot of data 
that is font format specific; that will lock our protocol to a particular 
set of font features.

APIs can change much faster than protocols; adding a new library requires
changes only to the local system, not to every possible remote X server.
Of course applications should be insulated from font file formats; that's 
what toolkits are for.

> Text can be drawn simply by using existing Xlib functions
> (e.g., XDrawString).

No, XDrawString specifies precisely what pixels will be affected by the 
operation, you can never make this one do layout.  Adding support for 
modern text layout will require new APIs; efficient support over the wire 
will require an extension.  Client-side text can be implemented 
inefficiently without an extension, but server side text can only be 
implemented with an extension.  Attempting to emulate server-side text 
with client-side code doubles the configuration problem -- you must 
configure client-side fonts for the emulation and server-side fonts for 
the extension.

Keith Packard        XFree86 Core Team        Compaq Cambridge Research Lab


_______________________________________________
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