source-han-sans icon indicating copy to clipboard operation
source-han-sans copied to clipboard

Incomplete localized `name` table for VF, and other problems

Open NightFurySL2001 opened this issue 2 years ago • 5 comments

Not sure if it is a problem with the build process or the build program itself, but the name table in VF left traces of the starting ExtraLight in the name table as such (exported with ttx):

    <namerecord nameID="1" platformID="3" platEncID="1" langID="0xc04">
      思源黑體 香港 VF
    </namerecord>
    <namerecord nameID="2" platformID="3" platEncID="1" langID="0xc04">
      Regular
    </namerecord>
    <namerecord nameID="4" platformID="3" platEncID="1" langID="0xc04">
      思源黑體 香港 VF
    </namerecord>
    <namerecord nameID="17" platformID="3" platEncID="1" langID="0xc04">
      ExtraLight
    </namerecord>

There is no name ID = 16 in the font file:

    <namerecord nameID="14" platformID="3" platEncID="1" langID="0x409">
      http://scripts.sil.org/OFL
    </namerecord>
    <namerecord nameID="17" platformID="3" platEncID="1" langID="0x409">
      ExtraLight
    </namerecord>

and there is no localized name for name ID = 265-279.

Could it be related to why SHS does not display all weight instances in Windows (including no Prev/Next button when previewing)? Source Sans and Roboto VF do appear to be able to display all weight instances in Windows.

NightFurySL2001 avatar Nov 21 '21 06:11 NightFurySL2001

ExtraLight is because that's the default instance in the variable font. Since there are only two masters only one of those can be the default so it must be either ExtraLight or Heavy. That's an issue with how the variable font spec was created in the first place. Ideally we could make it Regular, but since we can't right now we use ExtraLight.

This is the first I've heard of Windows not displaying the full name. Is this with the release fonts or with something you did with ttx? Which version of Windows? Which app or is it Font Settings in the system settings?

punchcutter avatar Nov 21 '21 07:11 punchcutter

Not the full name, but the 7 weights (Extralight to Heavy) in VF as mentioned here (https://github.com/adobe-fonts/source-han-sans/issues/290#issuecomment-829505434), sorry for confusion.

My main question is on the incomplete localized name table and the weirdly removed name record ID 16.

For the default instance, Source Sans also has the default instance at ExtraLight (200) but it still doesn't affect how the font is displayed. Below is the fvar from Source Sans 3.

    <!-- Weight -->
    <Axis>
      <AxisTag>wght</AxisTag>
      <Flags>0x0</Flags>
      <MinValue>200.0</MinValue>
      <DefaultValue>200.0</DefaultValue>
      <MaxValue>900.0</MaxValue>
      <AxisNameID>299</AxisNameID>
    </Axis>

Below is screenshot of Source Sans 3 VF displaying its bold instance: image and all weight instances in Microsoft Word (6 in total, Bold is merged with Regular): image

NightFurySL2001 avatar Nov 21 '21 08:11 NightFurySL2001

Oh, that issue. That seems to be a bug in Word and since Microsoft said they don't officially support variable fonts in Word it's not really considered a bug. The subsets and other fonts mentioned are created in exactly the same way so it was only the full set showing this issue. That makes it seems like something else is going on.

punchcutter avatar Nov 21 '21 08:11 punchcutter

I am guessing something else is going on too since Word processor relies on Windows type engine. In Control Panel, SHS only show up with ExtraLight: image but Source Sans appear in a family and shows the 6 weights: image image and double clicking any of the font will show the same preview as opening the VF itself. (Note that the Previous and Next are available similar to TTC even though it is a variable font). image Comparison of SHS (does not have the buttons): image

In Notepad: image image

Maybe a parameter isn't set correctly in head or OS/2 that Windows did not detect?

NightFurySL2001 avatar Nov 21 '21 09:11 NightFurySL2001

I don't think anything is wrong in the font since the subset versions do show all the names and everything in those is exactly the same as the full set.

punchcutter avatar Nov 21 '21 11:11 punchcutter