-
-
Notifications
You must be signed in to change notification settings - Fork 696
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit adds many small improvements in the way fonts are managed. 1. Most of the font deduplication logic has been put in add_font(), instead of draw_first_line(). 2. Font objects now have only one (reproducible) hash, based on the font content and the face index. Before this commit, we had 3 (!) different hashes. Fixes #1553. 3. Font fields are calculated during initialization, to avoid useless parameters storage. 4. Harfbuzz face is not read twice from Pango font when a new Font is added. 5. Font face deduplication is now done using the Pango face pointer, instead of the Harfbuzz face hash extracted from the Pango font. This could save some time, especially for very long documents always using the same font face. 6. Font name displayed in PDF now includes weight and style.
- Loading branch information
Showing
3 changed files
with
52 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3b0ae92
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just FYI, it looks like there's a probably-measurable improvement from this change (possibly including 2c0bb3a / 2e701b1). In a separate test of the same document from #1587 with
master
(5ad3b1d), across 10 runs the render took an average of 66.225 s ± 0.839 s (compared to 67.992 ± 1.279 beforehand), which is fairly close but still more than a standard deviation better. Nice! Thanks for the optimization.