etiennepinchon/aframe-fonts

Special characters not working

Opened this issue · 7 comments

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

same here, french character will be appreciate 💃

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

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!

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

please include some "à á ã â -" 😛

@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

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.