handle missing embedded cid font for type 0 fonts

all font file entries in the font descriptor for type 0 fonts are optional. if the font is missing we default to returning the default bounding box.
This commit is contained in:
Eliot Jones
2020-01-14 14:52:51 +00:00
parent e8401b87cf
commit a36f5a3af3

View File

@@ -90,6 +90,11 @@
{
throw new ArgumentException($"The provided character identifier was negative: {characterIdentifier}.");
}
if (fontProgram == null)
{
return Descriptor?.BoundingBox ?? new PdfRectangle(0, 0, 1000, 0);
}
if (fontProgram.TryGetBoundingBox(characterIdentifier, out var boundingBox))
{