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

Fix dist-enabled scripts #582

Merged
merged 6 commits into from
Feb 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Lib/ufo2ft/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"Limb", # Limbu
"Tale", # Tai Le
"Bugi", # Buginese
"khar", # Kharosthi
"Khar", # Kharosthi
"Sylo", # Syloti Nagri
"tfng", # Tifinagh
"Bali", # Balinese
Expand Down
87 changes: 3 additions & 84 deletions Lib/ufo2ft/featureWriters/kernFeatureWriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from fontTools import unicodedata

from ufo2ft.constants import INDIC_SCRIPTS, USE_SCRIPTS
from ufo2ft.featureWriters import BaseFeatureWriter, ast
from ufo2ft.util import classifyGlyphs, quantize, unicodeScriptDirection

Expand All @@ -11,93 +12,11 @@
# In HarfBuzz the 'dist' feature is automatically enabled for these shapers:
# src/hb-ot-shape-complex-myanmar.cc
# src/hb-ot-shape-complex-use.cc
# src/hb-ot-shape-complex-dist.cc
# src/hb-ot-shape-complex-indic.cc
# src/hb-ot-shape-complex-khmer.cc
# We derived the list of scripts associated to each dist-enabled shaper from
# `hb_ot_shape_complex_categorize` in src/hb-ot-shape-complex-private.hh
DIST_ENABLED_SCRIPTS = {
# Indic shaper's scripts
# Unicode-1.1 additions
"Beng", # Bengali
"Deva", # Devanagari
"Gujr", # Gujarati
"Guru", # Gurmukhi
"Knda", # Kannada
"Mlym", # Malayalam
"Orya", # Oriya
"Taml", # Tamil
"Telu", # Telugu
# Unicode-3.0 additions
"Sinh", # Sinhala
# Khmer shaper
"Khmr", # Khmer
# Myanmar shaper
"Mymr", # Myanmar
# USE shaper's scripts
# Unicode-3.2 additions
"Buhd", # Buhid
"Hano", # Hanunoo
"Tglg", # Tagalog
"Tagb", # Tagbanwa
# Unicode-4.0 additions
"Limb", # Limbu
"Tale", # Tai Le
# Unicode-4.1 additions
"Bugi", # Buginese
"Khar", # Kharoshthi
"Sylo", # Syloti Nagri
"Tfng", # Tifinagh
# Unicode-5.0 additions
"Bali", # Balinese
# Unicode-5.1 additions
"Cham", # Cham
"Kali", # Kayah Li
"Lepc", # Lepcha
"Rjng", # Rejang
"Saur", # Saurashtra
"Sund", # Sundanese
# Unicode-5.2 additions
"Egyp", # Egyptian Hieroglyphs
"Java", # Javanese
"Kthi", # Kaithi
"Mtei", # Meetei Mayek
"Lana", # Tai Tham
"Tavt", # Tai Viet
# Unicode-6.0 additions
"Batk", # Batak
"Brah", # Brahmi
# Unicode-6.1 additions
"Cakm", # Chakma
"Shrd", # Sharada
"Takr", # Takri
# Unicode-7.0 additions
"Dupl", # Duployan
"Gran", # Grantha
"Khoj", # Khojki
"Sind", # Khudawadi
"Mahj", # Mahajani
"Modi", # Modi
"Hmng", # Pahawh Hmong
"Sidd", # Siddham
"Tirh", # Tirhuta
# Unicode-8.0 additions
"Ahom", # Ahom
"Mult", # Multani
# Unicode-9.0 additions
"Bhks", # Bhaiksuki
"Marc", # Marchen
"Newa", # Newa
# Unicode-10.0 additions
"Gonm", # Masaram Gondi
"Soyo", # Soyombo
"Zanb", # Zanabazar Square
# Unicode-11.0 additions
"Dogr", # Dogra
"Gong", # Gunjala Gondi
"Maka", # Makasar
# Unicode-12.0 additions
"Nand", # Nandinagari
}
DIST_ENABLED_SCRIPTS = set(INDIC_SCRIPTS) | set(["Khmr", "Mymr"]) | set(USE_SCRIPTS)

RTL_BIDI_TYPES = {"R", "AL"}
LTR_BIDI_TYPES = {"L", "AN", "EN"}
Expand Down
2 changes: 1 addition & 1 deletion tests/fontInfoData_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def test_no_change(self):

class DateStringToTimeValueTest:
def test_roundtrip_random_timestamp(self):
timestamp = random.randint(0, 10 ** 9)
timestamp = random.randint(0, 10**9)
ds = time.strftime("%Y/%m/%d %H:%M:%S", time.gmtime(timestamp))
assert dateStringToTimeValue(ds) == timestamp

Expand Down