googlefonts / roboto-2

The Roboto family of fonts
Apache License 2.0
3.85k stars 309 forks source link

Cannot use OTF as webfont #283

Closed MatTheCat closed 4 years ago

MatTheCat commented 6 years ago

Following instructions on the README I generated font files I later tried to subset using pyftsubset, which led me to https://github.com/fonttools/fonttools/issues/1134

When I try to load Roboto-Regular.otf or any subset Chrome tells me he failed to decode the font. However ots-sanitize tells me all is fine.

What's going on?

RoelN commented 6 years ago

The generated webfont is indeed rejected by Chrome with a Failed to decode downloaded font: ... message in the console.

It seems that removing the empty keys FamilyBlues and FamilyOtherBlues from CFF > CFFFont > Private results in a working OTF font after rebuilding it:

<FamilyBlues value=""/>
<FamilyOtherBlues value=""/> 
anthrotype commented 6 years ago

Oh, that issue was fixed in ufo2ft last year, the patch is in since version 0.4.0 https://github.com/googlei18n/ufo2ft/pull/115

Recompiling the fonts with updated ufo2ft should fix the problem.

The latest OTS no longer complains about these empty blues operators: https://github.com/khaledhosny/ots/commit/8f90e634696b6364a942cbf101ef6674df4b4455

Should go away once Chrome/Firefox update their embedded OTS copy

anthrotype commented 6 years ago

the solution suggested by @RoelN is quicker than recompiling the fonts from source. Just dump with ttx, strip those two empty values, and recompile with ttx.

MatTheCat commented 6 years ago

If I understand there are in fact two issues at the same time:

Is that right?

anthrotype commented 6 years ago

correct

MatTheCat commented 6 years ago

Should I open a PR to update requirements then?

anthrotype commented 6 years ago

Should I open a PR to update requirements then?

it might not be so straightforward as other things may break, but you can try.

cc @m4rc1e

MatTheCat commented 6 years ago

Indeed just requiring ufo2ft==0.4.0 breaks things.

ImportError: No module named makeotfParts
anthrotype commented 6 years ago

related issue https://github.com/google/roboto/issues/239

MatTheCat commented 6 years ago

Ouch guess I'll have to be patient.

m4rc1e commented 6 years ago

Apologies for the delay.

I remember ufo2ft would set incorrect advance widths for glyphs made from components. We had to release and update the solve this. https://github.com/google/roboto/commit/e2c5a2f14fcdf5f9464ee59d0dddad683ea057a1

I think this has been fixed in ufo2ft. In the next release, I'll update the ufo2ft dependency.

MatTheCat commented 6 years ago

Nice! Do you have any idea when this could be released?

MatTheCat commented 6 years ago

@m4rc1e seems there is no more activity on this repository, has Roboto been moved somewhere else?

m4rc1e commented 6 years ago

@MatTheCat We're actively working on it. Unfortunately these things take time.

MatTheCat commented 6 years ago

No problem I understand; just wanted to make sure thanks.

MatTheCat commented 4 years ago

I guess https://github.com/typenetwork/roboto is to be used instead.