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

otf / ttf hinting inconsistencies question #62

Closed
Pomax opened this issue Mar 16, 2015 · 8 comments
Closed

otf / ttf hinting inconsistencies question #62

Pomax opened this issue Mar 16, 2015 · 8 comments

Comments

@Pomax
Copy link

Pomax commented Mar 16, 2015

Based on adobe/brackets#8985 (comment) it appears that the ttf and otf fonts have drastically different hinting going on, raising the question "which one looks as intended" for the purposes of using the fonts for stable UIs. Is the otf authoritative, and the ttf likely to see improvements/adjustments to its conversion as time goes on?

@pauldhunt
Copy link
Contributor

The issue here is that different environments use different font rasterizers. If your targeted environment has good support for PostScript type hinting, you will probably want to use the OTF fonts. If, on the other hand, your targeted environment does not have good support for PS type hinting, you may prefer the TTF font versions and this is the reason for their existence. If you do not know what hinting your targeted environment rasterizer supports, you will want to test for yourself and make a judgement on the suitability of each format.

@peterflynn
Copy link

@pauldhunt To clarify, we're actually talking about the WOFF versions of the font -- differences between the .ttf.woff and .otf.woff copies. But I guess the WOFF files are just thin wrappers around the TTF and OTF originals?

.ttf.woff:
ttf woff

.otf.woff:
otf woff

In the second image, the characters look vertically stretched ~1px (e.g. look at "o" or "m"/"n"), and the weight is heavier.

In this case the environment in question is basically Chrome 39, which uses DirectWrite on Windows. But I couldn't find good info online about how well DirectWrite supports PotScript hinting...

@miguelsousa
Copy link
Member

To add to Paul's comment, when we hint the fonts we make no effort to match the rasterization of both formats pixel-by-pixel, because that would be close to impossible anyway.

The glyph outlines are the exact same size on both formats; any differences you see in terms of size and proportions at small rendered sizes are in big part the result of different rasterization algorithms, which the font is not in control of.

@miguelsousa
Copy link
Member

But I guess the WOFF copies are just thin wrappers around the TTF and OTF originals?

Correct.

In this case the environment in question is basically Chrome 39, which uses DirectWrite on Windows. But I couldn't find good info online about how well DirectWrite supports PotScript hinting...

DirectWrite has very good support for PostScript hinting; it's lightyears better than GDI.

If one of Brackets' goals is to be cross-platform pixel-by-pixel, your best bet is to standardize on the OTF fonts. This is because DirectWrite uses Adobe's CFF rasterizer, which now happens to be open source. The Mac platform uses its own rasterization technology, but I expect that the OTFs will render more similarly between Mac & Windows than the TTFs ever will.

@Pomax
Copy link
Author

Pomax commented Mar 17, 2015

I did not know the rasterizer was now open source - that's amazing news!

@miguelsousa
Copy link
Member

@Pomax We announced it in May 2013. I'm surprised it's the first time you hear about it.

@twardoch
Copy link

I'll just add for clarification: it's part of FreeType.

@Pomax
Copy link
Author

Pomax commented Mar 17, 2015

That's... very odd, I'm pretty sure I was on the opentype list well before then. Oh well, still great news, I'm just late to the party =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants