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

Open Sans, Roboto and Roboto Slab NAME table issues in WinWord #1618

Open
davelab6 opened this issue Jul 16, 2018 · 27 comments
Open

Open Sans, Roboto and Roboto Slab NAME table issues in WinWord #1618

davelab6 opened this issue Jul 16, 2018 · 27 comments
Assignees
Labels
-- Needs Upstream Resolution Upstream fix required before moving forward I Font Bug

Comments

@davelab6
Copy link
Member

A user wrote to me privately that Open Sans, Roboto and Roboto Slab all have NAME table issues in Windows Word.

Open Sans when installed looks like this to Word:

unnamed-1

So far so good.

However, the SemiBold Italic style does not render, instead the SemiBold is auto-slanted (eg the 'a' is not single story)

image007

Similarly, Roboto Slab has 4 styles (Regular + Bold, then Thin and then Light) but only two appear in the Word picker list:

unnamed

So when a document is made with them in Google Docs and exported as docx, it appears to fall back to Roboto:

image005

I am very keen to see that Font Bakery is checking this stuff and telling people exactly what to do to fix it, and then we ensure everything in the API is fixed. :)

@felipesanches
Copy link
Collaborator

OK. I'll investigate this.

@laerm0
Copy link
Contributor

laerm0 commented Jul 17, 2018

Hi –

I can't reproduce this with Open Sans (using the files currently in the repo, not my new files) or Roboto but I can with Roboto Slab.

I'll fix Roboto Slab. I'm surprised nobody has ever noticed this before!

screen shot 2018-07-17 at 10 56 19
screen shot 2018-07-17 at 10 48 51

@laerm0
Copy link
Contributor

laerm0 commented Jul 17, 2018

It looks like @mjlagattuta has just spiffed up Roboto Slab's masters for VF lifestyle so it looks like getting the slab live on site will fix this (and improve other stuff).

@felipesanches
Copy link
Collaborator

@laerm0 sent me two sets of good and bad fonts. Here's a visual reference of how the name table entries went bad on Roboto:

Roboto Thin (good) versus Roboto Thin (bad)
screenshot at 2018-07-17 14 25 12

Roboto Light (good) versus Roboto Light (bad)
screenshot at 2018-07-17 14 25 58

Roboto Regular (good) versus Roboto Regular (bad)
screenshot at 2018-07-17 14 22 53

Roboto Bold (good) versus Roboto Bold (bad)
screenshot at 2018-07-17 14 23 41

@davelab6
Copy link
Member Author

davelab6 commented Jul 17, 2018

@laerm0

I can't reproduce this with Open Sans (using the files currently in the repo, not my new files)

Did you mean, "using the files currently in the repo, OR my new files"

Also, what versions of win & word did you test? :)

@laerm0
Copy link
Contributor

laerm0 commented Jul 17, 2018

Sorry, using the files currently in the repo.

I used Win 10 Pro with Office 365.

@davelab6
Copy link
Member Author

davelab6 commented Jul 17, 2018 via email

@laerm0
Copy link
Contributor

laerm0 commented Jul 18, 2018

The files currently in the repo were what I tested, but I just downloaded what's being served again and it's the same as what I saw before: Open Sans and Roboto fine, Roboto Slab not.

@mjlagattuta
Copy link
Contributor

mjlagattuta commented Jul 23, 2018

In the Roboto Slab VF (which is still in beta) I resolved this via manual edits to the STAT table, which Windows Word seems to rely on. I believe these values need to correspond to the final scale of an axis whether scaling from source file stem weights to CSS weight values and/or mapping via an avar table. The only style not present is "Roboto Slab Beta Bold" which can be accessed via turning on the bold option on the regular style.

screen shot 2018-07-23 at 4 29 14 pm

@felipesanches
Copy link
Collaborator

Do we have a succinct description of the rules for good and bad name table entries relevant to the issues discussed here?

@felipesanches
Copy link
Collaborator

felipesanches commented Jul 30, 2018

This is currently blocking a Font Bakery release due to fonttools/fontbakery#1974 which should address these problems, but it is not clear to me right now how to deal with it.

@felipesanches
Copy link
Collaborator

I'd appreciate some more feedback in here, as mentioned at #1618 (comment) above.

@felipesanches
Copy link
Collaborator

I need someone to take a look at this issue and provide some further feedback, please.

@davelab6
Copy link
Member Author

Do we have a succinct description of the rules for good and bad name table entries relevant to the issues discussed here?

No. Someone must investigate systematically and write those rules, and then write code that checks them.

We have fonts that work, and fonts that do not work, so using fontdiffenator (or even just comparing the TTX output of the OS/2, name and post tables, by hand) should reveal what is going on.

@mjlagattuta
Copy link
Contributor

For the name table there are 2–4 entries that really matter and other entries are variations of this. These are entries 1, 2, 16, and 17. nameID 16 and 17 are only necessary if the style of the font does not fall into a RIBBI model. I see 4 possibilities for a font (though it essentially boils down to RIBBI or non-RIBBI):

  1. Static + RIBBI
  2. Static + non-RIBBI
  3. VF + RIBBI
  4. VF + non-RIBBI

For case 1 nameID 1 is the FontFamilyName and should be the "family name with spaces" and nameID 2 should be the respective RIBBI style.

In case 2 nameID 1 would be "family name with spaces" + the style name (i.e. Thin, Light, Medium) and nameID 2 would be either Regular or Italic. In this case nameID 16 and 17 become necessary and should be "famliy name with spaces" and style name (or style name sans Italic) respectively.

I believe case 3 will be the most common for VFs since I don't currently see much use where a family is spread across multiple VFs and needs to make use of non-RIBBI styleNames. This is handled the same way as case 1, with Regular being the most common style name used for nameID 2, and no need for nameID 16 or 17. The instance names and styles of VFs are then accessed via the STAT table

Case 4 would be handled in the same way that case 2 is handled.

For the name tables (on the Windows platform) FontBakery currently has (in the Google Fonts specification) check 156 for the presence of nameID 16 and nameID 17 if the style name does not conform to RIBBI. Check 157 checks that the family name of the font file matches the string at nameID 1 if it conforms to RIBBI and otherwise checks that nameID 1 is the family name + the style name. Check 158 then makes sure that the entries at nameID 2 can only be RIBBI. Checks 161 and 162 check for proper entries at nameID 16 and 17 respectively.

Unless I am not understanding the issue properly, I believe these checks address the above problems.

@m4rc1e
Copy link
Collaborator

m4rc1e commented Oct 1, 2018

@mjlagattuta Thanks for the write up. We have this info has a spreadsheet

Has anyone been able to verify what this user has found?

@mjlagattuta
Copy link
Contributor

Same as @laerm0 I cannot replicate this for Open Sans and Roboto but I can for Roboto Slab. I just ran the four fonts through FontBakery. Checks 157 and 158 yielded FAIL for both Roboto Slab Light and Roboto Slab Thin and suggested the correct name string that was expected, so it would seem FontBakery is successfully detecting these name table errors

@m4rc1e
Copy link
Collaborator

m4rc1e commented Oct 1, 2018

Thanks for looking into this.

@felipesanches
Copy link
Collaborator

The implementation of com.google.fonts/check/156 is correct indeed, but its code-test was not, so I have just fixed it at felipesanches/fontbakery@4fa6cef

@davelab6
Copy link
Member Author

davelab6 commented Oct 2, 2018 via email

@felipesanches
Copy link
Collaborator

felipesanches commented Oct 2, 2018

I am reviewing the other checks. They seem to be correctly implemented as well, but lack code-tests, so I am working on it right now.

@felipesanches
Copy link
Collaborator

felipesanches/fontbakery@22fea7d fixes checks 157 and 158. It also implements code-test for check/157.

@felipesanches
Copy link
Collaborator

@mjlagattuta, at #1618 (comment) you said:

Check 158 then makes sure that the entries at nameID 2 can only be RIBBI.

But reading the current implementation of check/158 I see:

  for name in ttFont['name'].names:
    if name.nameID == NameID.FONT_SUBFAMILY_NAME:
      if style_with_spaces not in STYLE_NAMES:
        yield FAIL, ("Style name '{}' inferred from filename"
                     " is not canonical."
                     " Valid options are: {}").format(style_with_spaces,
                                                      STYLE_NAMES)
        failed = True
        continue

and at constants.py we have STYLE_NAMES declared as:

STYLE_NAMES = ["Thin",
               "ExtraLight",
               "Light",
               "Regular",
               "Medium",
               "SemiBold",
               "Bold",
               "ExtraBold",
               "Black",
               "Thin Italic",
               "ExtraLight Italic",
               "Light Italic",
               "Italic",
               "Medium Italic",
               "SemiBold Italic",
               "Bold Italic",
               "ExtraBold Italic",
               "Black Italic"]

So that's defnitely not RIBBI-only...

Can you review that comment, please?

@mjlagattuta
Copy link
Contributor

That portion of code only checks to make sure that the style name is canonical.

I believe my comment on the check was in reference to this snippet that is just below the one you referenced:

      if name.platformID == PlatformID.MACINTOSH:
        expected_value = style_with_spaces

      elif name.platformID == PlatformID.WINDOWS:
        if style_with_spaces in ["Bold", "Bold Italic"]:
          expected_value = style_with_spaces
        else:
          if "Italic" in style:
            expected_value = "Italic"
          else:
            expected_value = "Regular"
      else:
        yield FAIL, ("Font should not have a "
                     "{} entry!").format(name_entry_id(name))
        failed = True

After checking that the style name is canonical then this checks that anything that is not Bold, Bold Italic, or Italic should be Regular

I think this is correct for checking static fonts, but for Variable fonts, it is not, since we may want to differentiate between the font's default outlines and the regular instance (if those two things are not the same). As an example, Comfortaa VF, has a font subfamily name of "Light" in reference to its default outlines, which ensures that the instances in dropdowns on Mac do not display two "Regulars".

@felipesanches
Copy link
Collaborator

felipesanches commented Oct 26, 2018

@Spherikal
Copy link

Did this ever get a solution? I still can't use Roboto Slab in Word...

@julieyunt
Copy link

julieyunt commented Apr 15, 2019

Also can't use Roboto Slab - regular in Word Office 2016 (on a PC) It reverts to Roboto Slab - Light.
How do we get this fixed.
Staff member said it works fine on their Mac or Word online. Haven't verified.

@RosaWagner RosaWagner added the -- Needs Upstream Resolution Upstream fix required before moving forward label Aug 13, 2021
@RosaWagner RosaWagner removed this from the Bugs in Font Files 01 Requires Upstream Resolution milestone Aug 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-- Needs Upstream Resolution Upstream fix required before moving forward I Font Bug
Projects
None yet
Development

No branches or pull requests

8 participants