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

text: Limit font name length to 64 characters in TextFormat #19263

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

kjarosh
Copy link
Member

@kjarosh kjarosh commented Jan 17, 2025

That's what Flash Player does ¯\_(ツ)_/¯

@kjarosh kjarosh added A-avm2 Area: AVM2 (ActionScript 3) T-fix Type: Bug fix (in something that's supposed to work already) labels Jan 17, 2025
@kjarosh kjarosh force-pushed the textformat-font-length branch from d36c2f7 to 405be28 Compare January 18, 2025 08:29
Copy link
Collaborator

@adrian17 adrian17 left a comment

Choose a reason for hiding this comment

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

Should every place where we use/construct text_format natively in (even font tags and avm1) have this logic?

@kjarosh kjarosh force-pushed the textformat-font-length branch from 405be28 to 0dbc263 Compare January 18, 2025 11:59
@kjarosh
Copy link
Member Author

kjarosh commented Jan 18, 2025

Should every place where we use/construct text_format natively in (even font tags and avm1) have this logic?

Did more tests and it seems that no, it's just the AVM1/AVM2 setters which clamp it to 64 (e.g. it's not the case in HTML).

The reason I implement this is CSS, where you can specify a list of fonts and the list can get quite large, but as AVM2 setters are used there, its length is clamped to 64.

Regarding SWF tags, we have a buggy logic there anyway, because Flash treats each font class as a reference to a SWF tag, and not a font family per se (which we treat it as).

I pushed fixes for AVM1 too (with a test).

@kjarosh kjarosh changed the title avm2: Limit font name length to 64 characters in TextFormat text: Limit font name length to 64 characters in TextFormat Jan 18, 2025
@kjarosh kjarosh added text Issues relating to text rendering/input A-core Area: Core player, where no other category fits waiting-on-review Waiting on review from a Ruffle team member and removed A-avm2 Area: AVM2 (ActionScript 3) labels Jan 18, 2025
@kjarosh kjarosh requested a review from adrian17 January 19, 2025 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-core Area: Core player, where no other category fits T-fix Type: Bug fix (in something that's supposed to work already) text Issues relating to text rendering/input waiting-on-review Waiting on review from a Ruffle team member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants