Closed jgranick closed 10 years ago
Comment by jgranick:
"openfl-html5-dom" composes fonts into Flash drawing commands, then manually redraws each letter.
"openfl-html5" currently uses canvas.fillText, which relies upon having embedded webfonts. Unfortunately, we cannot generate these offline right now... I'd love to hear your input, which you think works better. If webfonts is the way to go, then we may be able to do additional work to try and create EOT/SVG/TTF/WOFF dynamically. At the moment, you'll have to override your index.html, and embed web fonts (that you generate with, say, FontSquirrel) then use the CSS name of the webfont as the font name in your TextField.
Thanks for your feedback :)
Comment by Meychi:
Ah.. so the "Roboto" font name works as i have Roboto installed on my system. Is any of this documented some where? The actual code might be a good place, devs with proper IDE's could see the notes direcly in the IDE while typing :)
I do like the hassle free use of fonts in the dom version like i would use them with flash. I think it also makes more sense with the openfl/flash way of doing things. Would it be possible to support both approaches without too much work?
Generally font rendering has been pretty weak on on Chrome on Windows and i would actually prefer some sort of dynamic bitmap font approach. Browsers should be able handle bitmap scaling pretty well performance wise.
I need to test and study these a bit more.
6 Issue by Meychi,
Using:
var font:Font = Assets.getFont("assets/fonts/Roboto.ttf"); var tf:TextFormat = new TextFormat(font.fontName, TEXT, 0x000000);
font.fontName is null and the default font is used. It works if i use "Roboto" but if i use "assets/fonts/Roboto" the font is rendered at minimal size.