default to zero width characters in truetype for '.notdef'

when the character is not defined and the corresponding '.notdef' glyph isn't included in a truetype font we now default to a zero width character. it might be that we should use the default/missing width instead but this will work ok for most use-cases.
This commit is contained in:
Eliot Jones
2020-02-26 12:39:12 +00:00
parent 50c17f7951
commit 43afac8f5d

View File

@@ -87,7 +87,10 @@
}
var name = encoding.GetName(characterCode);
var metrics = fontMetrics.CharacterMetrics[name];
if (!fontMetrics.CharacterMetrics.TryGetValue(name, out var metrics))
{
return new CharacterBoundingBox(new PdfRectangle(), 0);
}
if (overrides?.TryGetWidth(characterCode, out width) != true)
{