mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-10-15 19:54:52 +08:00
prevent negative point size for fonts
This commit is contained in:
@@ -161,6 +161,11 @@
|
|||||||
// see: https://stackoverflow.com/questions/48010235/pdf-specification-get-font-size-in-points
|
// see: https://stackoverflow.com/questions/48010235/pdf-specification-get-font-size-in-points
|
||||||
var pointSize = Math.Round(rotation.Rotate(transformationMatrix).Multiply(TextMatrices.TextMatrix).Multiply(fontSize).A, 2);
|
var pointSize = Math.Round(rotation.Rotate(transformationMatrix).Multiply(TextMatrices.TextMatrix).Multiply(fontSize).A, 2);
|
||||||
|
|
||||||
|
if (pointSize < 0)
|
||||||
|
{
|
||||||
|
pointSize *= -1;
|
||||||
|
}
|
||||||
|
|
||||||
while (bytes.MoveNext())
|
while (bytes.MoveNext())
|
||||||
{
|
{
|
||||||
var code = font.ReadCharacterCode(bytes, out int codeLength);
|
var code = font.ReadCharacterCode(bytes, out int codeLength);
|
||||||
|
Reference in New Issue
Block a user