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

Text rendering issues #5943

Closed
pressuredesigns opened this issue Jan 20, 2015 · 6 comments
Closed

Text rendering issues #5943

pressuredesigns opened this issue Jan 20, 2015 · 6 comments

Comments

@pressuredesigns
Copy link

I am currently working on a three.js project and we are running into issues loading fonts onto our text.

We are using TextGeometry object to render our fonts and the typeface js converter to add in our fonts.

Some fonts work great but others do not perform as expected with some letters not rendering correctly such as d's and o's.

This can be seen in the fiddle below, the font is loading the interior of some letters not the exterior.

http://jsfiddle.net/264jawhe/2/

Can anyone identify why this is happening and if there is a better method to display text possibly loading an html element?

Thanks in advance!

@mrdoob
Copy link
Owner

mrdoob commented Jan 20, 2015

Can you try with the code in this example?
http://threejs.org/examples/webgl_geometry_text2.html

@mikaelgramont
Copy link
Contributor

Hi,

I just ran into the same issue with a font I generated through https://github.com/gero3/facetype.js
The second example, which uses pnltri.js, works much better. Not perfectly, I'm still getting an issue with the glyph for 8:

screen shot 2015-05-09 at 20 24 34
screen shot 2015-05-09 at 20 24 28

Mika

@mikaelgramont
Copy link
Contributor

Side note: the version embedded in the examples is 2.0.0. I tried with both that and 2.1.1 and I'm getting the same results.

@gero3
Copy link
Contributor

gero3 commented May 10, 2015

If you see that, reverse the font direction. I still haven't figured out how to automatically detect if I need to reverse the direction of the font. So this is still a process that needs to be manually checked.
test

ps: if you have other issues or suggestion for facetype.js, please use https://github.com/gero3/facetype.js/issues.

@mikaelgramont
Copy link
Contributor

Ah, wonderful, that worked, thanks for mentioning that. It'd be good to mention that on the page itself, I assumed those two things were unrelated. I'm happy to send you a pull request but I'm not sure what to say, does this solve other problems or is that the only one?

@gero3
Copy link
Contributor

gero3 commented May 10, 2015

It only solves that one. It has to do with the fact that fonts are written as paths and these paths are written in clockwise direction or counterclockwise direction. And three.js expects them to be clockwise for the shapes and counterclockwise for the holes.

If you could send a PR, that would be great.

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

4 participants