mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-04-05 20:55:01 +08:00
change point size calculation to use rotation #41
point size was previously only calculated based on the transformation matrix but now uses the transformation matrix, the rotation matrix and the font matrix values. the calculated value still seems unlikely to be correct so it is exposed using the page's experimental access for now, rather than as a public getter.
This commit is contained in:
parent
0dfe742770
commit
198cca1336
@ -154,6 +154,15 @@
|
||||
{
|
||||
return annotationProvider.GetAnnotations();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the calculated letter size in points.
|
||||
/// This is considered experimental because the calculated value is incorrect for some documents at present.
|
||||
/// </summary>
|
||||
public decimal GetPointSize(Letter letter)
|
||||
{
|
||||
return letter.PointSize;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -126,7 +126,7 @@
|
||||
|
||||
// TODO: this does not seem correct, produces the correct result for now but we need to revisit.
|
||||
// see: https://stackoverflow.com/questions/48010235/pdf-specification-get-font-size-in-points
|
||||
var pointSize = decimal.Round(fontSize * transformationMatrix.A, 2);
|
||||
var pointSize = decimal.Round(rotation.Rotate(transformationMatrix).Multiply(TextMatrices.TextMatrix).Multiply(fontSize).A, 2);
|
||||
|
||||
while (bytes.MoveNext())
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user