Skip to content

Commit

Permalink
avm2: Add ElementFormat.getFontMetrics stub
Browse files Browse the repository at this point in the history
  • Loading branch information
kjarosh committed Jan 19, 2025
1 parent 82fd27d commit 92d90a9
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions core/src/avm2/globals/flash/text/engine/ElementFormat.as
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
package flash.text.engine {
import __ruffle__.stub_method;

import flash.geom.Rectangle;

[API("662")]
public final class ElementFormat {
private var _alignmentBaseline:String;
Expand Down Expand Up @@ -200,5 +204,13 @@ package flash.text.engine {
public function set typographicCase(value:String):void {
this._typographicCase = value;
}

public function getFontMetrics():FontMetrics {
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
);
}
}
}

0 comments on commit 92d90a9

Please sign in to comment.