[MacPorts] #30745: xdvipdfmx not able to use /System/Library/*.dfont fonts, freetype --with-old-mac-fonts involved
MacPorts
noreply at macports.org
Sun Aug 14 02:56:12 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@…):
>> "Old Mac fonts" are those having a resource fork. As far as I remember,
Tiger was the last time Apple shipped any of those; since Leopard, it has
shipped fonts using the data fork only. If tdvipdfmx checks for freetype's
ability to load resource-fork-based fonts as some kind of indication of
whether it can work at all on a Mac, then that sounds like a bug in
tdvipdfmx that needs to be fixed.
> I don't think that's quite correct -- freetype's --without-old-mac-fonts
appears to disable all of the Mac-specific API, including
FT_GetFilePath_From_Mac_ATS_Name, which doesn't seem resource-fork-
specific. That's what xdvipdfmx is looking for.
Not passing --with-old-mac-fonts to freetype does more than just dropping
support for resource-based fonts. It entirely disables dependency on OS X
frameworks, including the {{{FT_GetFilePath_From_Mac_ATS_Name}}} function
which is not resource-fork specific. In fact, it removes all Mac-specific
code. The real issue with gd2 was not the use of these functions, it was
that freetype is linked with a framework whenever --with-old-mac-fonts is
passed. This is different but not totally unrelated to
[http://openradar.appspot.com/7209349 radr://problem/7209349] : strange
things happen when a framework is first loaded within a non-main thread.
The [http://openradar.appspot.com/7209349 radr://problem/7209349] bug is
not fixed in 10.6.8 (did not test it in 10.7 yet), but the gd2 bug may
have been fixed in 10.6. Hence my question about the current state of gd2
and bug #15909 because passing --with-old-mac-fonts on OS X seems a good
idea (using Mac-specific code provides better handling of Mac fonts) and
it is probably what other distributions of texlive do.
> The functions it needs are simple enough that we could probably build
them into xdvipdfmx without too much trouble, though...
> Does this patch solve your problem? (patch is against port dir texlive-
bin; make sure you're using the regular freetype without --with-old-mac-
fonts, and build texlive-bin +atsui)
I thought about providing just the functions indeed, yet tests I have just
conducted with your patch show it is not sufficient.
For the record, I do not think it is related to the ATSUI problem of
texlive. ATSUI is deprecated and most functions are just no longer
available on 10.7 and on 10.5+ 64 bits. However, the ATS functions
xdvipdfmx and Freetype need/use have no equivalent in CoreText and
therefore are still available, although not recommended, even in 10.7
according to
[http://developer.apple.com/legacy/mac/library/documentation/Carbon/reference/ATS/ATS.pdf].
Your patch compiles fine (generates a 64bits binary) without +atsui, even
if the line you added within the "if {![variant_isset atsui]}" block is
removed (i.e. xdvipdfmx is linked against ApplicationServices).
However, passing --with-old-mac-fonts to freetype does more than just
providing the couple of functions that was missing to xdvipdfmx. It
provides an alternate version of FT_New_Face which, I believe, is able to
look into dfont files beyond the first sfnt with the help of parameter
{{{face_index}}}.
I did several tests with a simple tex file that uses *.dfont fonts
available in 10.6.8 in /System/Library/. You'll find attached the (newer)
diff to texlive-bin that I used for these tests (allowing a non-atsui
64bits xdvipdfmx build that links against OS X frameworks) as well as
several outputs. You'll notice that Courier does not work, but other fonts
only work in all their styles if Freetype is compiled with --with-old-mac-
fonts only. The PDFs were generated with {{{xelatex test.tex}}} which
invokes xdvipdfmx by default.
After this test, I strongly suggest rehabilitating --with-old-mac-fonts to
Freetype.
I wanted to test with +atsui, but texlive-bin currently does not compile
with +atsui (this should be in another ticket...)
--
Ticket URL: <https://trac.macports.org/ticket/30745#comment:7>
MacPorts <http://www.macports.org/>
Ports system for Mac OS
More information about the macports-tickets
mailing list