Forum Feature requests

fallback glyphs

Hi-Angel
I am not sure whether should I report a bug, or rather leave it as a feature request. The problem is that sometimes glyphs are missing in font. A minimal example to reproduce:
$cat 1.html
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<p style="font-family: Times New Roman">⨝</p>
$ prince 1.html -o 1.pdf
prince: warning: no glyphs for character U+2A1D, fallback to '?'

The glyph indeed missing in the «Times New Roman», but it is e.g. in «FreeSerif». There should be a way to take missing glyphs from a fallback font.

I tried to edit «font.css» by adding a font to the comma separated list after «Times New Roman», but it seems to work only for missing fonts, not the glyphs, which is the problem.

P.S. yes, I have «msttcorefonts» installed, and I checked the font — the glyph is missing in «Times New Roman».

Edited by Hi-Angel

mikeday
Do you have the OpenSymbol font installed? That is included in fonts.css as a generic fallback.
Hi-Angel
Yep. I just checked with «gucharmap» — the OpenSymbol font have no the «large bowtie» symbol (it's the problem one)

SOLVED: While experimenting, I found that it is possible to fix by editing the «fonts.css» — but not by adding the font to the comma separated list, but rather by creating a separate block with the font.

It weren't obvious, I hope it will help someone.
mikeday
Right, the comma separated list shows which font will be used, and multiple @font-face rules will be used for fallback. Unfortunately that isn't very obvious at all.
Hi-Angel
Seems that the problem aren't very solved… Here's a code to reproduce it (almost the same as previous)
$ cat 1.html
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />       
<p style="font-family: Times New Roman">⨝ₘ</p>                     
$ prince 1.html -o 1.pdf                                               
prince: warning: no glyphs for character U+2098, fallback to '?'

The warning is about the second symbol, and the weirdness is that glyphs actually are in the both «Times New Roman» and «FreeSerif» which I added previously as a fallback. More over, if I remove the fallback font — then a warning appears about the first symbol too, thus we can infer that the fallback works… almost.
mikeday
I could not find U+2098 in my local copy of Times New Roman or OpenSymbol, but it was in DejaVu Serif.
Hi-Angel
Strange, I am clearly see the «U+2098» glyph in th Times New Roman with «gucharmap» app (it have an option to show glyphs only from the exact font; however, when I fed an online service that lists font glyphs from a font with the font file, it didn't show the glyph…

Either way, thank you, adding «DejaVu Serif» indeed fixes the problem…
mikeday
There are several different versions of Times New Roman floating around, and the newer versions have expanded character range, which could have something to do with it.