[texworks] Mac OS TeXworks + fontconfig (was: Another TeXworks mac build (with a buildsystem!))
chuck at sharpsteen.net
Thu May 26 07:54:56 CEST 2011
On Mon, May 16, 2011 at 4:34 AM, Jonathan Kew <jfkthame at googlemail.com> wrote:
> On 15 May 2011, at 13:10, Stefan Löffler wrote:
>> On 2011-05-13 06:35, Charlie Sharpsteen wrote:
>>> I could add a file to the TeXworks source that apackager could use to
>>> install Poppler thusly:
>>> brew install --with-qt4 --enable-xpdf-headers cmake/packaging/mac/poppler.rb
>>> And the patches in `lib-patches` would be applied automatically.
>> Sounds good to me. It's really just the poppler-qt4-globalparams.patch,
>> as poppler-win32-font-handling.patch only applies to Windows-specific files.
>>> So, I guess the question is---how badly do we want to get rid of
>>> Fontconfig? Leaving it in is starting to look like the easiest course
>>> of action on OS X.
>> This is up to Jonathan Kew to decide (I explicitly CC'ed him to this
>> mail, hopefully he'll reply), as he set up the original "no-fontconfig"
>> policy. Not being a Mac developer or user myself, I can only abide by
>> the judgment of those who must live with the consequences (whatever they
>> may be).
> There are a few questions that I think need answering before making a definite statement here.
> Does the fontconfig-based build recognize the correct collection of installed fonts (so that PDFs that use any of those fonts, and don't have them embedded, will display as expected on the user's system)? On my laptop here, I notice that the list of fonts shown by fc-list in the Terminal does *not* seem to match the list displayed by Apple's ftxinstalledfonts (from the Apple Font Tool suite), so I'm a bit suspicious that the two "worlds" are not necessarily kept in sync properly.
> Does this version of fontconfig work without adding cache files to each font directory that it scans? It used to do that, but perhaps Apple has customized it so as to avoid this, or at least make the cache files invisible? (I didn't see font cache files on my laptop, so I think this issue may have been solved.)
> What happens if the TeXworks user doesn't have the X11 package installed? At least on older OS versions, it was a non-default optional install, so IMO an application like TW that aims to be a Mac OS app (rather than an X11 app) should not depend on it.
I have been tinkering with this for a while and here is what I've been
able to learn:
- As of OS X 10.5.0, X11 is installed by default. A user has to go out
of their way to disable X11 during installation.
- CMake copies all dynamic libraries that are external dependencies of
TeXworks into the .app bundle during packaging. An external dependency
is defined as any library discovered by `otool -L` that is not in
`/usr/lib` or part of a framework in `/System/Library/Frameworks`. As
far as I can tell, this version of Fontconfig does not leave any
"droppings" in ~/Library/Fonts or /System/Library/Fonts or
- If I do install OS X without X11, my builds of TeXworks will still
run but the viewer fails to display `base-14-fonts.pdf` correctly. If
I copy the contents of `/usr/X11/lib/X11/fonts` and
`/usr/X11/lib/X11/fontconfig` over to the new machine, then things
work better but there are still some failures in the Symbol and
ZapfDingbats fonts. So, Poppler does indeed depend on more than
fontconfig.dylib if PDF files without embedded fonts are to be
Here is what `base-14-fonts.pdf` looks like on a machine with X11 fonts:
Here is what it looks like on a machine without X11 fonts:
Re-building Poppler to use Quartz font handling took some doing, but
here are the results on a machine without X11 fonts:
Applying the patches to Poppler and re-running autoconf is a bit of a
maintenance burden. If we do decide to drop fontconfig from the mac
build, I would suggest re-submitting the patches to the Poppler
project as having Quartz font support in the official source would
dramatically cut down the amount of maintenance we would have to do.
More information about the texworks