handle case where font metrics do not declare width or height #35

This commit is contained in:
Eliot Jones
2019-06-19 18:47:50 +01:00
parent caf1a0c233
commit 35b6c4f0eb

View File

@@ -64,7 +64,17 @@
{
return new PdfRectangle(0, 0, 250, 0);
}
if (metrics.WidthX == 0 && metrics.BoundingBox.Width > 0)
{
metrics.WidthX = metrics.BoundingBox.Width;
}
if (metrics.WidthY == 0 && metrics.BoundingBox.Height > 0)
{
metrics.WidthY = metrics.BoundingBox.Height;
}
return new PdfRectangle(0, 0, metrics.WidthX, metrics.WidthY);
}