use default width if present

if no widths array entry exists for the character and no font program is present for a true type simple font then use the 0 index glyph width if present in the widths array.
This commit is contained in:
Eliot Jones
2020-01-14 15:18:07 +00:00
parent b50f476c31
commit f29170fef8

View File

@@ -148,6 +148,10 @@
width = boundingBoxPreTransform;
}
}
else if (widths?.Length > 0)
{
width = widths[0];
}
else
{
throw new InvalidOperationException($"Could not retrieve width for character code: {characterCode} in font {Name}.");