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

Added Font Support For Type1 fonts and a tool for the same #6918

Closed
wants to merge 2 commits into from

Conversation

AkshayMathur92
Copy link

I was working with fonts and paths when i recognized a necessary addition in THREE.JS.
According to the specifications Truetype and Type1 fonts differ in 'direction of paths'.
So using the current FontUtils can create problems with Type1 fonts where holes will be replaced by mesh and vice versa.
Also using the tool provided any font can be used for creating Text Mesh, provided TTF/OTF files for the same,
currently
after changes

According to font specifications, both Type1 and TrueType require that
the outer boundary of a glyph be drawn in a certain direction (they
happen to be opposite from each other).  The TrueType font file
specification tells us that contours that need to be filled black must
have a clockwise direction. If we want to make a white area inside an
existing contour we must make the direction of the new contour counter
clockwise, while it is opposite case in Type1.

Added a check and flag (isCCw) for the same. while creating shapes.
…ic font text geometries in THREE.TextGeometry

Tools accept OTF/TTF files and creates a typeface js file which can be
included and used to create text mesh with different fonts via new
THREE.TextGeometry.
@gero3
Copy link
Contributor

gero3 commented Jul 28, 2015

Truetype isn't always clockwise. -> https://groups.google.com/forum/#!topic/comp.fonts/jysddVs06XM
It would be better to find a way to detect which is which.

That is why facetype.js makes it possible to switch between direction. I also think that limiting the charcodes to only ASCII values isn't correct.

@AkshayMathur92
Copy link
Author

Solves - Text rendering issues #5943

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