Xorg and Fonts

Russell Shaw rjshaw at netspace.net.au
Sat Sep 3 05:08:36 PDT 2005


James Cloos wrote:
>>>>>>"Russell" == Russell Shaw <rjshaw at netspace.net.au> writes:
> 
> Russell> The idea i have is that regardless of the format of end
> Russell> font-tables, all the required information is converted to a
> Russell> canonical format that the client needs for font calculations.
> 
> This does mean that the server has to be updated every time the font
> formats change, to recognize and 'canonicalize' the new data.
> 
> (With apologies for the neologism.)

When a new font format is released, someone will write a new SIA (system
interface agent, right box) or add a module to it. The SIA does the
canonicalization, so the X server (left box) never needs to change.

A SIA for fonts is just a GUI that lets the user choose any font from their
system, that gets uploaded to the remote X client for display (it replaces
the default client-machine font that was being displayed). This font
customization can be automated every time the user uses a particular X client,
via a per-client preferences file.

                                     System interface agents (SIA).
+----------+                       +----------------------------------------+
| X server |<--- /dev/Xinput  <--- | One or more X event generators         |
|          |---> /dev/Xoutput ---> |   and readers.                         |
+----------+                       | X events for mouse button presses      |
                                    |   and movement etc,                    |
                                    | X events for keypress, keyrelease etc, |
                                    | X events for hardware changes.         |
                                    | Requests from server to reset or query |
                                    |   hardware.                            |
                                    |                                        |
                                    | X event to notify the root window or an|
                                    |   application window of a font change  |
                                    |   request.                             |
                                    +----------------------------------------+

The user opens the font-config GUI, and selects a font.

The GUI (SIA) writes a "configure mode" X event to /dev/Xinput, to put
the X client into a configuration mode (to be implemented in my widget
kit).

The user then clicks any window within an X client top-level window,
or the root window. The X client sends a "window-clicked" X event to
the X server which writes it to /dev/Xoutput for the SIA font-config
GUI to read.

The SIA GUI writes all the font glyphs and metrics for the chosen font and
chosen application/window to /dev/Xinput, which is sent by the X server to
the chosen client.

Customizing further windows with the same will not upload the same font
info if the client already has the font data. The user can choose that
all windows contained within the selected window also get the same font.
The user could also choose the root window, which will make all apps use
the chosen font, with a bit of help from the window manager which i will
also write and have these run-time configuration features.

Using a similar protocol, my widget kit will have full run-time drag-and-drop
GUI construction and user customization (RAD).

> Otherwise, though, it does seem that you are successfully defining a
> useful problem space and solution, much as stsf is useful for the
> problem space Sun designed it to solve.

The problem with stsf is that it does glyph size calculations and all
rendering in the X server, so the client doesn't know what dimensions
the end rendering is unless it sends round-trip queries from the server
(or so i've gathered from the source and list discussions, because the
original maintainers refuse to answer me).

However, if i start using display-lists in the X server, it might be
just the thing i need.

> I'll be interested to see what you came up with.
> 
> -JimC

The best motivation is a desire to use the result.



More information about the xorg mailing list