Re: unix font handling and printing under utf-8 locale


Subject: Re: unix font handling and printing under utf-8 locale
From: Vlad Harchev (hvv@hippo.ru)
Date: Wed Jan 31 2001 - 09:19:42 CST


On Tue, 30 Jan 2001, Dom Lachowicz wrote:

 Hi Dom,

> Hi Vlad,
>
> > I think that XP PS export is not worth the efforts (it's easy achievable
> >on
> >Windows say by installing fake PS printer, and asking to print to file when
> >printing to that printer to get almost reasonable .PS; same should be
> >possible on all platforms that can use .PS for anything meaningful).
>
> There is no reason why we can't do XP PS. You don't need a fake PS printer
> or anything - PS is just a markup language. All we do is call things like
> `drawLine %begin %end %width` and `setFont Times-Roman` and such in our
> current PS driver. The only reason, IIRC, that PS export was limited to UNIX
> was that instead of calling `setFont fontName` we are (dumbly, IMHO) doing
> the following:

 If we are aiming at XP PS, then we should either forget about supporting TTFs
or we will have to link with FreeType library or similar for getting info
about glyph dimensions in very portable way.
 
> Dump-Font-AFM-Into-The-Friggin-Header name:Times-Roman index:1
> setFontIndex 1
> writeSomeText "Hello World"
>
> > We should provide an option - whether to dump all needed afms/pfms into
> >.ps
> >file when printing to .ps. Then our .ps files can even be better than
> >gnome-print ones.
>
> Ick... I dislike this option. Why would one want to do this? And why,
> exactly, would this be preferable/better than gnome-print? The output would
> still be bigger and less optimized (Gnome-Print optimizes the hell out of
> its generated PS for size and speed). If we support this option, we lose out
> even moreso because we still have to ship those fonts, which is what we'd
> like to avoid in the first place.

 gnome-print is not yet supporting CJK. I won't wonder if it will turn out
that gnome-print will have to be rewritten to support CJK. Only rewriting will
take 5 month IMO. Of course I don't propose to compete with gnome print at PS
generation.
 As for whether to embed everything - it may be useful to most of the users -
e.g. users who use GS as PS interpreter (provided all AW fonts are registered
in GS' fontmap).

> > And also I would like to return back the ability to print to .ps in gnome
> >port - it's too severe to force users to use only unstable gnome-print.
>
> The correct solution is to fix gnome-print. And trust me, Chema and Lauris
> would love the help right now, esp. from intellegent hackers like yourself.
> However, I will not accept patches to revert this behavior. We shouldn't
> need calls like explodeFonts() and setCJKFont() and is_cjk_char() in order
> to display ourselves to the screen or to PS. This is eating up > 20% of my
> abiword-process time, which IMHO is unacceptable.

 As for 20% of process time - there are no alternatives to this (except
optimizing current code) to reduce CPU time for these functions when *drawing
to screen*. These 20% could be avoided only if printing, by using gnome-print.
But that's not worth it that much (improving PS generation performance via
using only gnome-print). So, using GP is not a solution to 20% of process time
taken by vairous CJK-oriented functions.

> > Also, it still would be nice to make AW full supporting TTFs (even with
> >non-unicode ttf fonts).
>
> This would be great. Maybe we could use freetype for this?

 If we can live without XP PS, FreeType won't be needed - we can query X about
glyphs dimensions IMO. But I'm not 100% sure.

> Dom
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com
>

 Best regards,
  -Vlad



This archive was generated by hypermail 2b25 : Wed Jan 31 2001 - 10:02:59 CST