Font design question


Subject: Font design question
From: Petr Tesarik (tesarik@lupa.cz)
Date: Thu Jun 08 2000 - 14:02:44 CDT


Hello

I'm back again and unsatisfied with the current Unicode state - as
always. :)

So, at first, thanks to whoever recommended me to install X 4.0. It
solved many problems, although I have spent a whole day tracking down
a nasty bug in their XIM and there's still something bad with font
measurement but I don't have time to read all that Xlib source code
right now. The good news is: we have a complete PostScript font set at
least for the encodings I am interested in (Latin1 and Latin2). It
comes with X 4.0. (Wow!)

The bad news is: the Xlib API cannot be used to display arbitrary
Unicode characters (forget gdk_draw_text_wc() - it's rather useless
for our needs, believe me, I looked at the X Specs).

I think the easiest way to get it all up and running without having to
rewrite the font selection dialog, insert symbol dialog, etc. is this:

1. Rename the current XAP_UnixFont class to XAP_UnixRealFont. This
   class encapsulates an actual X11 font, including encoding. It has
   an XLFD.

2. Create a new class XAP_UnixFont (yes, it's named the same as the
   renamed one, so we don't have to rewrite all the code that uses
   XAP_Font). This class is an abstraction that only knows the font
   name and style. It contains all available XAP_UnixRealFont's with
   that name&style in different encodings.

3. Create a mapper class, XAP_UnixCharMap that maps Unicode characters
   to "encoding & charcode" pairs.

4. Rewrite gr_UnixGraphics.cpp, so that appropriate GdkFont for a
   character will be used (a slight change in the XAP_UnixFontHandle
   API is needed - getGdkFont() must accept encoding as an argument).

5. We will most likely have to rewrite xap_UnixPSFont.cpp and
   xap_UnixPSGraphics.cpp to enable printing.

As of 1-4 I looked over the code and I actually started some work. It
looks like the right way. I don't know what to do with 5. but maybe
I'll find out later. I ask now as to be sure that I've chosen the
right approach and that my patches will get accepted when I'm done.
Does anyone see any conceptual mistakes?

Regards,

-- 
Petr Tesarik
Tel: +420 602 575294            http://www.lupa.cz/



This archive was generated by hypermail 2b25 : Thu Jun 08 2000 - 14:02:49 CDT