StablexUI icon indicating copy to clipboard operation
StablexUI copied to clipboard

support html5 embedded font input text via @font-face

Open zjnue opened this issue 11 years ago • 2 comments

basic implementation based on suggestions by glantucan. for it to work, the font (ttf) files need to be copied into the build folder (with something like <assets path="assets/font" rename="font" />). then one needs to comment out lines 138 and 143 of src/platforms/HTML5Platform.hx in hxtools (1.1.6), which is part of openfl. removing the comments from lines 20 and 24 in helpers/HTML5Helpers.hx also helps...

zjnue avatar Nov 12 '13 20:11 zjnue

Great! But i'm not sure if it's the right way for a lib to force users make manual changes in another libs :) I'll think how to deal with this. Thanks for your pull request :)

RealyUniqueName avatar Nov 13 '13 15:11 RealyUniqueName

Agreed, a solution probably belongs upstream; just a mini hack-as-an-idea really :) The @font-face fonts also don't render the same as the canvas ones - not ideal. Perhaps one could use a div to capture user interaction but actually pump the text through to a TextField masquerading as input text. Will let you know if ever a solution presents itself at this end. Cheers!

zjnue avatar Nov 13 '13 16:11 zjnue