[MacPorts] #30745: xdvipdfmx not able to use /System/Library/*.dfont fonts, freetype --with-old-mac-fonts involved
MacPorts
noreply at macports.org
Mon Aug 15 09:48:49 PDT 2011
#30745: xdvipdfmx not able to use /System/Library/*.dfont fonts, freetype --with-
old-mac-fonts involved
---------------------------------+------------------------------------------
Reporter: pguyot@… | Owner: macports-tickets@…
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version: 2.0.1
Keywords: | Port: texlive-bin freetype
---------------------------------+------------------------------------------
Comment(by pguyot@…):
freetype is able to parse dfont files that contains several sfnt resources
that contain a single font each. It cannot handle dfont files that
contains one or more sfnt resources that contain several fonts. But this
is not the case here. See the 2006 introduction to the code handling this
here : [[http://lists.gnu.org/archive/html/freetype-
devel/2006-10/msg00025.html]]
However, freetype computes face_index differently when --with-old-mac-
fonts is enabled. When this option is not enabled, it uses a POSIX-
compliant resource fork parsing code that probably index sfnt resources in
the stream order. When this option is enabled, it uses Get1IndResource
which gets resources in ascending ResID order if I remember correctly.
On the other hand, xdvipdfmx (normally) on non-Mac platforms uses
fontconfig and the index it is passed, but will just fail to parse
truetype fonts with an index greater than 0.
On Mac, xdvipdfmx gets the face index from
FT_GetFilePath_From_Mac_ATS_Name, which happens to be compatible with the
index computed by Get1IndResource.
The proposed patch (texlive-bin.patch and the updated version texlive-
bin.2.patch) gets xdvipdfmx to use FT_GetFilePath_From_Mac_ATS_Name
without freetype --with-old-mac-fonts. Therefore, xdvipdfmx will invoke
freetype with a face_index that will not match the proper style, as
freetype expects an index based on the stream and not based on the ResID.
As a result, styles will get mixed as shown in the PDFs that were
generated and attached to this ticket. However, this does not explain the
output of Helvetica Neue Medium and Helvetica Neue Condensed Bold...
Besides configuring freetype with --with-old-mac-fonts, two other fixes
are possible :
* get xdvipdfmx to handle TrueType fonts with an index greater than 0.
Just replacing {{{#ifdef XETEX_MAC}}} with {{{#ifdef XETEX}}} in the
snippet above does not work, though.
* get freetype to index fonts alike with or without --with-old-mac-fonts
(except for the FOND/sfnt difference ?) and compile xdvipdfmx according to
the proposed patch (i.e. to use FT_GetFilePath_From_Mac_ATS_Name).
--
Ticket URL: <https://trac.macports.org/ticket/30745#comment:11>
MacPorts <http://www.macports.org/>
Ports system for Mac OS
More information about the macports-tickets
mailing list