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

Special characters not working #1

Open
tomsride opened this issue Nov 12, 2017 · 7 comments
Open

Special characters not working #1

tomsride opened this issue Nov 12, 2017 · 7 comments

Comments

@tomsride
Copy link

tomsride commented Nov 12, 2017

Hey there! Great job - thanks for your effort. Just one small point: Some languages other than English use a few special characters, which do not seem to be implemented in your library. In German these are specifically "ö", "ä", "ü", "Ö", "Ä", or "Ü". Would it be possible to add them from your side? Or any hints how I can get a specific google font converted for my case?
Thank you - Tom

@stephanedemotte
Copy link

same here, french character will be appreciate 💃

@etiennepinchon
Copy link
Owner

etiennepinchon commented Nov 28, 2017

Hey guys! The font generator is included in the repo, I used msdf-bmfont to generate the fonts.
If you wish to use different/special characters, you could include your charset in the options of the generator script.

In generate.js line 14:

const options = {
  charset: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefhijklmnopqrstuvwxyz0123456789éàè',
};
generateBMFont(path.join(pathToFont, `${name}.ttf`), options, (err, textures, font) => {

then:

node generate [PATH TO FONT] [FONT NAME]

Let me know if that helps. :)

@tomsride
Copy link
Author

tomsride commented Dec 9, 2017

Hey Etienne
Thanks for the inputs. I have installed node, brew as well as msdf-bmfont (according the mentioned link in your reply). To be honest, I am not yet familiar running node on my local machine. Therefore I can not sort out the following problem when running your generate script:

Error: Cannot find module 'msdf-bmfont'
at Function.Module._resolveFilename (module.js:542:15)
at Function.Module._load (module.js:472:25)
at Module.require (module.js:585:17)
at require (internal/module.js:11:18)
at Object. (/Users/xyz/Downloads/aframe-fonts-master/generate.js:1:87)
at Module._compile (module.js:641:30)
at Object.Module._extensions..js (module.js:652:10)
at Module.load (module.js:560:32)
at tryModuleLoad (module.js:503:12)
at Function.Module._load (module.js:495:3)
$

Any ideas what I could be missing?
Node is running and i can run your sample page locally in my browser through the port 3000.
fyi: I have adapted the needed chars in my fork of generate.js. [https://github.com/tomsride/aframe-fonts/blob/master/generate.js]

Thank you for your support - and - great stuff you are doing!

@mattrei
Copy link

mattrei commented Dec 18, 2017

Hi,
when I am generating the png atlas out of the Roboto-Regular ttf I get a different output:
roboto-regular

Compared to yours:
roboto-thin

Of course this is a problem, because the font is not displayed correctly (the outline and inline of the font are inverted). However the problem must be within msdfgen somehow.

May you provide als the TTF files, or from where did you download them? Maybe by providing a script?

best

@joeloliveira7
Copy link

please include some "à á ã â -" 😛

@donmccurdy
Copy link
Contributor

@mattrei you're using a more recent version of msdfgen, three-bmfont-text is based on an older one. Proposed a fix here: Experience-Monks/three-bmfont-text#24

@donmccurdy
Copy link
Contributor

I've put together a little web tool for generating these MSDF fonts. It will support special characters correctly, and you can provide your own fonts if you wish.

http://msdf-bmfont.donmccurdy.com/

^note, this requires the negate: false setting on A-Frame's text component, which is only available on the master branch and will be released with 0.8.0.

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

No branches or pull requests

6 participants