Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion glyphme/TrueTypeFont.hx
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,20 @@ class TrueTypeFont extends h2d.Font {

super(null, sizeInPixels, h2d.Font.FontType.SignedDistanceField(Red, alphaCutOff, smoothing));

super.lineHeight = ascent - lineGap;
super.lineHeight = sizeInPixels;
super.baseLine = ascent;
super.tile = @:privateAccess new Tile(null, 0, 0, 0, 0); // to avoid null access
}

private var __forceHasChar:Bool = false;

override function hasChar(code:Int):Bool {
if(code == Key.BACKSPACE) return false;
if(Key.isDown(Key.CTRL)) return false;
if (__forceHasChar)
return true;
return super.hasChar(code);
}

/** Fallbacks are used to look up glyphs from multiple fonts. When a glyph is not found
* we try the next font. If you have multiple fallbacks with slightly overlapping glyph support
Expand Down