Worklog, Encode Sans

92 views
Skip to first unread message

Stephen Nixon

unread,
Oct 25, 2018, 6:05:25 PM10/25/18
to Google Fonts Discussions
I have been doing some work to make Encode Sans into a variable font. This typeface was originally started by Pablo Impallari, and received extra attention from Jacques Le Bailly. 


I will primarily document my work in the repo /docs, so you can check that source for the most up-to-date progress. However, I will also post periodic updates here for greater visibility in the community.

Stephen Nixon

unread,
Oct 25, 2018, 6:14:31 PM10/25/18
to Google Fonts Discussions
I did some work to understand and get past a "weight cliff" issue. Thanks to the help of Mike LaGattuta, there is now a handy Glyphs Script to fix this.

So far, the script is a bit different for different fonts. Generally, however, it takes non-rectangular designspaces and makes them rectangular, so that sliders work across their ranges, and so that weight values line up across a second axis (e.g. Width).



For the full details of my work in deciding how to morph the designspace, see this documentation:

Variable Font issue: Variable fonts with non-rectangular designspaces export with unpredictable failures. FontMake (?) should fix this

There is another, somewhat-associated issue: kerning groups get confused during the FontMake export, yielding some very odd kerning. This issue is documented at https://github.com/googlei18n/fontmake/issues/470.

Here's an overlay showing the current variable font overlaid onto the existing static version. This problem gets worse with increased font weight, because the positive kerning values for /dcroat are being mapped onto glyphs in the same group as /d (all lowercase glyphs with a straight right side).

image

Stephen Nixon

unread,
Oct 25, 2018, 6:20:21 PM10/25/18
to Google Fonts Discussions

Font Baking Encode Sans

After getting past the "weight cliff" issue (see previous doc), I've had more work to do in getting past errors and failures flagged by FontBakery.


Font-mastering techniques I've found useful

Using a build script

I have had quite a bit of success in correcting issues by using a build script based on a shell script inherited from @mjlagattuta (NOTE: currently only works in my Python3 environment). This script strings together useful functionality, allowing a few options based on some set variables:

  • the GlyphsApp source is temporarily duplicated and get its designspace morphed (to fix the weight cliff issue)
  • the FontMake variable font build is triggered
  • the generated designspace is either kept or discarded
  • gftools is run to fix various metadata errors
  • ttx is used to generate an XML version of the VF so that:
  • ttx is used again to compile back to TTF
  • the built fonts is moved into a timestamped folder
  • FontBakery is run to QA output

I have kept a log of FontBakery runs as a GitHub issue.


Setting common weight values across widths

FAIL: The variable font 'wght' (Weight) axis coordinate must be 400 on the 'Regular' instance.
FAIL: The variable font 'wght' (Weight) axis coordinate must be 700 on the 'Bold' instance.


To fix this: Set the instances to a common weight value in the script which morphs the designspace to be rectangular and matches instance weight values. Before, the instances were slightly off. This meant that something with a weight of 85 would map to 700, but something with a weight of 86 (as was the case in the SemiCondensed regular instance) would map to 403.7037.


Installing fontvalidator and changing how FontBakery handles it


💔 ERROR: Checking with Microsoft Font Validator.
- com.google.fonts/check/037
- 💔 ERROR Mono runtime and/or Microsoft Font Validator are not available!
- 💔 ERROR Failed with FileNotFoundError: [Errno 2] No such file or directory: 'FontValidator.exe': 'FontValidator.exe'

This probably doesn't have a final solution, because fontvalidator seems to be undergoing some changes. However, I've gotten past this error and received QA from Font Validator by:

  1. Installing the latest osX release from https://github.com/HinTak/Font-Validator/releases, then unzip
  2. Change the unzipped binary's permissions, chmod 755 FontValidator
  3. Moving the downloaded file into the same directory I use for my Python environment (for me, that's just ~/Environments/gfonts/bin).

Find general.py in the FontBakery code, then find lines 160–166. Change:

1. Change FontValidator.exe to FontValidator 2. Change + to -no-raster-tests


Update: the latest FontBakery just has this working, so now I've simply run pip3 install --upgrade fontbakery.


And now, I'm getting a bunch of FontValidator errors reporting! I'll next need to understand which to fix, and which to accept (assuming some might be fine).


FontVal errors

MS FontVal duplicates errors a lot, because it reports them for every glyph checked. I literally have 11,000+ lines of errors from it, but they boil down to these:

  • 🔥 FAIL MS-FonVal: The version number is neither 0x00010000 nor 0x0001002 DETAILS: 0x00010003

A ton of these:

  • 🔥 FAIL MS-FonVal: The device table's DeltaFormat value is invalid DETAILS: LookupList, Lookup[0], SubTable[0](PairPos, fmt 1), PairSet[0], PairValueRecord[0], Value1, XAdvDeviceTable, DeltaFormat = 32768-
  • 🔥 FAIL MS-FonVal: Intersecting contours DETAILS: Glyph index 1

  • 🔥 FAIL MS-FonVal: The Mac PostScript string does not match the Microsoft PostScript string DETAILS: mac postscript = EncodeSans-ThinCondensed, MS postscript = EncodeSans-Regular

  • ℹ️ INFO Microsoft Font Validator returned an error code. Output follows :

  • ℹ️ INFO MS-FonVal: The MarkSetCount of the GDEF table DETAILS: MarkGlyphSetsDef: MarkSetCount=3

  • ℹ️ INFO MS-FonVal: Not an OpenType table, contents not validated

  • ℹ️ INFO MS-FonVal: Not an OpenType table, contents not validated DETAILS: This table type is defined in the Apple TrueType spec.

A bunch of these:

  • ℹ️ INFO MS-FonVal: Unable to perform test due to previously detected errors DETAILS: Glyph index 1 Test: ValidateSimpContMisor

Plus:

  • ℹ️ INFO MS-FonVal: Loca references a zero-length entry in the glyf table DETAILS: Number of glyphs that are empty = 9

  • ℹ️ INFO MS-FonVal: maxSizeOfInstructions via method #1 DETAILS: maxSizeOfInstructions=0, computed from the glyf table

  • ℹ️ INFO MS-FonVal: No string for Typographic Family name (Name ID 16)

  • ℹ️ INFO MS-FonVal: No string for Typographic Subfamily name (Name ID 17)

  • ℹ️ INFO MS-FonVal: The post name has an unexpected value DETAILS: glyph = 1120, char = U+FFFF, name = uni0337

  • ℹ️ INFO MS-FonVal: The post name isn't in uniXXXX or uXXXXX format and there is no Adobe Glyph List entry DETAILS: glyph = 1217, char = U+000D, name = CR

  • ℹ️ INFO MS-FonVal: The post name isn't in uniXXXX or uXXXXX format and there is no Adobe Glyph List entry DETAILS: glyph = 1218, char = U+0000, name = NULL

  • ℹ️ INFO MS-FonVal: Rasterization not selected for validation
More updates coming soon!

Stephen Nixon

unread,
Nov 26, 2018, 2:51:47 PM11/26/18
to Google Fonts Discussions
To avoid sending a mega-email, I'm instead linking to documentation updates on my GitHub repo.

Final steps for Encode will be:
  • Splitting variable font into 5 separate width-based families, for use on Google Fonts before a width axis is supported

  • Double-checking kerning in upgraded diacritics

  • Running a FontLab6 test on glyphs, going through glyph-by-glyph to ensure that outlines are good (and fixing any other issues that might be flagged by FontLab)

  • Making sure I'm doing the right thing for hinting (based on a conversation with Micah that will happen tomorrow)

  • Test installing on Windows & Office

  • Opening Pull Request with explanations on any remaining FontBakery fails and warns

Dave Crossland

unread,
Nov 26, 2018, 3:55:09 PM11/26/18
to googlefon...@googlegroups.com, Nyshadh Reddy Rachamallu, Evan Adams
Thanks Stephen! Sterling work :) 

On Mon, Nov 26, 2018 at 12:51 PM Stephen Nixon <ste...@thundernixon.com> wrote:
Final steps for Encode will be:
  • Splitting variable font into 5 separate width-based families, for use on Google Fonts before a width axis is supported

Ah, I think the API wants just static fonts (for all design changes), then a VF font with a single Weight axis only for the normal width, and then a full VF :) 
Reply all
Reply to author
Forward
0 new messages