Forum How do I...?

Unknown ttf file format

csxt
We're trying to get PrinceXML working on our Linux server. As its a server, XWindows or a font server are NOT installed, so we modified fonts.css to reference the fonts directly. What might cause such a problem?

Here is the log out put errors,

Wed Nov 20 22:07:12 2013: ---- begin
Wed Nov 20 22:07:12 2013: debug: loading license: /usr/lib/prince/license/license.dat
Wed Nov 20 22:07:12 2013: loading style sheet: /usr/lib/prince/style/fonts.css
Wed Nov 20 22:07:12 2013: debug: loaded resource: /usr/lib/prince/style/fonts.css
Wed Nov 20 22:07:12 2013: debug: loaded resource: type: no
Wed Nov 20 22:07:12 2013: Loading document...
Wed Nov 20 22:07:12 2013: loading HTML5 input: -
Wed Nov 20 22:07:12 2013: debug: loaded document: -
Wed Nov 20 22:07:12 2013: debug: sniffed doctype: XHTML
Wed Nov 20 22:07:12 2013: Applying style sheets...
Wed Nov 20 22:07:12 2013: loading style sheet: /usr/lib/prince/style/xhtml-ns.css
Wed Nov 20 22:07:12 2013: debug: loaded resource: /usr/lib/prince/style/xhtml-ns.css
Wed Nov 20 22:07:12 2013: debug: loaded resource: type: no
Wed Nov 20 22:07:12 2013: loading style sheet: /usr/lib/prince/style/common.css
Wed Nov 20 22:07:12 2013: debug: loaded resource: /usr/lib/prince/style/common.css
Wed Nov 20 22:07:12 2013: debug: loaded resource: type: no
Wed Nov 20 22:07:12 2013: loading style sheet: /usr/lib/prince/style/hyph.css
Wed Nov 20 22:07:12 2013: debug: loaded resource: /usr/lib/prince/style/hyph.css
Wed Nov 20 22:07:12 2013: debug: loaded resource: type: no
Wed Nov 20 22:07:12 2013: loading style sheet: /usr/lib/prince/style/mathml.css
Wed Nov 20 22:07:12 2013: debug: loaded resource: /usr/lib/prince/style/mathml.css
Wed Nov 20 22:07:12 2013: debug: loaded resource: type: no
Wed Nov 20 22:07:12 2013: loading style sheet: /usr/lib/prince/style/svg.css
Wed Nov 20 22:07:12 2013: debug: loaded resource: /usr/lib/prince/style/svg.css
Wed Nov 20 22:07:12 2013: debug: loaded resource: type: no
Wed Nov 20 22:07:12 2013: Preparing document...
Wed Nov 20 22:07:12 2013: Converting document...
Wed Nov 20 22:07:12 2013: debug: pack
Wed Nov 20 22:07:12 2013: debug: font request: bold sans-serif
Wed Nov 20 22:07:12 2013: /usr/share/fonts/msttcore/trebucbd.ttf: warning: unknown file format
Wed Nov 20 22:07:12 2013: /usr/share/fonts/msttcore/trebucbd.ttf: warning: unknown file format
Wed Nov 20 22:07:12 2013: warning: no glyphs for character U+0054, fallback to '?'
Wed Nov 20 22:07:12 2013: internal error: no available fonts
Wed Nov 20 22:07:12 2013: ---- end

Edited by csxt

mikeday
How were the fonts installed? If you run "file /usr/share/fonts/msttcore/trebucbd.ttf" what does it print?
csxt
Hi Mike...I'll have to ask our Unix team tomorrow. What has been your experience with the installation that may cause that? File permissions problem?
mikeday
I haven't seen this before actually, if the fonts are installed from the usual package then there isn't a problem. It seems strange that it's only checking bold Trebuchet MS, normally it falls back to Times New Roman. But then you've edited the fonts.css manually as well?
csxt
Command says:

/usr/share/fonts/msttcore/trebucbd.ttf: ASCII text
csxt
Yes, edited fonts.css thinking that was needed since the servers do not have a font server installed.

I know they had a hard time installing the font package because it kept trying to download some .exe files. That freaked out our security team, to say the least.

Edited by csxt

mikeday
Hah, yes. But it doesn't actually run the exe files, as they can't run on Linux anyway. It's just that Microsoft likes to package things up in "cabinet files" which are distributed as exe files that you can run on Windows to extract the files inside, like a self-extracting ZIP file. Linux uses a separate utility called "cabextract" to get the font files out of the cabinet exe without actually running it. This is required due to the license agreement under which Microsoft released the fonts, which prohibits them being repackaged in a more convenient format, unfortunately. It sounds circuitous, but it works.

/usr/share/fonts/msttcore/trebucbd.ttf: ASCII text


That doesn't sound right at all, TTF files are binary. You could open it in a text editor to see what's in there.
csxt
Sure enough Mike, the fella's handling the installation messed up the font install.