Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send disableFontFace and fontExtraProperties as part of the exported font-data #19548

Conversation

Snuffleupagus
Copy link
Collaborator

  • Send disableFontFace and fontExtraProperties as part of the exported font-data

    These options are needed in the FontFaceObject class, and indirectly in FontLoader as well, which means that we currently need to pass them around manually in the API.
    Given that the options are (obviously) available on the worker-thread, it's very easy to just provide them when creating Font-instances and then send them as part of the exported font-data. This way we're able to simplify the code (primarily on the main-thread), and note that Font-instances even had a disableFontFace-field already (but it wasn't properly initialized).

  • Improve the "FontFallback" handling on the worker-thread

    Remove the Catalog.prototype.fontFallback method, and move its code into PDFDocument.prototype.fontFallback instead, to reduce the indirection a little bit.
    Pass the evaluatorOptions directly to the TranslatedFont.prototype.fallback method, since nothing else in the TranslatedFont-class needs it now.

…ted font-data

These options are needed in the `FontFaceObject` class, and indirectly in `FontLoader` as well, which means that we currently need to pass them around manually in the API.
Given that the options are (obviously) available on the worker-thread, it's very easy to just provide them when creating `Font`-instances and then send them as part of the exported font-data. This way we're able to simplify the code (primarily on the main-thread), and note that `Font`-instances even had a `disableFontFace`-field already (but it wasn't properly initialized).
Remove the `Catalog.prototype.fontFallback` method, and move its code into `PDFDocument.prototype.fontFallback` instead, to reduce the indirection a little bit.
Pass the `evaluatorOptions` directly to the `TranslatedFont.prototype.fallback` method, since nothing else in the `TranslatedFont`-class needs it now.
@Snuffleupagus
Copy link
Collaborator Author

/botio unittest

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_unittest from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.241.84.105:8877/97a89a63a0eb1b3/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_unittest from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.193.163.58:8877/371c0a0cb6695b8/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/97a89a63a0eb1b3/output.txt

Total script time: 2.37 mins

  • Unit Tests: FAILED

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Success

Full output at http://54.193.163.58:8877/371c0a0cb6695b8/output.txt

Total script time: 7.67 mins

  • Unit Tests: Passed

@Snuffleupagus Snuffleupagus changed the title Font export data disable font face font extra properties Send disableFontFace and fontExtraProperties as part of the exported font-data Feb 24, 2025
@Snuffleupagus
Copy link
Collaborator Author

/botio browsertest

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_browsertest from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.241.84.105:8877/c5ea81135909ee9/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_browsertest from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.193.163.58:8877/4724952bac16014/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/c5ea81135909ee9/output.txt

Total script time: 16.89 mins

  • Regression tests: Passed

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Success

Full output at http://54.193.163.58:8877/4724952bac16014/output.txt

Total script time: 30.55 mins

  • Regression tests: Passed

@Snuffleupagus Snuffleupagus added the release-blocker Blocker for the upcoming release label Feb 25, 2025
Copy link
Contributor

@calixteman calixteman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you.

@Snuffleupagus Snuffleupagus merged commit da17c7b into mozilla:master Feb 26, 2025
9 checks passed
@Snuffleupagus Snuffleupagus deleted the Font-exportData-disableFontFace-fontExtraProperties branch February 26, 2025 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core font-conversion release-blocker Blocker for the upcoming release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants