[texworks] Mac OS TeXworks + fontconfig
Stefan Löffler
st.loeffler at gmail.com
Thu Jun 2 17:00:44 CEST 2011
Hi,
On 2011-06-01 23:38, Charlie Sharpsteen wrote:
> I cleaned the implementation up a little bit by placing the
> substitution inside the first `while` loop along with the other tricks
> that get tried if `ATSFontFindFromPostScriptName` returns
> `kATSUInvalidFontID`:
>
> https://github.com/Sharpie/TeXworks/commit/037a148
Looking good, thanks.
> I also bumped up the debugging verbosity a bit and extended the
> messages to the `getDisplayFont` method which is what calls
> `loadPlatformFont`---this includes messages that get printed every
> time the variable `myName` is altered so that it is different than
> what was copied from `fontName`. The results were interesting:
>
> Lookup font: ZapfDingbats
> Loading font.
> Substituting ZapfDingbatsITC for ZapfDingbats.
> ATSFontFindFromPostScriptName found fontRef
> found 'glyf' table
> found in file: /System/Library/Fonts/ZapfDingbats.ttf
> returning TTF file.
> Finished getDisplayFont.
>
> Bogus memory allocation size
> Bogus memory allocation size
> Bogus memory allocation size
> Bogus memory allocation size
> Bogus memory allocation size
> Bogus memory allocation size
> Bogus memory allocation size
> Bogus memory allocation size
>
>
> ZapfDingbats is the only font for which `loadPlatformFont` has to
> alter the `fontName` in order for `ATSFontFindFromPostScriptName` to
> get a match. It looks like whatever is happening to produce the memory
> errors is happening outside of `GlobalParamsMac.cc`, but may be
> influenced by the substitution that occurs within `loadPlatformFont`.
Yes, it's quite definitely happending outside our code. Whether it's
influenced by the substitution I'm not so sure, though. As far as I can
see, all those substitutions work on a local copy myName of fontName, so
I don't see how this should cause problems.
Anyway, this is quite easy to test:
Could you open the testcase pdf file (in a text editor) and replace all
occurrences of ZapfDingbats by ZapfDingbatsITC? That way, I hope poppler
will look for the correct file straight away and the substitution should
not kick in (though checking with some debugging output lines can't
hurt). If the "Bogus..." lines still occur the problem probably is in
the font file itself...
Alternatively, you can replace another font (e.g., "Times-Roman" >
"Times-RomanTest") in the pdf and add subsitution lines for replacing
"Times-RomanTest" back to "Times-Roman" in the poppler source.
HTH
Stefan
PS: Thanks for persevering :).
More information about the texworks
mailing list