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

Missing kerning pairs #1

Closed
oomek opened this issue Feb 18, 2020 · 7 comments
Closed

Missing kerning pairs #1

oomek opened this issue Feb 18, 2020 · 7 comments

Comments

@oomek
Copy link

oomek commented Feb 18, 2020

Some kerning pairs are not present in font.js file. For example Va Ve Wa We AV etc.
Additionally some fonts are not producing any output like BarlowCondensed-SemiBold.ttf
Update: Barlow condensed 1.408 didn't work, but a newer 1.422 downloaded from github worked, odd.

@oomek
Copy link
Author

oomek commented Feb 18, 2020

It seems like the modern kerning tables are unrecognised. I can only generete (still incomplete) kerning tables when I export the font in FontLab with legacy kerning tables ticked in the ttf profile.

@oomek
Copy link
Author

oomek commented Feb 19, 2020

Is this repo still maintained? I would really like to implement your method as it gives amazing results, but those missing kern pairs are a deal breaker. It seems like the atlas generator is not processing kerning classes.

@astiopin
Copy link
Owner

Font managing is pretty basic at the moment. Hinting on modern fonts with 2d glyph placement is not supported. You can use a full featured font library like freetype (freetype) for font loading.

@oomek
Copy link
Author

oomek commented Feb 24, 2020

I actually want to get rid of freetype so I can scale text smoothly. I was experimenting with harfbuzz recently and It nicely returns proper kerning for ttf and otf for each glyph pairs, but it's a pain in the back to do it in js. I need to rewrite the displaying function in c++ to see how it looks.

@astiopin
Copy link
Owner

You can write TTF reading routine yourself. It's complicated but not THAT hard. I've used apple and microsoft spec pages for writing my TTF parsing library. Look for the 'kerx' table. Modern fonts store kerning there.

@oomek
Copy link
Author

oomek commented Feb 24, 2020

Actually most of the fonts I use store kerning in gpos table, hence the need for harfbuzz. I think that there is no need to reinvent the wheel in this particular situation. Maybe harfbuzz could also be used to extract the glyph data.

@astiopin
Copy link
Owner

Yes, using harfbuzz would probably be the best way.

@oomek oomek closed this as completed Feb 24, 2020
DanielHerchenbach referenced this issue in DanielHerchenbach/sdf_atlas Feb 4, 2021
…iopin/sdf_atlas/issues:

- #1/astiopin#4: Bugfix, data from "kern"  table was not read correctly.
- astiopin#5: Bugfix, out of bound exception when reading glyohs from ttf file.
- astiopin#6: Simplified scaling of the font metrics.
- astiopin#7: Solved linker errors.
- astiopin#8: Performance improvements (on javascript side) and a (hopefully) more straightforward/easy json export.
Glyphs are now exported with bounding boxes tight not only in horizontal, but also vertical direction.
If no unicode ranges are provided, all glyphs from the font file are exported.
I have changed the default glyph and sdf border size so that each of the Croscore fonts (e.g. Arimo-BoldItalic.ttf) fits into a 2048px x 2048px texture atlas.
Added Visual Studio project files and binaries (debug executable compiled under Win 10 64 bit).
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

2 participants