Cscott has uploaded a new change for review.
https://gerrit.wikimedia.org/r/163085
Change subject: Support Simplified and Traditional Chinese scripts.
......................................................................
Support Simplified and Traditional Chinese scripts.
This fixes the "Command \chinesefont already defined." crashers.
Change-Id: I8bc6662e1ec207cf496f062ee7cc0525bcb66276
---
M lib/index.js
M lib/polyglossia.js
A tex/gloss-hanp.ldf
R tex/gloss-hans.ldf
C tex/gloss-hant.ldf
5 files changed, 26 insertions(+), 10 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Collection/OfflineContentGenerator/latex_renderer
refs/changes/85/163085/1
diff --git a/lib/index.js b/lib/index.js
index a78de80..d491b7f 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -56,7 +56,8 @@
// from ttf-farsiweb
'farsi': { name: 'Nazli' },
// from fonts-arphic-uming, fonts-arphic-ukai, fonts-droid
- 'chinese': { cjk:true, name: 'AR PL UMing CN', opts: 'BoldFont=Droid
Sans Fallback,ItalicFont=AR PL UKai CN,Language=Chinese
Simplified,CJKShape=Simplified' },
+ 'hans': { cjk:true, name: 'AR PL UMing CN', opts: 'BoldFont=Droid Sans
Fallback,ItalicFont=AR PL UKai CN,Language=Chinese
Simplified,CJKShape=Simplified' },
+ 'hant': { cjk:true, name: 'AR PL UMing CN', opts: 'BoldFont=Droid Sans
Fallback,ItalicFont=AR PL UKai CN,Language=Chinese
Traditional,CJKShape=Traditional' },
// from texlive-lang-cjk, fonts-droid
'japanese': { cjk:true, name: 'IPAexMincho', opts: 'BoldFont=Droid Sans
Fallback,AutoFakeSlant=0.2' },
// from fonts-baekmuk
diff --git a/lib/polyglossia.js b/lib/polyglossia.js
index 0ec7de5..6e60e1c 100644
--- a/lib/polyglossia.js
+++ b/lib/polyglossia.js
@@ -7,7 +7,9 @@
armenian: { script: 'Armenian' },
bengali: { script: 'Bengali' },
bulgarian: { script: 'Cyrillic' },
- chinese: { script: 'CJK' },
+ hans: { script: 'CJK' },
+ hant: { script: 'CJK' },
+ hanp: { script: 'Latin' },
coptic: { script: 'Coptic' },
divehi: { dir: 'rtl', script: 'Thaana' },
farsi: { dir: 'rtl', script: 'Arabic' },
@@ -121,7 +123,9 @@
// extra polyglossia definitions included in tex/ directory
ja: { lang: 'japanese' },
// ja-Hani = japanese written in Kanji
- zh: { lang: 'chinese' },
+ 'zh-Hans': { lang: 'hans' },
+ 'zh-Hant': { lang: 'hant' },
+ 'zh-Latn-pinyin': { lang: 'hanp' }, // made up thing
ko: { lang: 'korean' }
};
diff --git a/tex/gloss-hanp.ldf b/tex/gloss-hanp.ldf
new file mode 100644
index 0000000..47c88f1
--- /dev/null
+++ b/tex/gloss-hanp.ldf
@@ -0,0 +1,11 @@
+\ProvidesFile{gloss-hans.ldf}[polyglossia: module for chinese written in
pinyin]
+
+\PolyglossiaSetup{hanp}{%
+ % look in
/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty for these,
\newfontscript
+ script=Latin,
+ scripttag=latn,
+ % XXX this is the \newfontlanguage command from fontspec-xetex.sty
+ langtag=ZHP,
+ hyphennames={nohyphenation},
+ fontsetup=true
+}
diff --git a/tex/gloss-chinese.ldf b/tex/gloss-hans.ldf
similarity index 70%
rename from tex/gloss-chinese.ldf
rename to tex/gloss-hans.ldf
index ad6fd5a..5d51222 100644
--- a/tex/gloss-chinese.ldf
+++ b/tex/gloss-hans.ldf
@@ -1,10 +1,10 @@
-\ProvidesFile{gloss-chinese.ldf}[polyglossia: module for chinese]
+\ProvidesFile{gloss-hans.ldf}[polyglossia: module for simplified chinese]
\RequirePackage{xeCJK}
-\PolyglossiaSetup{chinese}{%
+\PolyglossiaSetup{hans}{%
% look in
/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty for these,
\newfontscript
script=CJK,
- %scripttag=hani, XXX
+ scripttag=hani,
% XXX this is the \newfontlanguage command from fontspec-xetex.sty
langtag=ZHS,
hyphennames={nohyphenation},
diff --git a/tex/gloss-chinese.ldf b/tex/gloss-hant.ldf
similarity index 66%
copy from tex/gloss-chinese.ldf
copy to tex/gloss-hant.ldf
index ad6fd5a..8d6d7e2 100644
--- a/tex/gloss-chinese.ldf
+++ b/tex/gloss-hant.ldf
@@ -1,12 +1,12 @@
-\ProvidesFile{gloss-chinese.ldf}[polyglossia: module for chinese]
+\ProvidesFile{gloss-hant.ldf}[polyglossia: module for traditional chinese]
\RequirePackage{xeCJK}
-\PolyglossiaSetup{chinese}{%
+\PolyglossiaSetup{hant}{%
% look in
/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty for these,
\newfontscript
script=CJK,
- %scripttag=hani, XXX
+ scripttag=hani,
% XXX this is the \newfontlanguage command from fontspec-xetex.sty
- langtag=ZHS,
+ langtag=ZHT,
hyphennames={nohyphenation},
fontsetup=true
}
--
To view, visit https://gerrit.wikimedia.org/r/163085
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8bc6662e1ec207cf496f062ee7cc0525bcb66276
Gerrit-PatchSet: 1
Gerrit-Project:
mediawiki/extensions/Collection/OfflineContentGenerator/latex_renderer
Gerrit-Branch: master
Gerrit-Owner: Cscott <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits