add support for type1c cid fonts

This commit is contained in:
Eliot Jones
2019-12-20 14:46:25 +00:00
parent f401ab3ba0
commit 5e68720495

View File

@@ -131,18 +131,15 @@
throw new PdfDocumentFormatException($"The font file stream did not contain a subtype entry: {str.StreamDictionary}."); throw new PdfDocumentFormatException($"The font file stream did not contain a subtype entry: {str.StreamDictionary}.");
} }
if (subtypeName == NameToken.CidFontType0C) if (subtypeName == NameToken.CidFontType0C
|| subtypeName == NameToken.Type1C)
{ {
var bytes = str.Decode(filterProvider); var bytes = str.Decode(filterProvider);
var font = compactFontFormatParser.Parse(new CompactFontFormatData(bytes)); var font = compactFontFormatParser.Parse(new CompactFontFormatData(bytes));
return font; return font;
} }
if (subtypeName == NameToken.Type1C) if (subtypeName == NameToken.OpenType)
{
}
else if (subtypeName == NameToken.OpenType)
{ {
} }
@@ -151,7 +148,7 @@
throw new PdfDocumentFormatException($"Unexpected subtype for CID font: {subtypeName}."); throw new PdfDocumentFormatException($"Unexpected subtype for CID font: {subtypeName}.");
} }
throw new NotSupportedException("Cannot read CID font from subtype."); throw new NotSupportedException($"Cannot read CID font from subtype: {subtypeName}.");
} }
default: default:
throw new NotSupportedException("Currently only TrueType fonts are supported."); throw new NotSupportedException("Currently only TrueType fonts are supported.");