handle missing encodings in cff fonts

This commit is contained in:
Eliot Jones
2020-01-05 13:16:31 +00:00
parent b29354e3e6
commit e1b39983d0
2 changed files with 16 additions and 1 deletions

View File

@@ -52,5 +52,20 @@
{
return Fonts.First().Value.GetCharacterBoundingBox(characterName);
}
/// <summary>
/// Get the name for the character with the given character code from the font.
/// </summary>
public string GetCharacterName(int characterCode)
{
var font = Fonts.First().Value;
if (font.Encoding != null)
{
return font.Encoding.GetName(characterCode);
}
return ".notdef";
}
}
}