freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Devel] Re: Type1 loader overwrites FontInfo dict with private dict


From: Ron . Dev
Subject: [Devel] Re: Type1 loader overwrites FontInfo dict with private dict
Date: Fri, 30 May 2003 18:21:30 +0200 (CEST)

Hello,

many thanks to Werner for the quick fix. It works (for me at least)!

Ok, first testing the primary culprit with fc-cache:

"hvo_____.pfb" 0 "Helvetica:style=Oblique:slant=100:weight=100:...
"hv______.pfb" 0 "Helvetica:style=Regular:slant=0:weight=100:...

Looks fine now!

While testing it on my collection I found that I get different output now
for the following fonts:

agdo____.pfb  ITC Avant Garde Gothic Demi Oblique
agwo____.pfb  ITC Avant Garde Gothic Book Oblique
cobo____.pfb  Courier Bold Oblique
coo_____.pfb  Courier Oblique
hvbo____.pfb  Helvetica Bold Oblique
hvcbo___.pfb  Helvetica Condensed Bold Oblique
hvcdo___.pfb  Helvetica Condensed Oblique
hvnbo___.pfb  Helvetica Narrow Bold Oblique
hvno____.pfb  Helvetica Narrow Oblique
hvo_____.pfb  Helvetica Oblique
ludo____.pfb  ITC Lubalin Graph Regular
luwo____.pfb  ITC Lubalin Graph Regular
uvbo____.pfb  Univers 65 Bold Oblique
uvbvo___.pfb  Univers 63 Bold Extended Oblique
uvcbo___.pfb  Univers 67 Condensed Bold Oblique
uvcdo___.pfb  Univers 57 Condensed Oblique
uvlo____.pfb  Univers 45 Light Oblique
uvo_____.pfb  Univers 55 Oblique
uvvo____.pfb  Univers 53 Extended Oblique

Looks like synthetic fonts are pretty common ...

I tested this with fontconfig, X RENDER extension for Qt (e.g. Opera) and
with OpenOffice.org 1.1beta2 (uses a strange mixture of Xft and their
own font system). The display is ok and the corrected fonts.cache-1 files
work fine.

While testing I found another bug that has been lurking there for quite
a while: The routine to guess the style from /FullName and /FamilyName
fails when there are some minor irregularities. It should ignore all
embedded spaces and minus signs when matching the names. I sent a patch
to Werner in private mail.

Here are some test cases:

/FullName (ITC LubalinGraph Demi Oblique) readonly def
/FamilyName (ITC Lubalin Graph) readonly def
OLD: family="ITC Lubalin Graph", style="Regular"
NEW: family="ITC Lubalin Graph", style="Demi Oblique"

/FullName (Adobe Garamond Bold) readonly def
/FamilyName (AdobeGaramond) readonly def
OLD: family="AdobeGaramond" style="Garamond Bold"
NEW: family="AdobeGaramond" style="Bold"

/FullName (Dingbats ) readonly def
/FamilyName (Dingbats) readonly def
OLD: family="Dingbats", style=""
NEW: family="Dingbats", style="Regular"

(this is URW Dingbats, not ITC Zapf Dingbats)

And finally a case that shows how futile our attempt to guess the style is:

/FullName (ITC Mona Lisa Recut) readonly def
/FamilyName (ITC Mona Lisa) readonly def

family="ITC Mona Lisa", style="Recut"    (oh well ...)

Of course no change with the patch and I think this is really not our fault
(and not a problem).

Anyway, thanks again for the patch! When the next version is released
several other projects should be notified: fontconfig.org, OpenOffice.org,
Qt, KDE and Gnome. I think something like this would do:

-----
Version X.X.X of FreeType2 fixes a bug with several common PostScript Type1
fonts. Some internal attributes have not been interpreted properly for
so called "synthetic fonts" (e.g. the italic font is just a wrapper with
a different translation matrix around the regular font). This affected
fonts like Helvetica, Courier, Avant Garde, Univers and others (from various
font foundries, but not all of them). Also the names of the styles of
some fonts were malformed (e.g. "Garamond Bold" instead of "Bold" for
Adobe Garamond Bold).

Since FreeType is widely used this directly or indirectly affects a rather
large number of applications. E.g. the font cache used for Xft had wrong
attributes for the Italic/Oblique variants (slant=0 instead of slant=100).
Depending on the order of the fonts in the filesystem and the particular
font selection process you could randomly get the wrong font.

The user visible symptoms generally looked like:
- Some fonts randomly display only in italic (or only in bold).
- On first (or on second) invocation of some app, I get only italic
  (or bold) fonts.

Please direct your users to upgrade their FreeType2 libraries if they
have related problems.
-----

On a related note to OpenOffice.org:
-----
If anyone has problems getting OpenOffice.org to use their PostScript fonts:
Use lowercase names! While Xft is ignorant about the case of the extension,
OOo somehow ignores *.PFB/*.PFA. This leads to strange results (coarse font
display and even printing problems), because Xft knows about the fonts and
OOo doesn't. Also you always need the *.afm for OOo, too (but not for Xft).
-----

BTW: Please do not include my E-Mail address anywhere. Thank you.

|Ron|



reply via email to

[Prev in Thread] Current Thread [Next in Thread]