Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support html5 embedded font input text via @font-face #85

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zjnue
Copy link
Contributor

@zjnue zjnue commented Nov 12, 2013

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...

@RealyUniqueName
Copy link
Owner

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 :)

@zjnue
Copy link
Contributor Author

zjnue commented Nov 13, 2013

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants