Forum Bugs

No Support for HTML Characters using Dingbats

mmccumber
Web sites are switching to HTML characters instead of images to render things like checkmarks. Prince does not support them, at least those that utilize the Dingbats font.
https://www.w3schools.com/charsets/ref_utf_dingbats.asp
-- I'm using the character ✔ -- the checkmark

Instead of seeing a checkmark, a ? will display. The convert log says "no font for Dingbats character U+2714, fallback to '?'

I've tried to get this working on both Windows XP and Windows 10, both of which have the Dingbats font and all browsers display the characters just fine. I also installed a font that was suggested by a Prince representative and that didn't work.

I tried copying the character rendered in the browser into the web page as a unicode character and that didn't work.

Additionally, if I have a <input type="checkmark" checked> I also get a ? instead of the checkmark.

dauwhe
I just made a simple HTML doc:

<body>
&#10004;
</body>


and the checkbox displayed fine on Mac OS X. Sorry I don't have any insight for Windows fonts.

Note that it should be type="checkbox" instead of type="checkmark"

Regards,

Dave
mikeday
I will investigate the Windows font situation next week when I return from China. In the meantime, installing the OpenSymbol font and including "OpenSymbol" in the font-family property should do the trick.
hallvord
I can confirm that using the OpenSymbol font works on my Win8 machine. Also, I believe browsers handle such esoteric characters by using "font switching", picking a font where said character exists. I've attached the output when Prince vs a web browser renders a document with a check mark (as HTML entity) is styled with four different font-family values - note how the browser renders three of these checkmarks identically even though the fonts that are specified are rather different.

Does Prince not do such automatic font switching?

Announcement: repos for tests/utils

  1. browser-check.png11.3 kB
    Browser rendering - 4 different fonts
  2. prince-check.png40.2 kB
    Prince rendering - 4 different fonts
hallvord
BTW, here's the source code for that test.

Announcement: repos for tests/utils

  1. checkmark-entity-001.htm0.6 kB
    The test case
mikeday
Prince will go through the fonts specified by the font-family property until it finds one that has a glyph for the character. If none of them do, it falls back to the default CSS "serif" font family, which for Prince is defined with a bunch of @font-face rules in the installed fonts.css file, and typically includes a set of fonts for different scripts including OpenSymbol on Linux.
mikeday
In Prince 13.2 we have added the Segoe UI Symbol font as a fallback on Windows which should help!