On Mon, 24 Nov 2003 13:55:09 -0500 Ambrose Li <acli@ada.dhs.org> wrote:> On Mon, Nov 24, 2003 at 04:28:05PM +0200, Ciprian Popovici > wrote: > > > * The "old model" of doing things was somewhat similar to > > the modern chain above. Except for a few things: instead > > of fontconfig, X used (and continues using) its own font > > retrieval mechanism in the form of FontPath or the X Font > > Server. (Can''t fontconfig replace them? If yes, why hasn''t > > it? Is it for backwards compatibility?) Just like the modern > > chain, it uses Xft, freetype and xrender. Xft has suffered > > a few transformations, moving from it''s own font retrieval > > mechanism (XftConfig) in 1.0 to using fontconfig in 1.1, and > > to a more advanced use of Xrender in 2.0. > > AFAIK this is wrong. The "old model" does not involve any of > Xft, freetype, and xrender, all of which are quite (very) recent > inventions; rather, because fonts reside on the X server, the > app only need to tell the server what string (as text) to draw > on the screen. An "old" X app can use these new libraries if > the programmer had intended to use those libraries, but their > use would have nothing at all to do with the traditional way > fonts are used in X.I see. I assumed xft, freetype or xrender would be used since they were shipped with XFree, after all. On the other hand, I can see that the usual GTKv1 application, for instance, isn''t linked against any of those libraries. -- Ciprian Popovici
On Mon, Nov 24, 2003 at 04:28:05PM +0200, Ciprian Popovici wrote:> * The "old model" of doing things was somewhat similar to > the modern chain above. Except for a few things: instead > of fontconfig, X used (and continues using) its own font > retrieval mechanism in the form of FontPath or the X Font > Server. (Can''t fontconfig replace them? If yes, why hasn''t > it? Is it for backwards compatibility?) Just like the modern > chain, it uses Xft, freetype and xrender. Xft has suffered > a few transformations, moving from it''s own font retrieval > mechanism (XftConfig) in 1.0 to using fontconfig in 1.1, and > to a more advanced use of Xrender in 2.0.AFAIK this is wrong. The "old model" does not involve any of Xft, freetype, and xrender, all of which are quite (very) recent inventions; rather, because fonts reside on the X server, the app only need to tell the server what string (as text) to draw on the screen. An "old" X app can use these new libraries if the programmer had intended to use those libraries, but their use would have nothing at all to do with the traditional way fonts are used in X.
I''m preparing a brief, non-technical, newbie-aimed tutorial about font rendering in X applications. I''m no expert myself, so I''d like to ask you if the facts below are fundamentally correct, from that shallow POV. Please help me clear any misconceptions I might have and perhaps you could point me towards appropriate documentation. * [Modern] X applications use Xft as a common unified interface for all their font needs. Xft, in turn, uses: fontconfig for "getting fonts" (ie. all kinds of information about fonts available in that particular setup); X Render extension to improve performance; FreeType to actually render fonts. * Various toolkits (widget libraries) come with their own API''s or abstraction layers for font handling. Such API''s are (or should be) placed between the application and Xft in the chain above. Some of these toolkit API''s will circumvent Xft and access some deeper parts of the chain directly. * Font anti-aliasing is actually done by FreeType, but can be turned on/off or adjusted in several places in the chain above. * The "old model" of doing things was somewhat similar to the modern chain above. Except for a few things: instead of fontconfig, X used (and continues using) its own font retrieval mechanism in the form of FontPath or the X Font Server. (Can''t fontconfig replace them? If yes, why hasn''t it? Is it for backwards compatibility?) Just like the modern chain, it uses Xft, freetype and xrender. Xft has suffered a few transformations, moving from it''s own font retrieval mechanism (XftConfig) in 1.0 to using fontconfig in 1.1, and to a more advanced use of Xrender in 2.0. Question: what is the main difference between apps using some toolkits (QTv2+, GTKv2+) and the ones using other toolkits (GTKv1, wxWindows, fltk) as far as modern font rendering is concerned? Is it simply the toolkit technology being outdated and the toolkit API''s not making modern stuff (AA for instance) available to the application? * The way I see it, there are many libraries (X related, widget toolkits related) which have to be converted one by one to the modern way of "doing fonts". Some have, some still haven''t, so we currently have half-way hacks like Xft 1.1 still being deployed for the sake of backwards compatibility. -- Ciprian Popovici