daltonmaag / ubuntu

Other
31 stars 5 forks source link

Gpos fixes #38

Closed madig closed 6 years ago

madig commented 6 years ago
  1. Match GPOS kerning to GF release (validated with https://github.com/adobe-type-tools/kern-dump). Note that the UFO sources declare the language systems differently, but none of them change the features, so I suppose it makes no difference.
  2. Match kern table to GF release.

The GPOS table is the canonical one, the kern table is simply post-processed.

To validate, use this script (modify the paths and rename the GF download to match the file names of the UFO sources; on macOS, remove the sed line and the -u parameter from cp):

#!/bin/env bash

REMOVE_LINES="/\(created\|modified\|Revision\|checkSum\|version\|xAvgCharWidth\)/d"

mkdir -p /tmp/font1
cp -u PATH/TO/GF/DOWNLOAD/*ttf /tmp/font1
rm /tmp/font1/*ttx
for f in /tmp/font1/*ttf; do
  ttx -t "$1" $f
  sed -i $REMOVE_LINES ${f/ttf/ttx}
done

mkdir -p /tmp/font2
cp -u PATH/TO/REPO/build/*ttf /tmp/font2
rm /tmp/font2/*ttx
for f in /tmp/font2/*ttf; do
  ttx -t "$1" $f
  sed -i $REMOVE_LINES ${f/ttf/ttx}
done

for f in /tmp/font1/*ttx; do
  diff -U2 $f ${f/font1/font2}
done
# Build UFO sources first.
$ bash above_script.sh kern
$ dumpkerning.py /tmp/font1/*ttf /tmp/font2/*ttf
$ for f in /tmp/font1/*kerndump; do diff -U2 $f ${f/font1/font2}; done

You should see no diffs.

madig commented 6 years ago

Should the hack in flatten_kerning() remain there or be added during post-processing?

sladen commented 6 years ago

Might be useful to include this script in the source itself, along with a make kerncheck that returns true/false in addition to whatever it prints.

madig commented 6 years ago

May include a cleaned-up and streamlined script at some point.