Forum How do I...?

Special characters rendered with Times New Roman

nico
This question is related to my previous post (http://www.princexml.com/bb/viewtopic.php?t=62229).

When special characters like arrows are used, Prince cannot use the specified font-family and defaults to Times New Roman. Firefox behaves the same. Safari, Chrome and Opera handle this correctly.

There are two problems with this behavior :

  1. The look is not what it should.
  2. Times New Roman font is also embedded in the pdf and increases the file size.

You’ll find images and related code below.

Any idea how to solve this ?

Regards,

Nicolas


<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<title>Test Font Used</title>
</head>
<body>

<p style="font-family: Times New Roman; font-size: 3em;">
	&darr;&larr;&rarr;&uarr;
</p>

<p style="font-family: Helvetica Neue; font-size: 3em;">
	&darr;&larr;&rarr;&uarr;
</p>

</body>
</html>
  1. font_used_prince.png10.4 kB
  2. font_used_safari.png9.8 kB
mikeday
Helvetica Neue does not have glyphs for the arrows, so I'm not sure where Safari is getting them from, perhaps another default sans-serif font? In fact on MacOS 10.5.7 it appears that Times New Roman does not have glyphs for these arrows either, although the regular Times New Roman available from Microsoft does.
nico
OK, now I understand.

On my system (OSX 10.8.2), Times New Roman has glyphs for these arrows (Glyphs 312 to 315, U2190 to U2193), but it seems that you are right, Helvetica Neue does not have glyphs for these.

What software do you use to tell if a glyph is available or not ? I find it very difficult to work with the built-in OSX Font Book.app.
mikeday
Well, I use Prince. :)

Specifically, I look at the generated PDF file and see which fonts were used for which glyphs. This is convenient for me, but it might be more sensible to look at the font in a proper font editor.