[Bug 578460] mkfontscale cannot read TrueType font and when it fails, it generates index with '?'
bugzilla at redhat.com
bugzilla at redhat.com
Wed Apr 7 16:06:58 UTC 2010
Please do not reply directly to this email. All additional
comments should be made in the comments box of this bug.
https://bugzilla.redhat.com/show_bug.cgi?id=578460
Behdad Esfahbod <besfahbo at redhat.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Flag|needinfo?(besfahbo at redhat.c |
|om) |
--- Comment #5 from Behdad Esfahbod <besfahbo at redhat.com> 2010-04-07 12:06:56 EDT ---
The font correctly follows the OpenType specification in defining 'name' table
entries in platform=3, encoding=0 (symbol) instead of platform=3, encoding=1
(Unicode). mkfontscale however seems to be unable to handle that.
The relevant parts of the spec are from this page:
http://www.microsoft.com/typography/otspec/name.htm
"""
When building a Unicode font for Windows, the platform ID should be 3 and the
encoding ID should be 1. When building a symbol font for Windows, the platform
ID should be 3 and the encoding ID should be 0. ...
...
Note that OS/2 and Windows both require that all name strings be defined in
Unicode. Thus all 'name' table strings for platform ID = 3 (Windows) will
require two bytes per character. Macintosh fonts require single byte strings.
"""
The following patch for mkfontscale makes it examine all platform=3 (Windows)
encodings. Fixes the problem in this bug and I don't expect it introduce any
issues. I do need to consult the OpenType mailing list though, since this part
of the spec is a bit contradictory.
Anyway, here's the patch for now. Should actually be safe to go in.
diff -up xorg-x11-font-utils-7.2/mkfontscale-1.0.7/mkfontscale.c.symbol
xorg-x11-font-utils-7.2/mkfontscale-1.0.7/mkfontscale.c
--- xorg-x11-font-utils-7.2/mkfontscale-1.0.7/mkfontscale.c.symbol 2010-04-07
12:04:29.000000000 -0400
+++ xorg-x11-font-utils-7.2/mkfontscale-1.0.7/mkfontscale.c 2010-04-07
12:03:54.000000000 -0400
@@ -317,7 +317,7 @@ getName(FT_Face face, int nid)
int i;
if(getNameHelper(face, nid,
- TT_PLATFORM_MICROSOFT, TT_MS_ID_UNICODE_CS, &name) ||
+ TT_PLATFORM_MICROSOFT, -1, &name) ||
getNameHelper(face, nid,
TT_PLATFORM_APPLE_UNICODE, -1, &name)) {
string = malloc(name.string_len / 2 + 1);
Ideally though, mkfontscale should be updated/rewritten to use fontconfig.
--
Configure bugmail: https://bugzilla.redhat.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the fonts-bugs
mailing list