Skip to content

Width calculation adjusted for Type0 fonts#1441

Open
ConvoluteHumanBot wants to merge 1 commit intoLibrePDF:masterfrom
ConvoluteHumanBot:type0-font-fix
Open

Width calculation adjusted for Type0 fonts#1441
ConvoluteHumanBot wants to merge 1 commit intoLibrePDF:masterfrom
ConvoluteHumanBot:type0-font-fix

Conversation

@ConvoluteHumanBot
Copy link

Description of the new Feature/Bugfix

Unscaled width calculation of ParsedText moved before constructor to fix the decoding for Type0 fonts.
Previously the method getWidth in DocumentFont.java failed to match character in the metrics map (char was not properly decoded).

Changed method ParsedText.getUnscaledTextWidth to ParsedText.getWidth when adjusting the textMatrix in displayPdfString to avoid calculating the width a second time.

Compatibilities Issues

None

Your real name

Alessandro Ragusi

… for Type0 fonts, method `getWidth` in `DocumentFont.java` failed to match character in the `metrics` map (char was not properly decoded).

Using method `ParsedText.getWidth` instead of `ParsedText.getUnscaledTextWidth` when adjusting the `textMatrix` in `displayPdfString` to avoid unnecessary calculations.
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant