All, Like many other folks, we often run across the "[character] is not available in this font [font]" when we try to use some character such as ≥ or ≤ or ® or whatever.
(We are trying to keep the generated PDF files as small as possible, so
we'd prefer to use the simplest fonts possible.)
For most of these characters, we have simply created a mapping in our
PDF-generation wrapper code that does roughly this:
string = string.replace("≤", "<=");
string = string.replace("®", "(R)");
etc.
(It's smarter and more efficient than that, but you get the idea.)
We are starting to find more and more characters that aren't quite as
decomposible as those shown above, such as ç (that's the c-with-hook you
see in the word garçon). We have resorted to replacing them with just a
plain-old 'c' for the time being.
But I'm wondering if there is a better way to handle these. I'm
perfectly happy to replace ® with (R) for the most part, but when we
have these characters with no direct replacements (and our product
includes support for emoji, etc.), is there a way to add a single glyph
for a single character to a PDF? Something like:
document.addCharacterGlyph('ç', image)
?
Or is there a good way to determine what font contains a particular
glyph such as ç?
One of our goals is to keep the resulting size of these PDFs to a
minimum, so we'd like some strategy that doesn't require including MBs
of font information just on the off-chance that a string we need to put
in there has such a character.
Thanks in advance,
-chris
signature.asc
Description: OpenPGP digital signature

