Hot fix for #510: Primes need to be angled.
Transplan glyphs for U+203[2-4] (prime, double prime and triple prime)
from NotoSerif* v3 to NotoSerif v2.
v3 has upem of 1000, while v2 has upem of 2048. So, before transplating
glyphs, the glyphs for three characters are scaled up by a factor of
2048/1000. In addition, htmx table was also updated (lsb and width).
The following script was used to transplant glyphs and bump up the
version number to 1.07 from 1.06.
Note that only unhinted NotoSerif-*.ttf are updated and hinted
NotoSerif*.ttf are left alone.
------
from os import path
from nototools import fix_khmer_and_lao_coverage as merger
from nototools import font_data
from nototools import subset
from fontTools import ttLib
def make_version_str(revision):
revision_int = int(revision)
revision_frac = int(round((revision - revision_int) * 100))
return 'Version ' + str(int(revision)) + '.' + str(revision_frac).zfill(2)
def bump_version(font_file):
font = ttLib.TTFont(font_file)
_VERSION_ID = 5
revision = font['head'].fontRevision
version_str = make_version_str(revision)
new_revision = float(int(round(revision*100)) + 1) / 100
new_version_str = make_version_str(new_revision)
print " " + version_str + " => " + new_version_str
font['head'].fontRevision = new_revision
version_id = font_data.get_name_records(font)[_VERSION_ID]
new_version_id = new_version_str + version_id[len(version_str):]
font_data.set_name_record(font, _VERSION_ID, new_version_id,
addIfMissing='win')
font.save(font_file)
V3_DIR = "v3_generated/scaled"
V2_SRC_DIR = "v2_nohint"
DEST_DIR = "v2_nohint_fixed"
chars_to_transplant = {0x2032, 0x2033, 0x2034}
for style in ["Regular", "Italic", "Bold", "BoldItalic"]:
font_name = "NotoSerif-%s.ttf" % style
v2font_path = path.join(V2_SRC_DIR, font_name)
v3font_path = path.join(V3_DIR, font_name)
v2dest_path = path.join(DEST_DIR, font_name)
subset.subset_font(v2font_path, v2dest_path, exclude=chars_to_transplant)
merger.merge_chars_from_bank(v2dest_path,
v3font_path,
v2dest_path,
chars_to_transplant)
bump_version(v2dest_path)
diff --git a/unhinted/NotoSerif-Bold.ttf b/unhinted/NotoSerif-Bold.ttf
index 49911a7..50b12d3 100644
--- a/unhinted/NotoSerif-Bold.ttf
+++ b/unhinted/NotoSerif-Bold.ttf
Binary files differ
diff --git a/unhinted/NotoSerif-BoldItalic.ttf b/unhinted/NotoSerif-BoldItalic.ttf
index 8b5c397..741402e 100644
--- a/unhinted/NotoSerif-BoldItalic.ttf
+++ b/unhinted/NotoSerif-BoldItalic.ttf
Binary files differ
diff --git a/unhinted/NotoSerif-Italic.ttf b/unhinted/NotoSerif-Italic.ttf
index 3f628b8..84349fb 100644
--- a/unhinted/NotoSerif-Italic.ttf
+++ b/unhinted/NotoSerif-Italic.ttf
Binary files differ
diff --git a/unhinted/NotoSerif-Regular.ttf b/unhinted/NotoSerif-Regular.ttf
index d5b62a7..ec8afe6 100644
--- a/unhinted/NotoSerif-Regular.ttf
+++ b/unhinted/NotoSerif-Regular.ttf
Binary files differ