Skip to content

Commit

Permalink
0.6.1: fix middle dot, RP variant
Browse files Browse the repository at this point in the history
  • Loading branch information
CyanoHao committed Aug 21, 2019
1 parent d8224ca commit 73c0e73
Show file tree
Hide file tree
Showing 6 changed files with 834 additions and 13 deletions.
782 changes: 779 additions & 3 deletions Makefile

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion README-Hans.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

[最新版](https://github.com/nowar-fonts/Nowar-Sans/releases)

有爱黑体有 4 种字重和 8 种地区变体。
有爱黑体有 4 种字重和 9 种地区变体。

### 字重

Expand Down Expand Up @@ -51,9 +51,16 @@ GB 变体完全覆盖 GB 18030-2000 标准,移除了谚文支持,文件大
| -- | ----------------- | ------------ | ------ |
| GB | 中国大陆字形(UI)| 中国大陆字形 | 不可用 |

RP 变体针对中文 RP 服务器。RP 变体把 `` 显示为 `·`(即把 “伊利丹丶怒风” 显示为 “伊利丹·怒风”),旨在为 RP 玩家提供一致的体验。

| | 西文 | 中文 | 韩国语 |
| -- | --------------------- | ----------------- | ------ |
| RP | 中国大陆字形(UI,RP)| 中国大陆字形(RP)| 不可用 |

* 西文:英语、西班牙语(拉丁美洲)、葡萄牙语、德语、西班牙语(欧洲)、法语、意大利语、俄语。
* 东亚语言:简体中文、繁体中文、韩国语。
* UI:中西文共用的标点视作西文标点;半角 CJK 标点;比例假名。
* RP:``(U+4E36)重映射为 `·`(U+00B7,MIDDLE DOT)。

### SharedMedia 字体包

Expand Down
9 changes: 8 additions & 1 deletion README-Hant.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

[最新發佈](https://github.com/nowar-fonts/Nowar-Sans/releases)

有愛黑體有 4 種字重和 8 種地區變體。
有愛黑體有 4 種字重和 9 種地區變體。

### 字重

Expand Down Expand Up @@ -51,9 +51,16 @@ GB 變體完全覆蓋 GB 18030-2000 標準,移除了諺文支援,文件大
| -- | ----------------- | ------------ | ------ |
| GB | 中國大陸字形(UI)| 中國大陸字形 | 不適用 |

RP 變體針對中文 RP 伺服器。RP 變體把 `` 顯示為 ``(即把 “伊利丹丶怒風” 顯示為 “伊利丹‧怒風”),旨在為 RP 玩家提供一致的體驗。

| | 西文 | 中文 | 韩国语 |
| -- | --------------------- | ----------------- | ------ |
| RP | 中國大陸字形(UI,RP)| 中國大陸字形(RP)| 不適用 |

* 西文:英語、西班牙語(拉丁美洲)、葡萄牙語、德語、西班牙語(歐洲)、法語、義大利語、俄語。
* 東亞語言:簡體中文、繁體中文、韓國語。
* UI:中西文共用的標點視作西文標點;半形 CJK 標點;比例假名。
* RP:``(U+4E36)重對映為 `·`(U+00B7,MIDDLE DOT;或 U+2027,HYPHENATION POINT)。

### SharedMedia 字型包

Expand Down
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This is Nowar Sans, font packs for _World of Warcraft_ and _WoW Classic_ that su

[Latest release](https://github.com/nowar-fonts/Nowar-Sans/releases)

Nowar Sans is shipped in 4 weights and 8 regional variants.
Nowar Sans is shipped in 4 weights and 9 regional variants.

### Weights

Expand Down Expand Up @@ -45,15 +45,22 @@ CL and OSF are “classical variants”, which have full character set support w
| CL | Classical (UI) | Classical |
| OSF | Classical (UI, Oldstyle Figure) | Classical |

GB is a special offer that supports a superset of Chinese national standard GB 18030-2000. The GB releases are much smaller than standard releases by removing Hangul support.
GB is a variant that supports a superset of Chinese national standard GB 18030-2000. The GB distributions aim at smaller size by removing Hangul support.

| | European | 中文 | 한국어 |
| -- | ------------------- | -------------- | ------ |
| GB | Mainland China (UI) | Mainland China | N/A |

RP is a special offer for Chinese RP realms. The RP distributions aim at unified experience for roleplaying players by mapping `` to the same glyph as `·`, allowing character names like “伊利丹丶怒风” to be shown as “伊利丹·怒风”.

| | European | 中文 | 한국어 |
| -- | ----------------------- | ------------------- | ------ |
| RP | Mainland China (UI, RP) | Mainland China (RP) | N/A |

* European: English, Español (AL), Português, Deutsch, Español (EU), Français, Italiano, and Русский.
* East Asian: 简体中文, 繁體中文, and 한국어.
* UI: Ambiguous punctations are treated as Western; CJK puctations are half-width; Kana are proportional.
* RP: `` (U+4E36) is mapped to the same glyph as `·` (U+00B7, MIDDLE DOT).

### SharedMedia Font Provider

Expand Down
12 changes: 10 additions & 2 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from types import SimpleNamespace as Namespace

class Config:
version = "0.6.0"
version = "0.6.1"
vendor = "Nowar Typeface"
vendorId = "NOWR"
vendorUrl = "https://github.com/nowar-fonts"
Expand All @@ -16,7 +16,7 @@ class Config:
licenseUrl = "https://scripts.sil.org/OFL"

fontPackWeight = [ 300, 400, 500, 700 ]
fontPackRegion = [ "CN", "TW", "HK", "JP", "KR", "CL", "OSF", "GB" ]
fontPackRegion = [ "CN", "TW", "HK", "JP", "KR", "CL", "OSF", "GB", "RP" ]

fontProviderWeight = [ 300, 400, 500, 700 ]
fontProviderWidth = [ 3, 5, 7 ]
Expand Down Expand Up @@ -147,6 +147,12 @@ class Config:
"Hant": "GB",
"ko": None,
},
"RP": {
"Latn": "RP",
"Hans": "RP",
"Hant": "RP",
"ko": None,
},
}

# map orthography to source file
Expand All @@ -159,6 +165,7 @@ class Config:
"CL": "SourceHanSansK",
"OSF": "SourceHanSansK",
"GB": "SourceHanSansCN",
"RP": "SourceHanSansCN",
}

regionNameMap = {
Expand All @@ -170,6 +177,7 @@ class Config:
"CL": "Classical",
"OSF": "Oldstyle",
"GB": "GB18030",
"RP": "Roleplaying",
}

# set OS/2 encoding to make Windows show font icon in proper language
Expand Down
24 changes: 20 additions & 4 deletions merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,16 +209,32 @@ def NameFont(param, font):
if param.family in [ "Sans", "UI", "WarcraftSans", "WarcraftUI" ]:
with open("shs/{}.otd".format(configure.GenerateFilename(dep['CJK'])), 'rb') as asianFile:
asianFont = json.loads(asianFile.read().decode('UTF-8', errors = 'replace'))

# pre-apply `palt` in UI family
if param.family in [ "UI", "WarcraftUI" ]:
if "UI" in param.family:
ApplyPalt(asianFont)

MergeBelow(baseFont, asianFont)
# use CJK quotes, em-dash and ellipsis in non-UI family
if param.family not in [ "UI", "WarcraftUI" ]:
for u in [0x2014, 0x2018, 0x2019, 0x201C, 0x201D, 0x2026]:

# use CJK middle dots, quotes, em-dash and ellipsis in non-UI family
if "UI" not in param.family:
for u in [
0x00B7, # MIDDLE DOT
0x2014, # EM DASH
0x2018, # LEFT SINGLE QUOTATION MARK
0x2019, # RIGHT SINGLE QUOTATION MARK
0x201C, # LEFT DOUBLE QUOTATION MARK
0x201D, # RIGHT DOUBLE QUOTATION MARK
0x2026, # HORIZONTAL ELLIPSIS
0x2027, # HYPHENATION POINT
]:
if str(u) in asianFont['cmap']:
baseFont['glyf'][baseFont['cmap'][str(u)]] = asianFont['glyf'][asianFont['cmap'][str(u)]]

# remap `丶` to `·` in RP variant
if param.region == "RP":
baseFont['cmap'][str(ord('丶'))] = baseFont['cmap'][str(ord('·'))]

outStr = json.dumps(baseFont, ensure_ascii=False)
with codecs.open("nowar/{}.otd".format(configure.GenerateFilename(param)), 'w', 'UTF-8') as outFile:
outFile.write(outStr)

0 comments on commit 73c0e73

Please sign in to comment.