Forum Bugs

"Arial Narrow" ok in Tiger; in Leopard, Bold/ital

Chris Thorman
Consider this test document:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Arial Test</title>
<style>
body {font: 20pt "Arial Narrow";}
</style>
</head>
<body>
<p>This is Arial Narrow. <b>This is bold.</b> <i>This is italic.</i> <b><i>This is bold italic.</i></b></p>
</body>
</html>

This renders as expected in Safari.

In Prince, this worked OK in Tiger (Mac OS X 10.4) with 5.1r11. In Leopard (10.5), I tried it with both 5.1411 and 6.0r4, and find that the bold, italic, and bold italic variants no longer appear -- and instead Times is substitued.

Verbose mode shows some "bad argument" warnings which mean nothing to me but might be a clue. It also shows that the wrong fonts are being used for the non-Regular faces.

[cthorman@chris-thormans-mac-pro book]# ../../../prince-r11/lib/prince/bin/prince -v arialtest.html arialtest.pdf
prince: loading XML input: arialtest.html
prince: used font: Arial Narrow, Regular
prince: warning: bad argument
prince: warning: bad argument
prince: used font: Times, Bold
prince: warning: bad argument
prince: warning: bad argument
prince: used font: Times, Italic
prince: warning: bad argument
prince: used font: Times New Roman, Bold Italic

[cthorman@chris-thormans-mac-pro book]# ../../../prince-6.0r4-macosx/lib/prince/bin/prince -v arialtest.html -o arialtest.pdf
prince: loading XML input: arialtest.html
prince: used font: Arial Narrow, Regular
prince: warning: bad argument
prince: warning: bad argument
prince: used font: Times, Bold
prince: warning: bad argument
prince: warning: bad argument
prince: used font: Times, Italic
prince: warning: bad argument
prince: used font: Times New Roman, Bold Italic

In my Leopard install, the font files for these are in:

/Library/Fonts/Arial Narrow[Bold, Italic, etc.].ttf

I don't know offhand whether these are part of the base Mac OS X nowadays, or are installed with Microsoft Office... the answer might be "both" in Leopard, and perhaps that is the difference?

Any hope for a fix sometime soon? This is blocking a publication I need to update...

Thanks,

-c
mikeday
Thanks, we'll take a look at this issue.
Chris Thorman
Hi Mike,

Are you guys able to reproduce this issue? What is the likelihood that a fix will be included in the 6.0r5 release?

-c
mikeday
We haven't reproduced this issue yet as we're still waiting on a Leopard test system. One workaround that might be worth trying is referring to the .ttf files directly using @font-face rules, and seeing if that helps avoid the problem:
@font-face {
    font-family: Test Arial Narrow;
    font-weight: bold;
    font-style: normal;
    src: url("/Library/Fonts/Arial Narrow Bold.ttf")
}
...
<p style="font-family: Test Arial Narrow"><b>Hello, world</b></p>
Chris Thorman
Hi Mike,

Thanks for the suggestion.

Eagerly, I amended the test document as shown, and unfortunately got identical debugging output, and results (Times substituted).

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Arial Test</title>
<style>
@font-face {
    font-family: "Arial Narrow";
    font-weight: normal;
    font-style: normal;
    src: url("/Library/Fonts/Arial Narrow.ttf")
}
@font-face {
    font-family: "Arial Narrow";
    font-weight: bold;
    font-style: normal;
    src: url("/Library/Fonts/Arial Narrow Bold.ttf")
}
@font-face {
    font-family: "Arial Narrow";
    font-weight: normal;
    font-style: italic;
    src: url("/Library/Fonts/Arial Narrow Italic.ttf")
}
@font-face {
    font-family: "Arial Narrow";
    font-weight: bold;
    font-style: italic;
    src: url("/Library/Fonts/Arial Narrow Bold Italic.ttf")
}
body {font: 20pt "Arial Narrow";}
</style>
</head>
<body>
<p>This is Arial Narrow. <b>This is bold.</b> <i>This is italic.</i> <b><i>This is bold italic.</i></b></p>
</body>
</html>

-c
mikeday
Try using a different family name (eg. Test Arial Narrow) to ensure that it's picking up the correct declarations.
mikeday
Today we have released Prince 6.0 rev 6, which should reduce the incidences of these "bad argument" warnings for fonts on MacOS X Leopard.
oliof
I can confirm that I don't see 'bad argument' errors on Leopard anymore that I had seen in the past.
Chris Thorman
This problem has been fixed with Arial in 6.0r6. However, it is still happening with a font I have called "Sabon RomanSC" (roman small caps). The font is found correctly on Linux, but is not found on Mac OS X.

Here is the info from FontBook:

PostScript name Sabon-RomanSC
Full name Sabon Roman Small Caps & Oldstyle Figures
Family Sabon RomanSC

Below is a test document which renders correctly on Linux, but incorrectly on Mac.

The output from the tool (with -v option) is:

prince: used font: Sabon LT, Regular
prince: used font: Times New Roman, Bold Italic

(Obviously the substitution with Times Bold Italic should not be taking place -- and the choice of substituted font/weight/style seems very strange.)

-c


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>A Title</title>
</head>
<body>
<p style='font-family: "Sabon LT"'>Sabon LT - Should be in regular Sabon.</p>
<p style='font-family: "Sabon RomanSC"'>Sabon RomanSC - Should Be In Small Caps: 0123456789</p>
<p style='font-family: "Sabon-RomanSC"'>Sabon-RomanSC - Should Be In Small Caps: 0123456789</p>
</body>
</html>
mikeday
Sorry about this, we hope to fix it for good in Prince 7.0 when we will be making a number of improvements to font scanning on MacOS X. In the meantime, one workaround might be to point at the font file directly using an @font-face directive.
mikeday
The new beta version of Prince 7.0 available now includes rewritten font support for MacOS X using the latest Core Text API available in Leopard. Hopefully this should greatly improve font detection.