summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex/luatexko/luatexko.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2014-06-19 20:24:23 +0000
committerKarl Berry <karl@freefriends.org>2014-06-19 20:24:23 +0000
commit2ab598832d6c69a43f55cc0fce844b2464d1b339 (patch)
tree43a6ed23345f78f1b5e252df0d84e277a83f5bc7 /Master/texmf-dist/tex/luatex/luatexko/luatexko.sty
parentc46f74d4c2a102cc794be871c46f42519bf6da8a (diff)
luatexko (19jun14)
git-svn-id: svn://tug.org/texlive/trunk@34320 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/luatex/luatexko/luatexko.sty')
-rw-r--r--Master/texmf-dist/tex/luatex/luatexko/luatexko.sty101
1 files changed, 54 insertions, 47 deletions
diff --git a/Master/texmf-dist/tex/luatex/luatexko/luatexko.sty b/Master/texmf-dist/tex/luatex/luatexko/luatexko.sty
index a34b53bae9a..d7df0c2581c 100644
--- a/Master/texmf-dist/tex/luatex/luatexko/luatexko.sty
+++ b/Master/texmf-dist/tex/luatex/luatexko/luatexko.sty
@@ -22,7 +22,7 @@
\expandafter\endinput
\fi
-\ProvidesPackage{luatexko}[2014/05/11 v1.5 Typesetting Korean with LuaLaTeX]
+\ProvidesPackage{luatexko}[2014/06/17 v1.6 Typesetting Korean with LuaLaTeX]
%% package options
\newif\if@hangul
@@ -38,7 +38,7 @@
\if@luatexko@loadfontspec
%% euenc redefines \f@size by \DeclareErrorFont. sigh
\let\luatexko@f@size\f@size
- \RequirePackage{fontspec}
+ \RequirePackage{fontspec}[2014/05/25]
\let\f@size\luatexko@f@size
\fi
@@ -51,6 +51,10 @@
\newfontfeature{InterLatinCJK}{interlatincjk=#1}
\newfontfeature{PunctRaise}{punctraise=#1}
\newfontfeature{CharRaise}{charraise=#1}
+ \newfontfeature{NoEmbed}{embedding=no}
+ \aliasfontfeature{NoEmbed}{NoEmbedding}
+ \newfontfeature{protrusion}{protrusion=#1}
+ \newfontfeature{expansion}{expansion=#1}
\ExplSyntaxOn
\DeclareDocumentCommand \newhangulfontfeature {mmmm}
{
@@ -58,8 +62,7 @@
{
#1 .code:n =
{
- \fontspec_update_featstr:n {#2=##1}
- #4
+ \keys_set:nn { fontspec } { #2 = {##1} } #4
},
#1 .default:n = {#3}
}
@@ -68,10 +71,20 @@
{\aftergroup\pdfprotrudechars\aftergroup\tw@}
\newhangulfontfeature{Expansion}{expansion}{default}
{\aftergroup\pdfadjustspacing\aftergroup\tw@}
+ %% default font features
+ \cs_set_eq:NN \defaulthangulfontfeatures \defaultfontfeatures
+ \cs_set_eq:NN \defaulthanjafontfeatures \defaultfontfeatures
+ \cs_set_eq:NN \defaultfallbackfontfeatures \defaultfontfeatures
+ \defaultfontfeatures
+ [
+ \serifhangul@font, \serifhanja@font, \seriffallback@font,
+ \sanshangul@font, \sanshanja@font, \sansfallback@font,
+ ]
+ {Ligatures=TeX}
%% macros for Korean fonts
- \DeclareDocumentCommand \setmainhangulfont { O{} m }
+ \DeclareDocumentCommand \setmainhangulfont { O{} m O{} }
{
- \newfontfamily \serifhangul@font [#1] {#2}
+ \newfontfamily \serifhangul@font [#1,#3] {#2}
\str_if_eq_x:nnT \familydefault \rmdefault
{
\cs_set_eq:NN \hangul@font \serifhangul@font
@@ -79,9 +92,9 @@
}
\ignorespaces
}
- \DeclareDocumentCommand \setmainhanjafont { O{} m }
+ \DeclareDocumentCommand \setmainhanjafont { O{} m O{} }
{
- \newfontfamily \serifhanja@font [#1] {#2}
+ \newfontfamily \serifhanja@font [#1,#3] {#2}
\str_if_eq_x:nnT \familydefault \rmdefault
{
\cs_set_eq:NN \hanja@font \serifhanja@font
@@ -89,9 +102,9 @@
}
\ignorespaces
}
- \DeclareDocumentCommand \setmainfallbackfont { O{} m }
+ \DeclareDocumentCommand \setmainfallbackfont { O{} m O{} }
{
- \newfontfamily \seriffallback@font [#1] {#2}
+ \newfontfamily \seriffallback@font [#1,#3] {#2}
\str_if_eq_x:nnT \familydefault \rmdefault
{
\cs_set_eq:NN \fallback@font \seriffallback@font
@@ -99,9 +112,9 @@
}
\ignorespaces
}
- \DeclareDocumentCommand \setsanshangulfont { O{} m }
+ \DeclareDocumentCommand \setsanshangulfont { O{} m O{} }
{
- \newfontfamily \sanshangul@font [#1] {#2}
+ \newfontfamily \sanshangul@font [#1,#3] {#2}
\str_if_eq_x:nnT \familydefault \sfdefault
{
\cs_set_eq:NN \hangul@font \sanshangul@font
@@ -109,9 +122,9 @@
}
\ignorespaces
}
- \DeclareDocumentCommand \setsanshanjafont { O{} m }
+ \DeclareDocumentCommand \setsanshanjafont { O{} m O{} }
{
- \newfontfamily \sanshanja@font [#1] {#2}
+ \newfontfamily \sanshanja@font [#1,#3] {#2}
\str_if_eq_x:nnT \familydefault \sfdefault
{
\cs_set_eq:NN \hanja@font \sanshanja@font
@@ -119,9 +132,9 @@
}
\ignorespaces
}
- \DeclareDocumentCommand \setsansfallbackfont { O{} m }
+ \DeclareDocumentCommand \setsansfallbackfont { O{} m O{} }
{
- \newfontfamily \sansfallback@font [#1] {#2}
+ \newfontfamily \sansfallback@font [#1,#3] {#2}
\str_if_eq_x:nnT \familydefault \sfdefault
{
\cs_set_eq:NN \fallback@font \sansfallback@font
@@ -129,9 +142,9 @@
}
\ignorespaces
}
- \DeclareDocumentCommand \setmonohangulfont { O{} m }
+ \DeclareDocumentCommand \setmonohangulfont { O{} m O{} }
{
- \newfontfamily \monohangul@font [#1] {#2}
+ \newfontfamily \monohangul@font [#1,#3] {#2}
\str_if_eq_x:nnT \familydefault \ttdefault
{
\cs_set_eq:NN \hangul@font \monohangul@font
@@ -139,9 +152,9 @@
}
\ignorespaces
}
- \DeclareDocumentCommand \setmonohanjafont { O{} m }
+ \DeclareDocumentCommand \setmonohanjafont { O{} m O{} }
{
- \newfontfamily \monohanja@font [#1] {#2}
+ \newfontfamily \monohanja@font [#1,#3] {#2}
\str_if_eq_x:nnT \familydefault \ttdefault
{
\cs_set_eq:NN \hanja@font \monohanja@font
@@ -149,9 +162,9 @@
}
\ignorespaces
}
- \DeclareDocumentCommand \setmonofallbackfont { O{} m }
+ \DeclareDocumentCommand \setmonofallbackfont { O{} m O{} }
{
- \newfontfamily \monofallback@font [#1] {#2}
+ \newfontfamily \monofallback@font [#1,#3] {#2}
\str_if_eq_x:nnT \familydefault \ttdefault
{
\cs_set_eq:NN \fallback@font \monofallback@font
@@ -159,30 +172,27 @@
}
\ignorespaces
}
- \DeclareDocumentCommand \newhangulfontfamily { m O{} m }
+ \DeclareDocumentCommand \newhangulfontfamily { m O{} m O{} }
{
- \exp_after:wN \newfontfamily
- \cs:w luatexkofont@ \token_to_str:N #1 \cs_end: [#2] {#3}
+ \exp_args:Nc \newfontfamily { luatexkofont@ \token_to_str:N #1 } [#2,#4] {#3}
\DeclareRobustCommand #1
{
\cs_set_eq:Nc \hangul@font { luatexkofont@ \token_to_str:N #1 }
\luatexko@hangul@selectfont
}
}
- \DeclareDocumentCommand \newhanjafontfamily { m O{} m }
+ \DeclareDocumentCommand \newhanjafontfamily { m O{} m O{} }
{
- \exp_after:wN \newfontfamily
- \cs:w luatexkofont@ \token_to_str:N #1 \cs_end: [#2] {#3}
+ \exp_args:Nc \newfontfamily { luatexkofont@ \token_to_str:N #1 } [#2,#4] {#3}
\DeclareRobustCommand #1
{
\cs_set_eq:Nc \hanja@font { luatexkofont@ \token_to_str:N #1 }
\luatexko@hanja@selectfont
}
}
- \DeclareDocumentCommand \newfallbackfontfamily { m O{} m }
+ \DeclareDocumentCommand \newfallbackfontfamily { m O{} m O{} }
{
- \exp_after:wN \newfontfamily
- \cs:w luatexkofont@ \token_to_str:N #1 \cs_end: [#2] {#3}
+ \exp_args:Nc \newfontfamily { luatexkofont@ \token_to_str:N #1 } [#2,#4] {#3}
\DeclareRobustCommand #1
{
\cs_set_eq:Nc \fallback@font { luatexkofont@ \token_to_str:N #1 }
@@ -191,51 +201,48 @@
}
\DeclareDocumentCommand \newhangulfontface { m O{} m }
{
- \exp_after:wN \newfontface
- \cs:w luatexkofont@ \token_to_str:N #1 \cs_end: [#2] {#3}
+ \exp_args:Nc \newfontface { luatexkofont@ \token_to_str:N #1 } [#2] {#3}
\DeclareRobustCommand #1
{
\cs_set_eq:Nc \hangul@font { luatexkofont@ \token_to_str:N #1 }
\luatexko@hangul@selectfont
}
}
- \DeclareDocumentCommand \newhanjafontface { m O{} m }
+ \DeclareDocumentCommand \newhanjafontface { m O{} m O{} }
{
- \exp_after:wN \newfontface
- \cs:w luatexkofont@ \token_to_str:N #1 \cs_end: [#2] {#3}
+ \exp_args:Nc \newfontface { luatexkofont@ \token_to_str:N #1 } [#2,#4] {#3}
\DeclareRobustCommand #1
{
\cs_set_eq:Nc \hanja@font { luatexkofont@ \token_to_str:N #1 }
\luatexko@hanja@selectfont
}
}
- \DeclareDocumentCommand \newfallbackfontface { m O{} m }
+ \DeclareDocumentCommand \newfallbackfontface { m O{} m O{} }
{
- \exp_after:wN \newfontface
- \cs:w luatexkofont@ \token_to_str:N #1 \cs_end: [#2] {#3}
+ \exp_args:Nc \newfontface { luatexkofont@ \token_to_str:N #1 } [#2,#4] {#3}
\DeclareRobustCommand #1
{
\cs_set_eq:Nc \fallback@font { luatexkofont@ \token_to_str:N #1 }
\luatexko@fallback@selectfont
}
}
- \DeclareDocumentCommand \hangulfontspec { O{} m }
+ \DeclareDocumentCommand \hangulfontspec { O{} m O{} }
{
- \newfontfamily \hangul@font [#1] {#2}
+ \newfontfamily \hangul@font [#1,#3] {#2}
\luatexko@hangul@selectfont
\ignorespaces
}
\cs_set_eq:NN \adhochangulfont \hangulfontspec
- \DeclareDocumentCommand \hanjafontspec { O{} m }
+ \DeclareDocumentCommand \hanjafontspec { O{} m O{} }
{
- \newfontfamily \hanja@font [#1] {#2}
+ \newfontfamily \hanja@font [#1,#3] {#2}
\luatexko@hanja@selectfont
\ignorespaces
}
\cs_set_eq:NN \adhochanjafont \hanjafontspec
- \DeclareDocumentCommand \fallbackfontspec { O{} m }
+ \DeclareDocumentCommand \fallbackfontspec { O{} m O{} }
{
- \newfontfamily \fallback@font [#1] {#2}
+ \newfontfamily \fallback@font [#1,#3] {#2}
\luatexko@fallback@selectfont
\ignorespaces
}
@@ -292,9 +299,9 @@
}
\cs_set_eq:NN \addfallbackfontfeatures \addfallbackfontfeature
% hangul math font command
- \DeclareDocumentCommand \setmathhangulfont { O{} m }
+ \DeclareDocumentCommand \setmathhangulfont { O{} m O{} }
{
- \fontspec_set_family:Nnn \luatexko@math@hangul@family {#1} {#2}
+ \fontspec_set_family:Nnn \luatexko@math@hangul@family {#1,#3} {#2}
}
\ExplSyntaxOff
\fi