spogulis no
https://github.com/nextcloud/server.git
synced 2024-08-30 17:57:26 +02:00
![Daniel Calviño Sánchez](/assets/img/avatar_default.png)
Generated avatars as well as text file previews are rendered using the "core/fonts/NotoSans-Regular.ttf" font. The file was the standard hinted "NotoSans-Regular.ttf" file from https://www.google.com/get/noto/. However that file does not cover some non LGC (Latin, Greek, Cyrillic) scripts, like Arabic, Devanagari or Hebrew, to name a few. Markdown file previews also use "core/fonts/NotoSans-Bold.ttf", which is in the same situation as the regular one. Due to limitations in the TTF format it is not possible to provide a single file for each style that includes all Noto fonts. However, it is possible to add more scripts to the standard "NotoSans-Regular.ttf" and "NotoSans-Bold.ttf" files (although no CJK (Chinese, Japanese, Korean) glyph can be included due to the aforementioned limitations). This commit replaces the standard files with an extended version created using the Noto Tools. The build script (as well as a patch for the Noto Tools) is also included for reference and to be able to update the font files in the future if needed. Due to the additional scripts added the font files are now much larger, although this does not seem to increase the time spent rendering LGC scripts. Note that the file for the bold style still contains less scripts than the regular one, as not all scripts supported by Noto have a bold weight. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
231 rinda
6.2 KiB
Diff
231 rinda
6.2 KiB
Diff
diff --git a/nototools/merge_noto.py b/nototools/merge_noto.py
|
|
index 17c07ed..029845a 100755
|
|
--- a/nototools/merge_noto.py
|
|
+++ b/nototools/merge_noto.py
|
|
@@ -34,7 +34,7 @@ def make_puncless_font_name(script):
|
|
return make_font_name(script).replace(" ", "").replace("-", "")
|
|
|
|
|
|
-def make_font_file_name(script, weight, directory="individual/unhinted"):
|
|
+def make_font_file_name(script, weight, directory="individual/hinted"):
|
|
filename = "%s/%s-%s.ttf" % (directory, make_puncless_font_name(script), weight)
|
|
return filename
|
|
|
|
@@ -85,6 +85,11 @@ SCRIPT_TO_OPENTYPE_SCRIPT_TAG = {
|
|
"Cuneiform": "xsux",
|
|
"Cypriot": "cprt",
|
|
"Yi": "yi ",
|
|
+ "AnatolianHieroglyphs":"hluw",
|
|
+ "Bamum": "bamu",
|
|
+ "NewTaiLue": "talu",
|
|
+ "Tagbanwa": "tagb",
|
|
+ "Thaana": "thaa",
|
|
}
|
|
|
|
|
|
@@ -135,96 +140,129 @@ def add_gsub_to_font(fontfile):
|
|
|
|
def main():
|
|
merge_table = {
|
|
- "Historic": [
|
|
+ # Use a single file with all the fonts copied from merge_fonts.py.
|
|
+ "": [ # LGC,
|
|
+ "Adlam",
|
|
+ "AdlamUnjoined",
|
|
+ "AnatolianHieroglyphs",
|
|
+ "Arabic",
|
|
+ "ArabicUI",
|
|
+ "Armenian",
|
|
"Avestan",
|
|
- "Carian",
|
|
- "Egyptian Hieroglyphs",
|
|
- "Imperial Aramaic",
|
|
- "Pahlavi", # Should be 'Inscriptional Pahlavi',
|
|
- "Parthian", # Should be 'Inscriptional Parthian',
|
|
- "Linear B",
|
|
- "Lycian",
|
|
- "Lydian",
|
|
- "Mandaic",
|
|
- "Old Persian",
|
|
- "Old South Arabian",
|
|
- "Old Turkic",
|
|
- "Osmanya",
|
|
- "Phags-Pa",
|
|
- "Phoenician",
|
|
- "Samaritan",
|
|
- "Sumero-Akkadian Cuneiform",
|
|
- "Ugaritic",
|
|
- ],
|
|
- "South Asian": [
|
|
- "Devanagari",
|
|
+ "Balinese",
|
|
+ "Bamum",
|
|
+ "Batak",
|
|
"Bengali",
|
|
- "Gurmukhi",
|
|
- "Gujarati",
|
|
- "Oriya",
|
|
- "Tamil",
|
|
- "Telugu",
|
|
- "Kannada",
|
|
- "Malayalam",
|
|
- "Sinhala",
|
|
- "Thaana",
|
|
+ "BengaliUI",
|
|
"Brahmi",
|
|
- "Kaithi",
|
|
- "Kharoshthi", # Move to Historic?
|
|
- "Lepcha",
|
|
- "Limbu",
|
|
- "Meetei Mayek",
|
|
- "Ol Chiki",
|
|
- "Saurashtra",
|
|
- "Syloti Nagri",
|
|
- ],
|
|
- "Southeast Asian": [
|
|
- "Thai",
|
|
- "Lao",
|
|
- "Khmer",
|
|
- "Batak",
|
|
"Buginese",
|
|
"Buhid",
|
|
+ "CJKjp-Regular.otf",
|
|
+ "CJKkr-Regular.otf",
|
|
+ "CJKsc-Regular.otf",
|
|
+ "CJKtc-Regular.otf",
|
|
+ "CanadianAboriginal",
|
|
+ "Carian",
|
|
+ "Chakma",
|
|
"Cham",
|
|
- "Hanunoo",
|
|
- "Javanese",
|
|
- "Kayah Li",
|
|
- "New Tai Lue",
|
|
- "Rejang",
|
|
- "Sundanese",
|
|
- "Tagalog",
|
|
- "Tagbanwa",
|
|
- "Tai Le",
|
|
- "Tai Tham",
|
|
- "Tai Viet",
|
|
- ],
|
|
- "": [ # LGC,
|
|
- "Armenian",
|
|
- "Bamum",
|
|
- "Canadian Aboriginal",
|
|
"Cherokee",
|
|
"Coptic",
|
|
- "Cypriot Syllabary",
|
|
+ "Cuneiform",
|
|
+ "Cypriot",
|
|
"Deseret",
|
|
+ "Devanagari",
|
|
+ "DevanagariUI",
|
|
+ "Display",
|
|
+ "EgyptianHieroglyphs",
|
|
"Ethiopic",
|
|
"Georgian",
|
|
"Glagolitic",
|
|
"Gothic",
|
|
+ "Gujarati",
|
|
+ "GujaratiUI",
|
|
+ "Gurmukhi",
|
|
+ "GurmukhiUI",
|
|
+ "Hanunoo",
|
|
"Hebrew",
|
|
+ "ImperialAramaic",
|
|
+ "InscriptionalPahlavi",
|
|
+ "InscriptionalParthian",
|
|
+ "Javanese",
|
|
+ "Kaithi",
|
|
+ "Kannada",
|
|
+ "KannadaUI",
|
|
+ "KayahLi",
|
|
+ "Kharoshthi",
|
|
+ "Khmer",
|
|
+ "KhmerUI",
|
|
+ "Lao",
|
|
+ "LaoUI",
|
|
+ "Lepcha",
|
|
+ "Limbu",
|
|
+ "LinearB",
|
|
"Lisu",
|
|
+ "Lycian",
|
|
+ "Lydian",
|
|
+ "Malayalam",
|
|
+ "MalayalamUI",
|
|
+ "Mandaic",
|
|
+ "MeeteiMayek",
|
|
+ #"NotoSansMongolian",
|
|
+ "Mono",
|
|
+ "MonoCJKjp-Regular.otf",
|
|
+ "MonoCJKkr-Regular.otf",
|
|
+ "MonoCJKsc-Regular.otf",
|
|
+ "MonoCJKtc-Regular.otf",
|
|
+ "Myanmar",
|
|
+ "MyanmarUI",
|
|
"NKo",
|
|
+ "NewTaiLue",
|
|
"Ogham",
|
|
- "Old Italic",
|
|
+ "OlChiki",
|
|
+ "OldItalic",
|
|
+ "OldPersian",
|
|
+ "OldSouthArabian",
|
|
+ "OldTurkic",
|
|
+ "Oriya",
|
|
+ "OriyaUI",
|
|
+ "Osage",
|
|
+ "Osmanya",
|
|
+ "PhagsPa",
|
|
+ "Phoenician",
|
|
+ "Rejang",
|
|
"Runic",
|
|
+ "Samaritan",
|
|
+ "Saurashtra",
|
|
"Shavian",
|
|
+ "Sinhala",
|
|
+ "SinhalaUI",
|
|
+ "Sundanese",
|
|
+ "SylotiNagri",
|
|
+ "Symbols",
|
|
+ "Symbols2",
|
|
+ "SyriacEastern",
|
|
+ "SyriacEstrangela",
|
|
+ "SyriacWestern",
|
|
+ "Tagalog",
|
|
+ "Tagbanwa",
|
|
+ "TaiLe",
|
|
+ "TaiTham",
|
|
+ "TaiViet",
|
|
+ "Tamil",
|
|
+ "TamilUI",
|
|
+ "Telugu",
|
|
+ "TeluguUI",
|
|
+ "Thaana",
|
|
+ "Thai",
|
|
+ "ThaiUI",
|
|
+ "Tibetan",
|
|
"Tifinagh",
|
|
+ "Ugaritic",
|
|
"Vai",
|
|
+ "Yi",
|
|
],
|
|
}
|
|
|
|
- add_ui_alternative(merge_table, "South Asian")
|
|
- add_ui_alternative(merge_table, "Southeast Asian")
|
|
-
|
|
for merge_target in sorted(merge_table):
|
|
for weight in ["Regular", "Bold"]:
|
|
merger = merge.Merger()
|
|
@@ -261,7 +299,7 @@ def main():
|
|
name_record.string = name.encode("UTF-16BE")
|
|
|
|
font.save(
|
|
- make_font_file_name(merge_target, weight, directory="combined/unhinted")
|
|
+ make_font_file_name(merge_target, weight, directory="combined/hinted")
|
|
)
|
|
|
|
|