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

Prepare Fraunces for Google Fonts #1

Closed
14 of 17 tasks
arrowtype opened this issue Oct 13, 2020 · 2 comments
Closed
14 of 17 tasks

Prepare Fraunces for Google Fonts #1

arrowtype opened this issue Oct 13, 2020 · 2 comments

Comments

@arrowtype
Copy link
Owner

arrowtype commented Oct 13, 2020

Some of these fixes will follow the work from Viviana at https://github.com/vv-monsalve/Fraunces/issues/2

Assumptions on naming:

Fontbakery fixes

  • find out if it is okay to exceed 27 chars in variable font name
    • This probably won’t be relevant once the naming is fixed to reflect the default, simplified instance names

Whitespace naming

  • prevent com.google.fonts/check/whitespace_glyphnames: Glyph 0x0020 is called "uni0020": Change to "space" – probably by adding --no-production-names arg to fontmake

Now that I have added --no-production-names, I now get the message * WARN: Glyph 0x00A0 is called "nbspace": Change to "uni00A0" [code: not-recommended-00a0].

Not sure if this is worth worrying about...

Optical size default must be 9pt

  • WARN: The "opsz" (Optical Size) coordinate on the "Regular" instance is recommended to be a value in the range 9 to 13. Got 144.0 instead.
    • default for range set to 9, but mastering/scripts/removeUnwantedVFInstances.py removes all instances but those with opsz=144... will investigate further
    • SOLVED by changing opsz values for final instances in variable designspaces

Description length

com.google.fonts/check/ligature_carets

add ligature carets Actually, I have added these to to UFOs, but ufo2ft doesn’t yet support this, so this is pointless. As was said at undercasetype#206:

Ligature carets are now included in the UFO spec, but I wasn’t able to find an indication that they are handled by ufo2ft or fontmake. related issue

Fontbakery false fails:

[WIP – more to come here]

@arrowtype
Copy link
Owner Author

arrowtype commented Oct 13, 2020

Useful regex recipe to match & update UFO paths via find & replace:

Fraunces9ptExtraSoft(.*?).ufo
Fraunces9ptS100$1.ufo

.* or .*?. The first one is greedy and will match till the last "sentence" in your string, the second one is lazy and will match till the next "sentence" in your string. source

Process to fix style names but keep proper UFO paths:

  1. Replace S000 with Sharp to update style names (though this also breaks paths)
  2. Then replace Fraunces(.*?)Sharp-(.*?).ufo with Fraunces$1S000-$2.ufo to fix UFO paths
  3. Replace Fraunces-(.*?)Sharp(.*?).ufo with Fraunces-$1S000$2.ufo to fix UFO source paths
  4. Repeat for S050 and S100

(etc)

Changes made:

  • Removing ".ufo" and replacing Sxxx in instance name properties.
  • Setting instance ufo names to use readable Sharp/Soft/ExtraSoft names, to output better static TTF filenames

Lingering challenge

Some names are getting a space removed between the opsz and SOFT labels. This formation isn’t anywhere in the designspaces, so it is likely due to a regex issue in mastering/scripts/fixNameTable.py.

  • Name 1: Fraunces 9ptExtraSoft
  • Name 4: Fraunces 72ptExtraSoft Bold

The problem: the familyname is taken from a parsed filename, with the expectation that the filename will only have a family, single style, then weight name: return_familyname(filename)

def return_familyname(filename):
name = return_filename_no_extension(filename).split("-")[0]
parts = []
i = 0
previous = None
for s in name:
if unicodedata.category(s) in ['Lu', 'Nd'] and not unicodedata.category(s) == previous:
previous = unicodedata.category(s)
part = name[:i]
if part:
parts.append(part)
name = name[i:]
i = 0
i += 1
parts.append(name)
parts[-2] += parts[-1]
del parts[-1]
return ' '.join(parts)

Name table with fixNameTable.py (Click to expand)

Dumping "/Users/stephennixon/type-repos/google-font-repos/Fraunces/fonts/static/ttf/Fraunces9ptExtraSoft-Bold.ttf" to "-"...
<?xml version="1.0" encoding="UTF-8"?>
<ttFont sfntVersion="\x00\x01\x00\x00" ttLibVersion="4.13">

Dumping 'name' table...
  <name>
    <namerecord nameID="0" platformID="3" platEncID="1" langID="0x409">
      Copyright 2020 The Fraunces Project Authors (github.com/undercasetype/Fraunces)
    </namerecord>
    <namerecord nameID="1" platformID="3" platEncID="1" langID="0x409">
      Fraunces 9ptExtraSoft
    </namerecord>
    <namerecord nameID="2" platformID="3" platEncID="1" langID="0x409">
      Bold
    </namerecord>
    <namerecord nameID="3" platformID="3" platEncID="1" langID="0x409">
      1.000;UCT;Fraunces9ptExtraSoft-Bold
    </namerecord>
    <namerecord nameID="4" platformID="3" platEncID="1" langID="0x409">
      Fraunces 9ptExtraSoft Bold
    </namerecord>
    <namerecord nameID="5" platformID="3" platEncID="1" langID="0x409">
      Version 1.000
    </namerecord>
    <namerecord nameID="6" platformID="3" platEncID="1" langID="0x409">
      Fraunces9ptExtraSoft-Bold
    </namerecord>
    <namerecord nameID="13" platformID="3" platEncID="1" langID="0x409">
      This Font Software is licensed under the SIL Open Font License, Version 1.1. This license is available with a FAQ at: https://scripts.sil.org/OFL
    </namerecord>
    <namerecord nameID="14" platformID="3" platEncID="1" langID="0x409">
      https://scripts.sil.org/OFL
    </namerecord>
    <namerecord nameID="18" platformID="3" platEncID="1" langID="0x409">
      Fraunces 9ptExtraSoft Bold
    </namerecord>
    <namerecord nameID="25" platformID="3" platEncID="1" langID="0x409">
      FrauncesRoman
    </namerecord>
  </name>

</ttFont>

Name table without fixNameTable.py (Click to expand)

Dumping "/Users/stephennixon/type-repos/google-font-repos/Fraunces/fonts/static/ttf/Fraunces9ptExtraSoft-Bold.ttf" to "-"...
<?xml version="1.0" encoding="UTF-8"?>
<ttFont sfntVersion="\x00\x01\x00\x00" ttLibVersion="4.13">

Dumping 'name' table...
  <name>
    <namerecord nameID="0" platformID="3" platEncID="1" langID="0x409">
      Copyright 2020 The Fraunces Project Authors (github.com/undercasetype/Fraunces)
    </namerecord>
    <namerecord nameID="1" platformID="3" platEncID="1" langID="0x409">
      Fraunces 9pt ExtraSoft
    </namerecord>
    <namerecord nameID="2" platformID="3" platEncID="1" langID="0x409">
      Bold
    </namerecord>
    <namerecord nameID="3" platformID="3" platEncID="1" langID="0x409">
      1.000;UCT;Fraunces9ptExtraSoft-Bold
    </namerecord>
    <namerecord nameID="4" platformID="3" platEncID="1" langID="0x409">
      Fraunces 9pt ExtraSoft Bold
    </namerecord>
    <namerecord nameID="5" platformID="3" platEncID="1" langID="0x409">
      Version 1.000
    </namerecord>
    <namerecord nameID="6" platformID="3" platEncID="1" langID="0x409">
      Fraunces9ptExtraSoft-Bold
    </namerecord>
    <namerecord nameID="13" platformID="3" platEncID="1" langID="0x409">
      This Font Software is licensed under the SIL Open Font License, Version 1.1. This license is available with a FAQ at: https://scripts.sil.org/OFL
    </namerecord>
    <namerecord nameID="14" platformID="3" platEncID="1" langID="0x409">
      https://scripts.sil.org/OFL
    </namerecord>
    <namerecord nameID="25" platformID="3" platEncID="1" langID="0x409">
      FrauncesRoman
    </namerecord>
  </name>

</ttFont>

Another Name table without fixNameTable.py (Click to expand)
Dumping "/Users/stephennixon/type-repos/google-font-repos/Fraunces/fonts/static/ttf/Fraunces9ptExtraSoft-Black.ttf" to "-"...
<?xml version="1.0" encoding="UTF-8"?>
<ttFont sfntVersion="\x00\x01\x00\x00" ttLibVersion="4.13">

Dumping 'name' table...
  <name>
    <namerecord nameID="0" platformID="3" platEncID="1" langID="0x409">
      Copyright 2020 The Fraunces Project Authors (github.com/undercasetype/Fraunces)
    </namerecord>
    <namerecord nameID="1" platformID="3" platEncID="1" langID="0x409">
      Fraunces 9pt ExtraSoft Black
    </namerecord>
    <namerecord nameID="2" platformID="3" platEncID="1" langID="0x409">
      Regular
    </namerecord>
    <namerecord nameID="3" platformID="3" platEncID="1" langID="0x409">
      1.000;UCT;Fraunces9ptExtraSoft-Black
    </namerecord>
    <namerecord nameID="4" platformID="3" platEncID="1" langID="0x409">
      Fraunces 9pt ExtraSoft Black
    </namerecord>
    <namerecord nameID="5" platformID="3" platEncID="1" langID="0x409">
      Version 1.000
    </namerecord>
    <namerecord nameID="6" platformID="3" platEncID="1" langID="0x409">
      Fraunces9ptExtraSoft-Black
    </namerecord>
    <namerecord nameID="13" platformID="3" platEncID="1" langID="0x409">
      This Font Software is licensed under the SIL Open Font License, Version 1.1. This license is available with a FAQ at: https://scripts.sil.org/OFL
    </namerecord>
    <namerecord nameID="14" platformID="3" platEncID="1" langID="0x409">
      https://scripts.sil.org/OFL
    </namerecord>
    <namerecord nameID="16" platformID="3" platEncID="1" langID="0x409">
      Fraunces 9pt ExtraSoft
    </namerecord>
    <namerecord nameID="17" platformID="3" platEncID="1" langID="0x409">
      Black
    </namerecord>
    <namerecord nameID="25" platformID="3" platEncID="1" langID="0x409">
      FrauncesRoman
    </namerecord>
  </name>

</ttFont>

The fixNameTable script doesn’t seem to have an advantage for Fraunces static name tables ... BUT it also adjusts the head and OS/2 tables, so it probably does make some useful changes there for style-linking. I probably need to adjust the script to better handle the basic stylename, rather than scrapping it.

@arrowtype
Copy link
Owner Author

arrowtype commented Oct 15, 2020

Further fixes to fixNameTable.py

Variable

"Italic" is in the family names in italic variable fonts.

# TODO: remove "Italic" from the family name

        # nameID1  = Fraunces Italic 9pt ExtraSoft Black        # remove " Italic", then add to end " Italic"
        # nameID3  = 1.000;UCT;FrauncesItalic-9ptExtraSoftBlack # remove "Italic", then add to end "Italic"
        # nameID4  = Fraunces Italic 9pt ExtraSoft Black        # remove " Italic", then add to end " Italic"
        # nameID6  = FrauncesItalic-9ptExtraSoftBlack           # remove "Italic", then add to end "Italic"
        # nameID16 = Fraunces Italic                            # remove " Italic"

Statics

"None" is in static font family names for RIBBI fonts, due to a try/except block being used where it actually needs an if/else block. (FontMake returns a NoneType if a nameID is missing, rather than an error.)

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

No branches or pull requests

1 participant