Re: Font design question


Subject: Re: Font design question
From: Martin Sevior (msevior@mccubbin.ph.unimelb.edu.au)
Date: Fri Jun 09 2000 - 03:06:33 CDT


On Thu, 8 Jun 2000, Petr Tesarik wrote:

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

I've been worrying about it too but for a much different reason. I want to
support Mathematical Symbols properly. Right now a symbol from "Insert
Symbol" is defined as a character in the "Standard Symbols" font. It is
not guarenteed to be available on another non-Unix platform.

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

My knowledge of the blackart of X11 fonts is very limited. I can only
suggest you look also at what the gtk 1.4 and gnome teams are doing for
Unicode Fonts and printing. I do know they intend to solve All Known
Problems. The gnome-print library used by gnumeric seems very impressive
to a user like me. I haven't looked at the code but we do have a
preliminary patch from John Tunison to get gnome-print up and running on
the abi Gnome front end.

see:

http://www.abisource.com/mailinglists/abiword-dev/00/April/0070.html

http://www.abisource.com/mailinglists/abiword-dev/00/April/0096.html

And the follow-up threads for what John has done.

You might find it easier to work this way on the printing to start with,
then look to see what is needed for a general Unix solution. This is a big
effort but well worthwhile I believe.

Cheers

Martin



This archive was generated by hypermail 2b25 : Fri Jun 09 2000 - 03:06:55 CDT