[XeTeX] Linking with FreeType 2 on Mac OS X

Jonathan Kew jonathan_kew at sil.org
Sat Feb 10 22:47:39 CET 2007

On 10 Feb 2007, at 9:37 pm, Jjgod Jiang wrote:

> Hi Jonathan,
> I've been trying to fix a xdvipdfmx bug on Plane 1+ characters
> support.

Oh, does it not handle these? I wasn't aware of that; a bug report  
complete with patch would be welcome! :)

> But I found that I could not build it successfully on my
> Mac (I used to build that on my Linux box).
> Here is the situation: I'm using libkpathsea from i-Installer and
> FreeType 2.1.10 from macports. So I use:
> ./configure --with-kpathsea=/usr/local/TeXLive --with-freetype2=/ 
> opt/local
> According to the output:
> checking for kpse_find_file in -lkpathsea... yes
> checking whether you have kpathsea headers and they know about the
> required file formats... yes
> checking for freetype2 header files and library... yes
> checking for FT_Init_FreeType in -lfreetype... yes
> checking for fontconfig header files... no
> checking for Mac OS X ApplicationServices framework... yes
> Looks pretty fine, but when I typed make, it ended up like this:
> gcc -g -O2 -o xdvipdfmx xdvipdfmx-agl.o [dozens of .o files]
> -framework ApplicationServices  -L/usr/local/TeXLive/lib
> -L/usr/local/lib /usr/local/TeXLive/lib/libkpathsea.a
> /usr/local/lib/libfreetype.dylib -lz
> /usr/bin/ld: Undefined symbols:
> _FT_GetFile_From_Mac_ATS_Name
> _FT_New_Face_From_FSSpec
> collect2: ld returned 1 exit status
> make[2]: *** [xdvipdfmx] Error 1
> make[1]: *** [all-recursive] Error 1
> make: *** [all] Error 2

This indicates that the Freetype library was built without support  
for Mac-specific routines used to interface with the Mac OS X font  
system. I don't remember exactly what the Freetype configure options  
are, but this is a config-time choice when building the library.

So that means you'll probably have to build FT2 yourself and ensure  
you include the Mac-specific routines.

It also means that the xdvipdfmx configure script ought to check  
specifically for this functionality (when configuring on Mac OS X);  
right now it only checks basic availability of the library, sorry.

> At first I thought may be my FreeType 2 is too dated, so I fetch a  
> copy
> of recent FreeType 2.3.1, but got exacly the same failure.
> (I checkout xdvipdfmx source from XeTeX repository, may be it's fixed
> in TeX Live SVN repository?)

The xdvipdfmx source will be the same (as far as this is concerned);  
the issue is with the build of the freetype2 lib. Within TL,  
freetype2 is built with the correct setup, but if you're building it  
separately you'll need to investigate the configure options yourself.

HTH ..... JK

More information about the XeTeX mailing list