ADD : name on type 3 fonts

This commit is contained in:
romain v
2020-09-10 14:16:14 +02:00
parent 58ecfbf963
commit 9315ec5a4f

View File

@@ -50,10 +50,27 @@
}
}
return new Type3Font(NameToken.Type3, boundingBox, fontMatrix, encoding, firstCharacter,
var name = GetFontName(dictionary);
return new Type3Font(name, boundingBox, fontMatrix, encoding, firstCharacter,
lastCharacter, widths, toUnicodeCMap);
}
private NameToken GetFontName(DictionaryToken dictionary)
{
if (!dictionary.TryGet(NameToken.Name, out var fontName))
{
return NameToken.Type3;
}
if (fontName is NameToken nameToken)
{
return nameToken;
}
return NameToken.Type3;
}
private TransformationMatrix GetFontMatrix(DictionaryToken dictionary)
{
if (!dictionary.TryGet(NameToken.FontMatrix, out var matrixObject))