rsms / inter

The Inter font family
https://rsms.me/inter/
SIL Open Font License 1.1
17.72k stars 398 forks source link

Bold cuts don't work in MS Office on PC #352

Closed timwoolliscroft closed 3 years ago

timwoolliscroft commented 3 years ago

Describe the bug When using the typeface (either the OTF or the hinted TTF) in MS Word on a PC, when bolded, the typeface doesn't appear to be bold. However, when exported from Word to a PDF, the bold returns.

To Reproduce Steps to reproduce the behavior:

  1. Open MS Word on a PC
  2. Set some type in Inter bold
  3. Export it as a PDF

Expected behavior The bold cut should be displaying in Word

Environment Windows - I work on mac, and am reporting the issue for a colleague

arrowtype commented 3 years ago

This is probably a duplicate of https://github.com/rsms/inter/issues/313

timwoolliscroft commented 3 years ago

Hi,

Just been having a chat with you or someone else from @arrowtype

I found my way to this comment: https://github.com/arrowtype/recursive/issues/373#issuecomment-670071028

I'm afraid at this point, it's gone a bit over my head. It seems like its some back end metadata within the font needs to be changed so that it works correctly within MS Word.

Is this something that can be done @rsms ?

Cheers,

Tim

timwoolliscroft commented 3 years ago

@rsms

Me and a Colleague have done a bit more digging and have compared the metadata from the Google version of Inter with your version of Inter. The following comes from her, I think she might've cracked it.

This is the OS/2 information from the Inter-Bold.ttf from Google, which does appear as Bold in both Word and PDF for me. Note that the Weight Class is set to 700 Bold but the Weight under the OS/2 Panose table is set to Book in this version; normally Book is a regular weight font, but this version works in both Word and PDF:

Google Inter data 1 Google Inter data 2

When I view the OS/2 Panose table for the Inter-Bold.OTF font and the Hinted for Windows TTF as well, neither of which appears bold to me in Word, but does in PDF, the Weight Class is set to 700 Bold (good), but the Weight is also set to Bold (possibly bad - explanation below the screenshots). The Proportion in the OTF and Hinted TTF versions is also set to Modern where the Google TTF is set to Old Style and all of the other fonts in the OTF and Hinted TTF set are also set to Old Style (maybe incompatible with each other?), and the Serifs are also set differently (not sure if that affects anything as well):

Inter Foundry data 1 Inter Foundry data 2

I wonder if what is happening here is the Google TTF font that is set to Book and Old Style for both the Regular and Bold versions of the font is working, and the OTF and Hinted for Windows TTF versions are both set to Bold and Modern for their "Inter-Bold" styles but Book and Old Style for their "Inter-Regular" styles, maybe this is causing them to either be incompatible and not correctly apply the bold in Word, but the PDF conversion may be reading some different part of the font code and that is why it converts correctly.

Hope to hear your thoughts on this soon

arrowtype commented 3 years ago

Wait, sorry – did you change the Panose value and check whether it fixed the issue in Word?

heatherhjl commented 3 years ago

@arrowtype

Hi! I'm the one that compiled the previous message sent by @timwoolliscroft.

I didn't change any of the metadata in the fonts, these were just my observations when comparing those that worked in both Word and PDF for me (this was the Google version of the TTF) to those that did not (the OTF and Hinted for Windows versions of the font).

Everything else about the OTF version of the fonts appears to work well in both Word and PDF in a PC environment, and I prefer it since it actually displays the correct italics versions of the fonts rather than the huge skew that Word applies to the Google version, but like others have experienced, the bold does not appear bold in Word, but does in PDF.

The only font metadata I could see differences in between the Google TTF and OTF/Hinted for Windows TTF were in the Inter-Bold as described above.

I have no experience creating or editing fonts and don't know how to change the metadata and have it stick in order to test it in Word, but I did view the metadata in FontForge and that was how I was able to find these differences and wondered if they could be contributing to the issues we're experiencing.

If you need any more info, please let me know

Cheers!

arrowtype commented 3 years ago

Thanks, @heatherhjl!

So, just to make sure I have this straight:

Is that correct?

As for Italics, the reason these don't work from the Google Fonts download is that that download doesn't include Italics. So, Word is just artificially skewing the uprights, or making "faux italics."

heatherhjl commented 3 years ago

@arrowtype

I totally understand the italic issue and that's why we would prefer to use the OTF version as we are creating content for a very large number of people using multiple applications across multiple platforms and would very much like to use the same font set for all applications, and the only thing not working is this bold issue (the true italics also look much nicer than the faux italics).

Your understanding is correct:

With the OTF version, you can see the difference in the italics - it is obvious it is only a 9° angle as opposed to the 15° or so that Word applies to the font so that is how I could tell the italic font was actually being applied in this case while I was comparing them. I don't think I tested this in the Hinted version as we were more focused on the bold issue and would rather just use the direct release anyhow.

If you need me to do any further testing at my end, just let me know and I'm happy to help!

Edited to add:

I also don't know if this helps at all, but when I tried installing the 'Inter-VariableFont_slnt,wght.ttf' family and tested that I had the opposite issue - the Inter bold font showed up fine in Word, but when I exported to PDF it lost the bold. I have not researched this further, but another colleague confirmed the same behaviour with me on her computer, and I believe she has Word for Mac.

I should also note that I was careful to uninstall each font set before installing the next version during my testing so none of these issues should be related to that.

arrowtype commented 3 years ago

Okay, thanks for clarifying that. I think that makes sense, now.

Because you have versions that do work and versions that don't, you could use FontBakery & fdiff to figure out a few potential things that might be causing this problem. Then, you could either make a forked version and fix that issue with a FontTools script, or you could figure out how to solve that issue in the main repo, then make a pull request to this repo for feedback and a potential merge.

Or, you could potentially wait for @rsms to find time to fix this, though based on his social media, he is also working on a number of other things.

If you'd like someone to look at this sooner, you could hire a font developer to work on it. If Rasmus is available, you could probably sponsor him to do that work sooner rather than later. If he's not, you could get someone else, and it would ultimately be up to Rasmus if he wanted to incorporate that fix into his main repo. Either way, it seems like you could solve it for your needs.

heatherhjl commented 3 years ago

@arrowtype

Thanks for the quick replies. I don't think these decisions are going to be up to me at this point, but we appreciate the input and advice. Everything you said above is outside of my wheelhouse, but I appreciate you laying this out for us.

Thanks so much!

arrowtype commented 3 years ago

Happy to help!

Best of luck on the project 👍

heatherhjl commented 3 years ago

@arrowtype

Hi again!

I actually managed to fix the font - it was exactly as I suspected above and the differences in the OTF version of the Inter-Bold font were causing it not to read as bold in Word. I made the changes in FontForge to match the Inter-Bold.ttf font available on Google Fonts and generated a new Inter-Bold.otf file, reinstalled all of the fonts excluding the original bold and using the modified bold, and it works perfectly in Word, PDF, and InDesign now. I also made the same changes to the Hinted for Windows Inter-Bold.TTF font as it was having the same issue, and it is also now working correctly.

If I were to provide the fixed versions of the files, would it be possible to have them replaced on the foundry site so we can ensure that our users end up with the version that works in all of the required programs?

Thank you again!

arrowtype commented 3 years ago

Wow, nice work! So, it was just that the panose values had to change?

Yeah, if you get that into the sources or build and PR it, that would presumably get it onto the Inter website.

This isn't my repo, though. I'll let @rsms take it from here!

heatherhjl commented 3 years ago

@arrowtype

Thanks! Yes, that is correct, it was just those few settings in the Panose values that needed to change and it's working now.

I will wait to see how @rsms responds - it was only the one font that needed to be tweaked, the others were fine as is so it is just the Inter-Bold OTF file that was changed.

Thank you for all your help @arrowtype

arrowtype commented 3 years ago

Okay, I looked into this slightly further, and there is a FontBakery test to ensure that all fonts in a family include the same PANOSE proportion value. Things probably work as a family (e.g. connecting Bold to Regular) so long as the proportion is the same value. But, just in case, I think it is probably most accurate to call this Modern, rather than Old Style.

In the comment with screenshots above, @heatherhjl said:

The Proportion in the OTF and Hinted TTF versions is also set to Modern where the Google TTF is set to Old Style and all of the other fonts in the OTF and Hinted TTF set are also set to Old Style

My best guess is, the font labeled as Modern is probably correct, while the others are incorrect. But, this only really matters as a note for @rsms. The source should probably be set to make sure Proportion is Modern throughout all built fonts, even though setting Bold to Old Style works as a hotfix for the immediate need. The difference between these proportion terms may never matter, but it’s possible it could matter for future software (e.g. for a fallback/loading font).

heatherhjl commented 3 years ago

@arrowtype

Thank you for continuing to look at this - as it turns out, this change worked fine for me, but when I sent it to my colleague he said it didn't work for him. I'm not sure why as it seemed fine in Word, PDF, and InDesign at my end, but then I didn't do any actual editing in InDesign, I just checked it to make sure it appeared correct, so he may have run into other issues. Editing in Word and exporting to PDF worked fine.

It does sound as though you are correct in your logic above regarding everything needing to be the same proportion to work together as a family since that seemed to be what made it start working for me.

Thank you!

rsms commented 3 years ago

Hey everyone and thank you all for such an incredible effort to figure this out!

I'm struggling a little bit on my end as I can't get the same results. If I open the most recent release (3.15) in FontForge, the same program you're using to inspect the same(?) font files, the panose values appear "correct": Inter-bold.ttf (and .otf) have weight class "bold" and proportion "modern."

Is it possible you were looking at an older release of the font files?

Here are screenshots of what I see when inspecting the 3.15 OTF and TTF Inter-bold font files:

Screen Shot 2021-03-23 at 15 16 49 Screen Shot 2021-03-23 at 15 16 26

@heatherhjl If I were to provide the fixed versions of the files, would it be possible to have them replaced on the foundry site so we can ensure that our users end up with the version that works in all of the required programs? The font files published here and on the website for the font are generated from its source files, so I'd like to fix this in the source files (and toolchain, if needed.) It would be helpful if you could share a copy of the fixed font and the broken one where you saw the wrong panose values (I can inspect them further as something fishy is going on :–)

rsms commented 3 years ago

@arrowtype per your recommendation I ran fontbakery's os2_test and it passes cleanly on the 3.15 Inter-Bold OTF file:

$ fontbakery check-universal -c com.google.fonts/check/family/panose_proportion --no-colors --no-progress -j Inter-Bold.otf
Start ... running 1 individual check executions.
Total:
    ERROR: 0
    FAIL: 0
    WARN: 0
    INFO: 0
    SKIP: 0
    PASS: 1

DONE!

Edit: When I run it on all files, it does fail, but does not give me any information about what font files are incorrect (and I'd rather eat my own arm than manually check every font file with FontForge, ha ha.) I'll see if I can write a script to detect this!

rsms commented 3 years ago

This is wild (and I found the issue!)

So the UFO files generated by glyphsLib contains slightly different panose values than what are actually in the Glyphs file! Look at this, on the right shows the data that's in the glyphs file and on the left the UFO file generated by glyhpsLib from that very same glyphs file. Notice how some panose values are correct while others are seemingly random.

Screen Shot 2021-03-23 at 16 05 23

It turns out that Glyphs.app has two places where you can enter panose values for a master (and I had only entered the correct values in one of those places.) Details: I'd entered panose values for all named instances in the "Export" part of Glyphs. However I did not know that for masters, the "Exports" information is not an override; instead it appears as glyphsLib (which is what the build toolchain uses to build the glyphs file) does not apply metadata overrides to named instances which happens to align with masters. So for Thin, Regular and Black (and their italic counterparts) the panose metadata would be incorrect as it was sourced from the "masters" metadata rather than the "exports" metadata of Glyphs. If this is a bug or not is not clear to me, but it certainly took me quite some poking to figure this out.

I've manually copied all panose values from the exports section onto the masters section and am now building everything from scratch and running a script to diff panose across all build products. I'll add another comment here once I've confirmed it works.

heatherhjl commented 3 years ago

@rsms Hi Rasmus!

Your findings are what I found as well with the Inter-Bold.otf and Inter-Bold.ttf Hidden version, but when I checked the other fonts in the same folders most were set to be Old Style, and I also found that the version of the Inter-Bold.ttf that did work for me (the one from Google) had the OS/2 font weight set to Book rather than Bold (which is weird). When I changed these settings in both the Inter-Bold.otf and Hidden version of Inter-Bold.ttf, then it started working for me.

I don't know a lot about fonts, but because these changes made the files start working for me in both Word and when exporting to PDF I thought perhaps that was the issue. For example, below is the information for Inter-Regular.otf, and the information for Inter-Bold.otf unchanged from the original 3.15 version (this is the version we were using).

Inter-Bold.otf 3.15 information: image

Inter-Regular.otf 3.15 information: image

You can see above that the Inter-Bold is set to Bold and Modern and the Inter-Regular is set to Book and Old Style.

In the Inter-Bold.otf that I changed where it started working, I changed it to Book and Old Style and that did the trick:

Inter-Bold.otf 3.15 information after changes (works in Word and PDF): image

One thing about Word that differs from some other programs is that you don't always see a separate version of each font even if it is installed, for instance, I know there is an Inter-Regular and an Inter-Bold installed, but in Word I only see "Inter" and when I apply Bold formatting, it changes to what I assume is Inter-Bold. The same is true for italic fonts, you don't see the actual font name but when you apply italics the font changes to the italicized version. I know this is true for the italic fonts because I can see a difference between the true italics and the skew that Word will apply when there is no true italic font installed. Knowing that this is how Word behaves, that is what led me to believe that for some reason Word couldn't "recognize" the bold version of the font with the existing settings, but once I changed them so they were both set to Old Style, and for some reason also both set to Book weight that is when it started working correctly.

Here is how the font list appears in Word (note no plain "Bold" or any "Italic" styles): image

Even though I do have the entire family installed (this is from my Fonts folder in Windows): image

I'm attaching a couple of zip files - one has the original 3.15 fonts that we downloaded from the foundry that did not work, and the other is the version I changed that does work.

Sorry for the huge rambling message! I hope this can help you discover what might be the issue, and if you need any more help from me let me know. Inter Desktop Original (bold not working).zip Inter Desktop Fonts (bold working).zip

heatherhjl commented 3 years ago

@rsms I just saw your other message after I published my novel above :)

I'm glad that you were able to see what the issue is. I did notice that while most of the fonts were set to Old Style in the original version, some were set to Modern, but as I was only having an issue with applying bold to the regular font I didn't dive too far into the other fonts as they weren't in use in my files.

rsms commented 3 years ago

@heatherhjl :–)

Ah, yes the data duplication in the Glyphs files worked! The fontbakery test now passes:

$ fontbakery check-universal -c com.google.fonts/check/family/panose_proportion --no-colors --no-progress -j Inter-*.otf
Start ... running 1 individual check executions.
Total:
    ERROR: 0
    FAIL: 0
    WARN: 0
    INFO: 0
    SKIP: 0
    PASS: 1
DONE!

And inspecting panose with fontinfo also confirms the values are as expected:

$ ./misc/tools/fontinfo.py -pretty build/fonts/const/Inter-Bold.otf | jq '.[0]["os/2"].panose'
{
  "armStyle": 0,
  "contrast": 0,
  "familyType": 2,
  "letterForm": 2,
  "midline": 0,
  "proportion": 3,
  "proportionName": "Modern",
  "serifStyle": 0,
  "strokeVariation": 0,
  "weight": 8,
  "weightName": "Bold",
  "xHeight": 4
}

I'll make sure to apply the patch to the repo later tonight.

@heatherhjl In the meantime, could I ask you for a favor? Could you try these font files [attached below from the "fixed" build] and see if they fix your issue? Archive.zip

heatherhjl commented 3 years ago

@rsms Yes, you bet! I'll uninstall what I've got and try these out right now.

heatherhjl commented 3 years ago

@rsms I can confirm that the .otf files are working perfectly - nice job! I want to test the TTF fonts too, but oddly I can't locate the files in my fonts folder to uninstall the OTF before I install the TTF. Could they possibly have installed under another name than Inter? image

heatherhjl commented 3 years ago

@rsms I figured it out - for some reason the font wasn't appearing in my fonts folder but I was able to locate it through the Windows 10 font interface and was able to delete it from there. The TTF installed fine and shows in the fonts folder - I think this was a Windows glitch.

So both the OTF and TTF you just sent are working great at my end. I tried them in Word and then exported that to a PDF, and also checked an existing InDesign file I had with the Inter TTF fonts and it located them all successfully and the file looks correct. I also tried applying the italics to several of the font weights and they all look good and are clearly using the true italic and not the skew applied by Word.

Good job!

rsms commented 3 years ago

@heatherhjl Ah! Wonderful. Thank you so much for all your help making Inter better!