HaxeFlixel / HaxeFlixel/flixel
Different position and wrong height using FFF Tusj font
Nobody has claimed this yet.
- Dominant language
- Haxe
- Stars
- 2.2k
- Forks
- 522
- Avg merge
- 34m
- Merged PRs (30d)
- 1
Description
- Flixel version: dev (updated now)
- OpenFL version: 3.6.0
- Lime version: 2.9.0
- Affected targets: flash/debug, windows/debug
Code snippet reproducing the issue:
package;
import flixel.FlxState;
import flixel.text.FlxText;
class PlayState extends FlxState
{
override public function create():Void
{
var withDefaultFont:FlxText = cast add(new FlxText(0, 0, 0, "TEST", 300));
withDefaultFont.setGraphicSize(0, 50);
withDefaultFont.updateHitbox();
trace(withDefaultFont.frameHeight, withDefaultFont.height);
var withFFFTusj:FlxText = cast add(new FlxText(0, 0, 0, "TEST", 300));
withFFFTusj.font = "assets/fonts/FFF_Tusj.ttf";
withFFFTusj.setGraphicSize(0, 50);
withFFFTusj.updateHitbox();
trace(withFFFTusj.frameHeight, withFFFTusj.height);
}
}
The above code relies on this font unzipped and renamed with an underscore and put into the assets/fonts folder of the project, but the problem also occurs with the Georgia and Georgia Bold fonts included with Win7.
Observed behavior: The two FlxTexts are in very different locations, and the debug output of the second line is 344,344 (in contrast with the first line, which is 379,50.) Screenshot:

Expected behavior: They should be in the same location, and the debug output of the second line should be similar to the first line (at least, the second number should be roughly 50).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the provided PlayState reproduction using FlxText and compare the default font with FFF Tusj, Georgia, and Georgia Bold on the listed targets. Trace frameHeight and height while checking the differing positions; done means both fonts produce matching placement and a resized height close to 50.
Written by the indexing model from the issue text.
Assessment
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100