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

avm2: Stub more methods from FTE #19277

Merged
merged 2 commits into from
Jan 19, 2025
Merged

avm2: Stub more methods from FTE #19277

merged 2 commits into from
Jan 19, 2025

Conversation

kjarosh
Copy link
Member

@kjarosh kjarosh commented Jan 19, 2025

Stubbed methods:

  • ElementFormat.getFontMetrics
  • TextLine.getAtomBidiLevel
  • TextLine.getAtomCenter
  • TextLine.getAtomGraphic
  • TextLine.getAtomTextBlockBeginIndex
  • TextLine.getAtomTextBlockEndIndex
  • TextLine.getAtomTextRotation
  • TextLine.getAtomWordBoundaryOnLeft

@kjarosh kjarosh added A-avm2 Area: AVM2 (ActionScript 3) tlf Issues relating to TLF text rendering or the TLF APIs in AVM2 T-compat Type: Compatibility with Flash Player labels Jan 19, 2025
stub_method("flash.text.engine.ElementFormat", "getFontMetrics");
var emBox:Rectangle = new Rectangle(0, _fontSize * -0.8, _fontSize, _fontSize);
return new FontMetrics(
emBox, -5, 1.2, 1.8, 1.2, 0.075, 0.6, -0.35, 0.6, 0.0
Copy link
Collaborator

Choose a reason for hiding this comment

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

are these completely random numbers, or taken from some existing font? :D

Copy link
Member Author

@kjarosh kjarosh Jan 19, 2025

Choose a reason for hiding this comment

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

Those are numbers taken from an existing font (roughly). I don't think their exact values matter, but their signs and orders of magnitude might.

@kjarosh kjarosh enabled auto-merge (rebase) January 19, 2025 12:36
@kjarosh kjarosh merged commit 5532c15 into ruffle-rs:master Jan 19, 2025
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-avm2 Area: AVM2 (ActionScript 3) T-compat Type: Compatibility with Flash Player tlf Issues relating to TLF text rendering or the TLF APIs in AVM2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants