mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-10-14 19:05:01 +08:00
handle type 1 font with no descriptor information #132
though required by the spec an adobe type 1 font may be missing all width data. in this case we default to empty values and treat it like a normal adobe type 1 font.
This commit is contained in:
@@ -48,16 +48,30 @@
|
||||
|
||||
var metrics = Standard14.GetAdobeFontMetrics(standard14Name.Data);
|
||||
|
||||
if (metrics != null)
|
||||
{
|
||||
var overrideEncoding = encodingReader.Read(dictionary, isLenientParsing);
|
||||
|
||||
return new Type1Standard14Font(metrics, overrideEncoding);
|
||||
}
|
||||
}
|
||||
|
||||
var firstCharacter = FontDictionaryAccessHelper.GetFirstCharacter(dictionary);
|
||||
int firstCharacter, lastCharacter;
|
||||
double[] widths;
|
||||
if (!usingStandard14Only)
|
||||
{
|
||||
firstCharacter = FontDictionaryAccessHelper.GetFirstCharacter(dictionary);
|
||||
|
||||
var lastCharacter = FontDictionaryAccessHelper.GetLastCharacter(dictionary);
|
||||
lastCharacter = FontDictionaryAccessHelper.GetLastCharacter(dictionary);
|
||||
|
||||
var widths = FontDictionaryAccessHelper.GetWidths(pdfScanner, dictionary, isLenientParsing);
|
||||
widths = FontDictionaryAccessHelper.GetWidths(pdfScanner, dictionary, isLenientParsing);
|
||||
}
|
||||
else
|
||||
{
|
||||
firstCharacter = 0;
|
||||
lastCharacter = 0;
|
||||
widths = EmptyArray<double>.Instance;
|
||||
}
|
||||
|
||||
if (!dictionary.TryGet(NameToken.FontDescriptor, out var _))
|
||||
{
|
||||
|
Reference in New Issue
Block a user