diff options
author | Karl Berry <karl@freefriends.org> | 2013-12-06 22:14:25 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-12-06 22:14:25 +0000 |
commit | 7e784ae2dff9b04aa5830bc1c60753ad9beee4b9 (patch) | |
tree | 80172c916282fd841d85e583fad6a4a6457bebc6 /Master/texmf-dist/tex/luatex/luatexko/luatexko.sty | |
parent | 12667237913177a3776303787aaea92ded17cdd0 (diff) |
luatexko (6dec13)
git-svn-id: svn://tug.org/texlive/trunk@32343 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.sty | 62 |
1 files changed, 52 insertions, 10 deletions
diff --git a/Master/texmf-dist/tex/luatex/luatexko/luatexko.sty b/Master/texmf-dist/tex/luatex/luatexko/luatexko.sty index f419146c580..454fd857e1c 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}[2013/07/03 v1.2 Typesetting Korean with LuaLaTeX] +\ProvidesPackage{luatexko}[2013/11/22 v1.3 Typesetting Korean with LuaLaTeX] \RequirePackage{fontspec} \RequirePackage{luatexko-core} @@ -34,11 +34,11 @@ \fontspec_define_font_feature:n {#1} \keys_define:nn {fontspec} { - #1 .default:n = {#3} , - #1 / unknown .code:n = { - \fontspec_update_fontid:n {#2:##1} - \fontspec_update_featstr:n {#2=##1}#4 - } + #1 .default:n = {#3} , + #1 / unknown .code:n = { + \fontspec_update_fontid:n {#2:##1} + \fontspec_update_featstr:n {#2=##1}#4 + } } } @@ -61,7 +61,6 @@ \newhangulfontfeature{InterHangul}{interhangul}{0}{} \newhangulfontfeature{InterLatinCJK}{interlatincjk}{0}{} \newhangulfontfeature{PunctRaise}{punctraise}{0}{} -\newhangulfontfeature{QuoteRaise}{quoteraise}{0}{} \newhangulfontfeature{CharRaise}{charraise}{0}{} \newhangulfontfeature{Protrusion}{protrusion}{default}{\aftergroup\pdfprotrudechars\aftergroup\tw@} \newhangulfontfeature{Expansion}{expansion}{default}{\aftergroup\pdfadjustspacing\aftergroup\tw@} @@ -69,10 +68,13 @@ %% macros for Korean fonts \protected\def\setmainhangulfont{\newfontfamily\serifhangul@font} \protected\def\setmainhanjafont {\newfontfamily\serifhanja@font} +\protected\def\setmainfallbackfont{\newfontfamily\seriffallback@font} \protected\def\setsanshangulfont{\newfontfamily\sanshangul@font} \protected\def\setsanshanjafont {\newfontfamily\sanshanja@font} +\protected\def\setsansfallbackfont{\newfontfamily\sansfallback@font} \protected\def\setmonohangulfont{\newfontfamily\monohangul@font} \protected\def\setmonohanjafont {\newfontfamily\monohanja@font} +\protected\def\setmonofallbackfont{\newfontfamily\monofallback@font} \protected\def\newhangulfontfamily#1{% \protected\def#1{\expandafter\let\expandafter\hangul@font @@ -84,6 +86,11 @@ \csname luatexko@\string#1\endcsname \luatexko@hanja@selectfont}\expandafter\newfontfamily \csname luatexko@\string#1\endcsname} +\protected\def\newfallbackfontfamily#1{% + \protected\def#1{\expandafter\let\expandafter\fallback@font + \csname luatexko@\string#1\endcsname + \luatexko@fallback@selectfont}\expandafter\newfontfamily + \csname luatexko@\string#1\endcsname} \protected\def\newhangulfontface#1{% \protected\def#1{\expandafter\let\expandafter\hangul@font @@ -95,6 +102,11 @@ \csname luatexko@\string#1\endcsname \luatexko@hanja@selectfont}\expandafter\newfontface \csname luatexko@\string#1\endcsname} +\protected\def\newfallbackfontface#1{% + \protected\def#1{\expandafter\let\expandafter\fallback@font + \csname luatexko@\string#1\endcsname + \luatexko@fallback@selectfont}\expandafter\newfontface + \csname luatexko@\string#1\endcsname} \protected\def\hangulfontspec#1#{% \def\luatexko@fontspec@temp{#1}\hangulfontspec@} @@ -108,6 +120,12 @@ \expandafter\newfontfamily\expandafter\hanja@font\luatexko@fontspec@temp{#1}% \luatexko@hanja@selectfont\ignorespaces} \let\adhochanjafont\hanjafontspec +\protected\def\fallbackfontspec#1#{% + \def\luatexko@fontspec@temp{#1}\fallbackfontspec@} +\def\fallbackfontspec@#1{% + \expandafter\newfontfamily\expandafter\fallback@font\luatexko@fontspec@temp{#1}% + \luatexko@fallback@selectfont\ignorespaces} +\let\adhocfallbackfont\fallbackfontspec % add{hangul/hanja}fontfeature \protected\def\addhangulfontfeature#1{% @@ -128,6 +146,15 @@ \def\hanja@font{\fontfamily\luatexko@fontspec@temp \luatexko@orig@selectfont}\luatexko@hanja@selectfont \ignorespaces} \let\addhanjafontfeatures\addhanjafontfeature +\protected\def\addfallbackfontfeature#1{% + \begingroup + \check@fallback@family + \ifdefined\fallback@font\fallback@font\fi\addfontfeature{#1}\global + \let\luatexko@fontspec@temp\f@family + \endgroup + \def\fallback@font{\fontfamily\luatexko@fontspec@temp + \luatexko@orig@selectfont}\luatexko@fallback@selectfont \ignorespaces} +\let\addfallbackfontfeatures\addfallbackfontfeature % check hangul/hanja family \def\check@hangul@family{% @@ -144,14 +171,27 @@ \else \let\hanja@font\serifhanja@font \fi\fi\fi } +\def\check@fallback@family{% + \unless\ifdefined\fallback@font + \ifx\f@family\sfdefault \let\fallback@font\sansfallback@font + \else\ifx\f@family\ttdefault \let\fallback@font\monofallback@font + \else \let\fallback@font\seriffallback@font + \fi\fi\fi +} \let\luatexko@orig@selectfont\selectfont \protected\def\selectfont{\luatexko@orig@selectfont - \luatexko@hangul@selectfont\luatexko@hanja@selectfont} + \luatexko@hangul@selectfont + \luatexko@hanja@selectfont + \luatexko@fallback@selectfont +} % don't forget to redefine \normalfont \protected\edef\normalfont{\unexpanded{% - \let\hangul@font\luatexko@undefined\let\hanja@font\luatexko@undefined}% + \let\hangul@font\luatexko@undefined + \let\hanja@font\luatexko@undefined + \let\fallback@font\luatexko@undefined + }% \unexpanded\expandafter{\normalfont}} \let\reset@font\normalfont @@ -177,6 +217,7 @@ InterHangul=-0.04em, InterLatinCJK=0.125em, PunctRaise=-0.125em, + Ligatures=TeX, SlantedFont=*, SlantedFeatures={FakeSlant=0.2}, ItalicFont=*, ItalicFeatures={FakeSlant=0.2}, BoldSlantedFont=*Bold, BoldSlantedFeatures={FakeSlant=0.2}, @@ -185,6 +226,7 @@ \setsanshangulfont[ InterLatinCJK=0.125em, PunctRaise=-0.125em, + Ligatures=TeX, SlantedFont=*, SlantedFeatures={FakeSlant=0.2}, ItalicFont=*, ItalicFeatures={FakeSlant=0.2}, BoldSlantedFont=*Bold, BoldSlantedFeatures={FakeSlant=0.2}, @@ -254,7 +296,7 @@ \linespread{1.3888} \footnotesep=1.3888\footnotesep \skip\footins=1.3888\skip\footins plus6pt minus3pt - \directlua{luatexko.hangulmain = true} + \hangulpunctuations=1 \fi \endinput |