summaryrefslogtreecommitdiff
path: root/tex/context/base/font-jap.tex
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/font-jap.tex')
-rw-r--r--tex/context/base/font-jap.tex76
1 files changed, 76 insertions, 0 deletions
diff --git a/tex/context/base/font-jap.tex b/tex/context/base/font-jap.tex
new file mode 100644
index 000000000..4c84f1b88
--- /dev/null
+++ b/tex/context/base/font-jap.tex
@@ -0,0 +1,76 @@
+%D \module
+%D [ file=font-jap,
+%D version=2006.01.13,
+%D title=\CONTEXT\ Font Macros,
+%D subtitle=Japanese,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D suggestions=Wang Lei,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\writestatus{loading}{Context Font Macros / Japanese}
+
+\unprotect
+
+\newif\iftracejapanese
+
+\let\japaneseencoding\empty
+
+\def\setjapaneseencoding
+ {\getfontfileparameters\unicodestyle
+ \ifx\currentfontfileencoding\undefined \else
+ \let\japaneseencoding\currentfontfileencoding
+ \fi}
+
+\def\japaneseunicodescale {1.00}
+\def\japaneseunicodeheight {1.00}
+\def\japaneseunicodedepth {1.00}
+
+\setupunicodefont
+ [japanese]
+ [ \c!scale=\japaneseunicodescale,
+ \c!height=\japaneseunicodeheight,
+ \c!depth=\japaneseunicodedepth,
+ \c!conversion=\japanesenumber,
+ \c!commands=\setjapaneseencoding, % needed for digits
+ \c!command=\handlejapaneseunicodeglyph]
+
+\def\japanesenumber{\numbers}
+
+\def\handlejapaneseunicodeglyph
+ {\relax
+ \ifhmode\else\dontleavehmode\fi
+ \setunicodescale\japaneseunicodescale
+ \setunicodestrut\japaneseunicodeheight\japaneseunicodedepth
+ \iftracejapanese
+ \ruledhbox{\insertunicodeglyph}%
+ \else
+ \insertunicodeglyph
+ \fi
+ \allowbreak
+ \ignorespaces}
+
+\doifelse \currentregime {utf} {
+
+ % todo: typescripts
+
+ \definefontsynonym [JapaneseRegular] [uni-cybercjk-][encoding=j-uni]
+ \definefontsynonym [JapaneseSlanted] [uni-cybercjk-][encoding=j-uni]
+ \definefontsynonym [JapaneseItalic] [uni-cybercjk-][encoding=j-uni]
+ \definefontsynonym [JapaneseBold] [uni-cybercjk-][encoding=j-uni]
+ \definefontsynonym [JapaneseBoldSlanted][uni-cybercjk-][encoding=j-uni]
+ \definefontsynonym [JapaneseBoldItalic] [uni-cybercjk-][encoding=j-uni]
+
+ \loadmapfile[uni-cybercjk.map]
+
+ \defineunicodefont [Japanese] [Japanese] [japanese]
+
+} {
+ \writestatus{Japanese}{No fonts defined}
+}
+
+\protect \endinput