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

noto_lint update #518

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
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
10 changes: 7 additions & 3 deletions nototools/data/family_name_info_p3.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<info family="sans-adlm" family_name_style="short" include_regular="t" use_preferred="t" />
<info family="sans-adlm-unjoined" family_name_style="very short" include_regular="t" use_preferred="t" />
<info family="sans-aghb" family_name_style="very short" include_regular="t" use_preferred="t" />
<info family="sans-disp" family_name_style="short" include_regular="t" use_preferred="t" />
<info family="serif-ahom" family_name_style="short" include_regular="t" use_preferred="t" />
<info family="sans-arab" family_name_style="short" include_regular="t" use_preferred="t" />
<info family="sans-arab-ui" family_name_style="very short" include_regular="t" use_preferred="t" />
Expand Down Expand Up @@ -100,7 +101,6 @@
<info family="sans-maka" family_name_style="short" include_regular="t" use_preferred="t" />
<info family="sans-mand" family_name_style="short" include_regular="t" use_preferred="t" />
<info family="sans-mani" family_name_style="very short" include_regular="t" use_preferred="t" />
<info family="sans-manu" family_name_style="very short" include_regular="t" use_preferred="t" />
<info family="sans-marc" family_name_style="short" include_regular="t" use_preferred="t" />
<info family="sans-medf" family_name_style="very short" include_regular="t" use_preferred="t" />
<info family="sans-mend" family_name_style="short" include_regular="t" use_preferred="t" />
Expand Down Expand Up @@ -150,7 +150,6 @@
<info family="sans-sind" family_name_style="very short" include_regular="t" use_preferred="t" />
<info family="sans-sinh" family_name_style="short" include_regular="t" use_preferred="t" />
<info family="sans-sinh-ui" family_name_style="very short" include_regular="t" use_preferred="t" />
<info family="sans-siyq" family_name_style="very short" include_regular="t" use_preferred="t" />
<info family="sans-sogd" family_name_style="short" include_regular="t" use_preferred="t" />
<info family="sans-sogo" family_name_style="very short" include_regular="t" use_preferred="t" />
<info family="sans-sora" family_name_style="short" include_regular="t" use_preferred="t" />
Expand All @@ -161,6 +160,8 @@
<info family="sans-syrc-eastern" family_name_style="very short" include_regular="t" use_preferred="t" />
<info family="sans-syrc-estrangela" family_name_style="extra short" include_regular="t" use_preferred="t" />
<info family="sans-syrc-western" family_name_style="very short" include_regular="t" use_preferred="t" />
<info family="sans-syrc" family_name_style="very short" include_regular="t" use_preferred="t" />
<info family="sans-Taml_Sup" family_name_style="very short" include_regular="t" use_preferred="t" />
<info family="sans-tagb" family_name_style="short" include_regular="t" use_preferred="t" />
<info family="sans-takr" family_name_style="short" include_regular="t" use_preferred="t" />
<info family="sans-tale" family_name_style="short" include_regular="t" use_preferred="t" />
Expand All @@ -182,7 +183,6 @@
<info family="sans-tirh" family_name_style="short" include_regular="t" use_preferred="t" />
<info family="sans-ugar" family_name_style="short" include_regular="t" use_preferred="t" />
<info family="sans-vaii" family_name_style="short" include_regular="t" use_preferred="t" />
<info family="sans-wcho" family_name_style="short" include_regular="t" use_preferred="t" />
<info family="sans-wara" family_name_style="very short" include_regular="t" use_preferred="t" />
<info family="sans-xpeo" family_name_style="very short" include_regular="t" use_preferred="t" />
<info family="sans-xsux" family_name_style="very short" include_regular="t" use_preferred="t" />
Expand Down Expand Up @@ -222,6 +222,10 @@
<info family="serif-sinh" family_name_style="short" include_regular="t" use_preferred="t" />
<info family="serif-taml" family_name_style="short" include_regular="t" use_preferred="t" />
<info family="serif-taml-slanted" family_name_style="extra short" include_regular="t" use_preferred="t" />
<info family="serif-tang" family_name_style="short" include_regular="t" use_preferred="t" />
<info family="sans-siyq" family_name_style="very short" include_regular="t" use_preferred="t" />
<info family="sans-wcho" family_name_style="short" include_regular="t" use_preferred="t" />
<info family="sans-manu" family_name_style="very short" include_regular="t" use_preferred="t" />
<info family="serif-telu" family_name_style="short" include_regular="t" use_preferred="t" />
<info family="serif-thaa" family_name_style="short" include_regular="t" use_preferred="t" />
<info family="serif-thai" family_name_style="short" include_regular="t" use_preferred="t" />
Expand Down
2 changes: 1 addition & 1 deletion nototools/data/familyname_and_styles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ NotoSerifArabic # was Naskh
NotoSansGeorgian
NotoSerifGeorgian
NotoSansTamil
NotoSansTamilSupplement
NotoSansTamilUI
NotoSerifTamil
NotoSerifTamilSlanted
Expand Down Expand Up @@ -261,4 +262,3 @@ NotoKufiArabic
NotoNaskhArabic
NotoNaskhArabicUI
NotoMono

1 change: 1 addition & 0 deletions nototools/data/noto_cmap_phase3.xml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@
<tr>Tale,Tai Le,64,0000 000d 0020 00a0 0300-0301 0307-0308 030c 1040-1049 1950-196d 1970-1974 200b-200d 25cc 3001-3002 3008-300b,16,002c 002e 003a 003f 00d7 2012-2015 201c-201d 2022 25fb-25fe</tr>
<tr>Talu,New Tai Lue,90,0000 000d 0020 00a0 1980-19ab 19b0-19c9 19d0-19da 19de-19df 200c-200d 25cc,0,</tr>
<tr>Taml,Tamil,145,0000 000d 0020-0023 0025 0027-003f 005b-005f 007b-007e 00a0 00ad 00b2-00b3 00d7 00f7 0951-0952 0964-0965 0b82-0b83 0b85-0b8a 0b8e-0b90 0b92-0b95 0b99-0b9a 0b9c 0b9e-0b9f 0ba3-0ba4 0ba8-0baa 0bae-0bb9 0bbe-0bc2 0bc6-0bc8 0bca-0bcd 0bd0 0bd7 0be6-0bfa 1cda 200b-200d 2010 2013-2014 2018-2019 201c-201d 2026 2074 2082-2084 20b9 2212 25cc a8f3 11303 1133c,-1,</tr>
<tr>Taml_Sup,Tamil_Supplement,145,0000 000d 0020-0023 0025 0027-003f 005b-005f 007b-007e 00a0 00ad 00b2-00b3 00d7 00f7 0951-0952 0964-0965 0b82-0b83 0b85-0b8a 0b8e-0b90 0b92-0b95 0b99-0b9a 0b9c 0b9e-0b9f 0ba3-0ba4 0ba8-0baa 0bae-0bb9 0bbe-0bc2 0bc6-0bc8 0bca-0bcd 0bd0 0bd7 0be6-0bfa 1cda 200b-200d 2010 2013-2014 2018-2019 201c-201d 2026 2074 2082-2084 20b9 2212 25cc a8f3 11303 1133c,-1,</tr>
<tr>Tang,Tangut,6885,0000 000d 0020 00a0 16fe0 17000-187ec 18800-18af2,-1,</tr>
<tr>Tavt,Tai Viet,82,0000 000d 0020 00a0 200b-200d 25cc a78b-a78c aa80-aac2 aadb-aadf,10,00d7 2012-2015 2022 25fb-25fe</tr>
<tr>Telu,Telugu,160,0000 000d 0020-0023 0025 0027-003f 005b-005f 007b-007e 00a0 00ad 00d7 00f7 0951-0952 0964-0965 0c00-0c03 0c05-0c0c 0c0e-0c10 0c12-0c28 0c2a-0c39 0c3d-0c44 0c46-0c48 0c4a-0c4d 0c55-0c56 0c58-0c5a 0c60-0c63 0c66-0c6f 0c78-0c7f 1cda 200b-200d 2010 2013-2014 2018-2019 201c-201d 2026 20b9 2212 25cc,-1,</tr>
Expand Down
6 changes: 4 additions & 2 deletions nototools/noto_fonts.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,8 @@ def get_noto_font(filepath, family_name='Arimo|Cousine|Tinos|Noto',
'Adobe' if is_cjk
else 'Google' if script == 'Zsye' and variant == 'color'
else 'Khmertype' if phase < 3 and script in ['Khmr', 'Cham', 'Laoo']
else 'Ek Type' if script in ['Gonm','aml_Sup','Gong']
else 'JamraPatel LLC' if script in ['Adlm'] # ready to add new fonts to this manufacturer
else 'Monotype')

return NotoFont(
Expand Down Expand Up @@ -364,8 +366,8 @@ def noto_font_to_wws_family_id(notofont):
id += '-mono'
if notofont.is_UI:
id += '-ui'
if notofont.is_display:
id += '-display'
#if notofont.is_display: # Not sure why we add -display again. It's already appended to id in line 350.
#id += '-display'
return id


Expand Down
98 changes: 73 additions & 25 deletions nototools/noto_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@

# Regex values returned in NameTableData must start with ^ and end with $,
# since lint uses this to understand the value is a regex.
GOOGLE_COPYRIGHT_RE = r'^Copyright 20\d\d Google Inc. All Rights Reserved\.$'

# Updated regex expression to return match if: A- string contain years range or single year B- string contain Google LLC or Google Inc. C- string contain 'Rights Reserved' or 'rights reserved'
GOOGLE_COPYRIGHT_RE = r'^(?:Copyright 20\d\d Google|Copyright 20\d\d-20\d\d Google) (?:LLC|Inc). All (?:Rights Reserved|rights reserved)\.$'
ADOBE_COPYRIGHT_RE = (
u"^Copyright \u00a9 2014(?:, 20\d\d)? Adobe Systems Incorporated "
u"\(http://www.adobe.com/\)\.$")
Expand Down Expand Up @@ -126,6 +126,7 @@
'MONO': None,
'SYM2': 'Symbols2',
'MUSE': None,
'Mero': 'Meroitic',
}


Expand Down Expand Up @@ -281,7 +282,7 @@ def _original_parts(family_parts, subfamily_parts, no_style_linking=False):
'SemiBold': 'SemBd',
'ExtraBold': 'ExtBd',
'Black': 'Blk',
'Display': 'Disp',
'Display': 'Disp', #This will trigger error when performing family check. NotoSerifDisplay and NotoSansfDisplay added exceptions for those 2 fonts line 369
}

_VERY_SHORT_NAMES = {
Expand All @@ -305,31 +306,31 @@ def _original_parts(family_parts, subfamily_parts, no_style_linking=False):
# need it. If the name data changes this can break.
_SHORT_SCRIPTS = {
'Anatolian Hieroglyphs': 'AnatoHiero', # Hluw
'Pahawh Hmong': 'PahHmong', # Hmng
#'Pahawh Hmong': 'PahHmong', # Hmng This will trigger error for family check for this font. Not needed
'New Tai Lue': 'NewTaiLue', # Talu
'Syloti Nagri': 'SyloNagri', # Sylo
#'Syloti Nagri': 'SyloNagri', # Sylo This will trigger error for family check for this font. Not needed
'Imperial Aramaic': 'ImpAramaic', # Armi
'SignWriting': 'SignWrit', # Sgnw
'Warang Citi': 'WarangCiti', # Wara
'Canadian Aboriginal': 'CanAborig', # Cans
'Egyptian Hieroglyphs': 'EgyptHiero', # Egyp
'Mende Kikakui': 'MendKik', # Mend
#'Mende Kikakui': 'MendKik', # Mend This will trigger error for family check for this font. Not needed
'Old Persian': 'OldPersian', # Xpeo
'Old North Arabian': 'OldNorArab', # Narb
'Caucasian Albanian': 'CaucAlban', # Aghb
'Meroitic Hieroglyphs': 'MeroHiero', # Mero
'Meroitic Hieroglyphs': 'Meroitic', # Mero changed 'MeroHiero' to 'Meroitic'. MeroHiero not valid family name
'Meroitic Cursive': 'MeroCursiv', # Merc
'Inscriptional Pahlavi': 'InsPahlavi', # Phli
'Old South Arabian': 'OldSouArab', # Sarb
'Psalter Pahlavi': 'PsaPahlavi', # Phlp
'Meetei Mayek': 'MeetMayek', # Mtei
'Meetei Mayek': 'MeeteiMayek', # Mtei MeetMayek will trigger error changed to MeeteiMayek
'Hanifi Rohingya': 'HanifiRohg', # Rohg
'Sora Sompeng': 'SoraSomp', # Sora
#'Sora Sompeng': 'SoraSomp', # Sora This will trigger error for family check for this font. Not needed
'Inscriptional Parthian': 'InsParthi', # Prti
'Pau Cin Hau': 'PauCinHau', # Pauc
'Old Hungarian': 'OldHung', # Hung
'Masaram Gondi': 'MasaramGon', # Gonm
'Gunjala Gondi': 'GunjalaGon', # Gonj
#'Masaram Gondi': 'MasaramGon', # Gonm This will trigger error for family check for this font. Not needed
#'Gunjala Gondi': 'GunjalaGondi', # Gonj This will trigger error for family check for this font. Not needed
'Zanabazar Square': 'Zanabazar', # Zanb
'Medefaidrin': 'Medfaidrin', # Medf
}
Expand Down Expand Up @@ -364,8 +365,11 @@ def _name_with_style(parts, name_style):
return ' '.join(parts)
# preemtively shorten script names
short_parts = [_SHORT_SCRIPTS.get(n, n) for n in parts]
if name_style == 'short':
return ' '.join(_SHORT_NAMES.get(n, n) for n in short_parts)
if name_style == 'short':
if parts[2] == 'Display': #special case for fonts contain 'display' as part of the original font name (NotoSansDisplay,NotoSerifDisplay)
return ' '.join(parts)
else:
return ' '.join(_SHORT_NAMES.get(n, n) for n in short_parts)
name = ' '.join(_VERY_SHORT_NAMES.get(n, n) for n in short_parts)
if name_style != 'very short': # 'extra short'
name = name.replace(' ', '')
Expand Down Expand Up @@ -450,19 +454,25 @@ def _version_re(noto_font, phase):
hint_ext = ''
ttfautohint_tag = 'ttfautohint' if noto_font.is_hinted else ''

return r'^Version ([0-2])\.(\d{%d})%s(?:;.*%s.*)?$' % (
return r'^Version ([0-4])\.(\d{%d})%s(?:;.*%s.*)?$' % (
sub_len, hint_ext, ttfautohint_tag)


def _trademark(noto_font):
return '%s is a trademark of Google Inc.' % noto_font.family
#trademark check will use regex to match with both LLC or Inc.
def _trademark_re(noto_font):
GOOGLE_TRADEMARK_RE = r'^%s is a trademark of Google (?:LLC|Inc.)$' % noto_font.family
return GOOGLE_TRADEMARK_RE


def _manufacturer(noto_font):
if noto_font.manufacturer == 'Adobe':
return 'Adobe Systems Incorporated'
if noto_font.manufacturer == 'Monotype':
return 'Monotype Imaging Inc.'
if noto_font.manufacturer == 'Ek Type':
return 'Ek Type'
if noto_font.manufacturer == 'JamraPatel LLC':
return 'JamraPatel LLC'
if noto_font.manufacturer == 'Khmertype':
return 'Danh Hong'
if noto_font.manufacturer == 'Google':
Expand Down Expand Up @@ -500,6 +510,16 @@ def _manufacturer(noto_font):
}

def _designer(noto_font, phase):
if noto_font.manufacturer == 'Ek Type':
if noto_font.script in ['Gonm', 'Taml_Sup']:
return 'Ek Type & Mukund Gokhale'
else:
return 'Ek Type'
if noto_font.manufacturer == 'JamraPatel LLC':
if noto_font.script in ['Adlm']:
return 'Mark Jamra, Neil Patel'
else:
return 'Designed by JamraPatel LLC'
if noto_font.manufacturer == 'Adobe':
return '-'
if noto_font.manufacturer == 'Monotype':
Expand All @@ -510,11 +530,28 @@ def _designer(noto_font, phase):
return DESIGNER_STRINGS[designer_key]
if noto_font.family == 'Noto':
if noto_font.style == 'Serif' and noto_font.script in [
'Beng', 'Gujr', 'Knda', 'Mlym', 'Taml', 'Telu']:
return 'Indian Type Foundry'
if noto_font.script == 'Arab' and phase == 3:
return 'Nadine Chahine'
return 'Monotype Design Team'
'Beng', 'Gujr', 'Knda']:
return 'Juan Bruce, Universal Thirst, Indian Type Foundry and the Monotype Design Team.'
if noto_font.script in [
'Taml']:
return 'Indian Type Foundry, Tom Grace, and the Monotype Design Team'
if noto_font.script in [
'Telu', 'Knda', 'Guru']:
return 'Jelle Bosma - Monotype Design Team'
if phase == 3:
if noto_font.script == 'Tang':
return 'Julius Hui - Monotype Design Team'
if noto_font.script == 'Arab':
return 'Nadine Chahine - Monotype Design Team'
if noto_font.script == 'Deva':
return 'Universal Thirst, Indian Type Foundry and the Monotype Design Team'
if noto_font.script == 'Syrc':
return 'Patrick Giasson and the Monotype Design Team'
if noto_font.script == 'Mlym':
return 'Indian type Foundry, Jelle Bosma, Monotype Design Team'
if noto_font.script == 'Sora':
return 'Monotype Design Team. David Williams.'
return 'Monotype Design Team'
if noto_font.family in ['Arimo', 'Cousine', 'Tinos']:
return 'Steve Matteson'
raise ValueError('unknown family "%s"' % noto_font.family)
Expand All @@ -528,6 +565,10 @@ def _designer(noto_font, phase):
def _designer_url(noto_font):
if noto_font.manufacturer == 'Adobe':
return 'http://www.adobe.com/type/'
if noto_font.manufacturer == 'Ek Type':
return 'http://www.ektype.in'
if noto_font.manufacturer == 'JamraPatel LLC':
return 'https://www.jamra-patel.com'
if noto_font.manufacturer == 'Monotype':
return 'http://www.monotype.com/studio'
if noto_font.manufacturer == 'Khmertype':
Expand All @@ -546,16 +587,23 @@ def _description_re(noto_font, phase):
if phase < 3:
hint_prefix = 'Data %shinted.' % (
'' if noto_font.is_hinted else 'un')
if noto_font.manufacturer == 'Ek Type':
return '-'
if noto_font.manufacturer == 'JamraPatel LLC':
return '-'
else:
# In phase 3 no hint prefix at all regardless of hinted or unhinted.
hint_prefix = ''

designer = ''
if noto_font.manufacturer == 'Monotype':
if noto_font.family == 'Noto':
designer = 'Designed by Monotype design team.'
if hint_prefix:
hint_prefix += ' '
if noto_font.script == 'Sora':
designer = 'Designed by Monotype design team. David Williams.'
else:
designer = 'Designed by Monotype design team.'
if hint_prefix:
hint_prefix += ' '
else:
# Arimo, Tinos, and Cousine don't currently mention hinting in their
# descriptions, but they probably should.
Expand Down Expand Up @@ -625,7 +673,7 @@ def name_table_data(noto_font, family_to_name_info, phase):
version_re=_version_re(noto_font, phase),
postscript_name=_postscript_name(
family_parts, subfamily_parts, include_regular),
trademark=_trademark(noto_font),
trademark=_trademark_re(noto_font), # to use regex to match the trademark
manufacturer=_manufacturer(noto_font),
designer=_designer(noto_font, phase),
description_re=_description_re(noto_font, phase),
Expand Down
2 changes: 1 addition & 1 deletion nototools/unicode_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ def script_code(script_name):
# that we special-case
_HARD_CODED_HUMAN_READABLE_SCRIPT_NAMES = {
'Aran': 'Nastaliq', # not assigned
'Nkoo': 'N\'Ko',
'Nkoo': 'NKo',
'Phag': 'Phags-pa',
'Piqd': 'Klingon', # not assigned
'Zmth': 'Math', # not assigned
Expand Down
8 changes: 6 additions & 2 deletions third_party/ucd/PropertyValueAliases.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# PropertyValueAliases-12.0.0.txt
# Date: 2019-02-19, 05:01:57 GMT
# PropertyValueAliases-12.1.0.txt
# Date: 2019-03-10, 10:53:18 GMT
# © 2019 Unicode®, Inc.
# Unicode and the Unicode Logo are registered trademarks of Unicode, Inc. in the U.S. and other countries.
# For terms of use, see http://www.unicode.org/terms_of_use.html
Expand Down Expand Up @@ -87,6 +87,7 @@ age; 9.0 ; V9_0
age; 10.0 ; V10_0
age; 11.0 ; V11_0
age; 12.0 ; V12_0
age; 12.1 ; V12_1
age; NA ; Unassigned

# Alphabetic (Alpha)
Expand Down Expand Up @@ -1329,6 +1330,7 @@ sc ; Takr ; Takri
sc ; Tale ; Tai_Le
sc ; Talu ; New_Tai_Lue
sc ; Taml ; Tamil
sc ; Taml_Sup ; Tamil_Supplement
sc ; Tang ; Tangut
sc ; Tavt ; Tai_Viet
sc ; Telu ; Telugu
Expand All @@ -1342,6 +1344,8 @@ sc ; Ugar ; Ugaritic
sc ; Vaii ; Vai
sc ; Wara ; Warang_Citi
sc ; Wcho ; Wancho
sc ; Siyq ; Indic_Siyaq_Numbers
sc ; Manu ; Mayan_Numerals
sc ; Xpeo ; Old_Persian
sc ; Xsux ; Cuneiform
sc ; Yiii ; Yi
Expand Down