Simplify PdfFont.ParseSizes.

This commit is contained in:
2017-06-26 22:17:46 +02:00
parent 36fb20eb2e
commit b11a2ac393

View File

@@ -87,22 +87,8 @@ namespace VAR.PdfTools
char actualChar = firstChar; char actualChar = firstChar;
foreach (IPdfElement elem in widths.Values) foreach (IPdfElement elem in widths.Values)
{ {
var widthReal = elem as PdfReal; _widths.Add(actualChar, PdfElementUtils.GetReal(elem, 500) / glyphSpaceToTextSpace);
if (widthReal != null) actualChar++;
{
double charWidth = widthReal.Value / glyphSpaceToTextSpace;
_widths.Add(actualChar, charWidth);
actualChar++;
continue;
}
var widthInt = elem as PdfInteger;
if (widthInt != null)
{
double charWidth = widthInt.Value / glyphSpaceToTextSpace;
_widths.Add(actualChar, charWidth);
actualChar++;
continue;
}
} }
// FIMXE: Calculate real height // FIMXE: Calculate real height
} }