PdfFont: Convert "Zero" widths to default 0.5

This commit is contained in:
2017-06-26 01:46:05 +02:00
parent d4c4615684
commit 52841de51b

View File

@@ -201,15 +201,23 @@ namespace VAR.PdfTools
public double GetCharWidth(char character)
{
double charWidth = 0;
if (_widths == null)
{
return 0;
return charWidth;
}
if (_widths.ContainsKey(character))
{
return _widths[character];
charWidth = _widths[character];
}
return 0;
// NOTE: Convert "Zero" to default width of 0.5
if (charWidth <= 0.0001)
{
charWidth = 0.5;
}
return charWidth;
}
#endregion