diff options
author | Karl Berry <karl@freefriends.org> | 2014-06-19 20:24:23 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2014-06-19 20:24:23 +0000 |
commit | 2ab598832d6c69a43f55cc0fce844b2464d1b339 (patch) | |
tree | 43a6ed23345f78f1b5e252df0d84e277a83f5bc7 /Master/texmf-dist/tex/luatex | |
parent | c46f74d4c2a102cc794be871c46f42519bf6da8a (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')
5 files changed, 99 insertions, 71 deletions
diff --git a/Master/texmf-dist/tex/luatex/luatexko/luatexko-core.sty b/Master/texmf-dist/tex/luatex/luatexko/luatexko-core.sty index 835f8b14baf..5cddf331113 100644 --- a/Master/texmf-dist/tex/luatex/luatexko/luatexko-core.sty +++ b/Master/texmf-dist/tex/luatex/luatexko/luatexko-core.sty @@ -15,7 +15,7 @@ \ifcsname ifpdf\endcsname\else \input ifpdf.sty \fi \catcode`@ = 11 \else - \ProvidesPackage{luatexko-core}[2014/05/11 v1.5 Typesetting Korean with LuaTeX] + \ProvidesPackage{luatexko-core}[2014/06/17 v1.6 Typesetting Korean with LuaTeX] \RequirePackage{luaotfload}[2013/05/23] \fi @@ -205,7 +205,7 @@ % strike-out \protected\def\sout#1{{\def\ulinedown{-0.5ex-\ulinewidth/2}\uline{#1}}} % ulem with arbitray box -\protected\def\markoverwidth#1#2{% +\protected\def\markoverwith#1#2{% \ifnum\luakoulineboxcnt > 65535 \luakoulineboxcnt\z@ \fi \global\advance\luakoulineboxcnt\@ne \setbox\z@\hbox{#1}% @@ -214,15 +214,15 @@ #2\special{luako:ulineend}} \protected\def\uuline{\dimen@ii-\dimexpr\ulinedown\relax \dimen@\dimexpr\ulinedown+\ulinewidth\relax - \markoverwidth{\vtop{\hrule width.2em height\dimen@ii depth\dimen@ + \markoverwith{\vtop{\hrule width.2em height\dimen@ii depth\dimen@ \kern.1em\hrule height\dimen@ii depth\dimen@}}} \protected\def\uwave {\ifx\ltxko@sixly\undefined \font\ltxko@sixly=lasy6 \fi - \markoverwidth{\lower4\p@\hbox{\ltxko@sixly\char58}}} -\protected\def\xout {\markoverwidth{\hbox to.35em{/\hss}}} -\protected\def\dashuline{\markoverwidth{\kern.125em\vtop{\kern\ulinedown + \markoverwith{\lower4\p@\hbox{\ltxko@sixly\char58}}} +\protected\def\xout {\markoverwith{\hbox to.35em{/\hss}}} +\protected\def\dashuline{\markoverwith{\kern.125em\vtop{\kern\ulinedown \hrule width.3em height\z@ depth\ulinewidth}\kern.125em}} \protected\def\dotuline{\dimen@\dimexpr\ulinedown+0.1ex\relax - \markoverwidth{\lower\dimen@\hbox{\kern.1em .\kern.04em}}} + \markoverwith{\lower\dimen@\hbox{\kern.1em .\kern.04em}}} %% hangul font -- core \def\luatexko@hangul@selectfont{% diff --git a/Master/texmf-dist/tex/luatex/luatexko/luatexko-normalize.lua b/Master/texmf-dist/tex/luatex/luatexko/luatexko-normalize.lua index 4c2fde7fff0..32377748f24 100644 --- a/Master/texmf-dist/tex/luatex/luatexko/luatexko-normalize.lua +++ b/Master/texmf-dist/tex/luatex/luatexko/luatexko-normalize.lua @@ -12,8 +12,8 @@ luatexbase.provides_module({ name = "luatexko-normalize", - version = 1.5, - date = "2014/05/11", + version = 1.6, + date = "2014/06/17", author = "Dohyun Kim", description = "Hangul normalization", license = "LPPL v1.3+", diff --git a/Master/texmf-dist/tex/luatex/luatexko/luatexko-uhc2utf8.lua b/Master/texmf-dist/tex/luatex/luatexko/luatexko-uhc2utf8.lua index 3d28a668b1f..95c29ac71bd 100644 --- a/Master/texmf-dist/tex/luatex/luatexko/luatexko-uhc2utf8.lua +++ b/Master/texmf-dist/tex/luatex/luatexko/luatexko-uhc2utf8.lua @@ -12,8 +12,8 @@ luatexbase.provides_module({ name = "luatexko-uhc2utf8", - version = 1.5, - date = "2014/05/11", + version = 1.6, + date = "2014/06/17", author = "Dohyun Kim", description = "UHC (CP949) input encoding", license = "LPPL v1.3+", @@ -63,14 +63,16 @@ local t_uhc2ucs = t_uhc2ucs or get_uhc_uni_table() local uhc_to_utf8 = function(buffer) if not buffer then return end -- check if buffer is already utf-8; better solution? - local isutf = true - for v in utfvalues(buffer) do - if v == 0xFFFD then -- REPLACEMENT CHARACTER - isutf = false - break - end - end - if isutf == true then return buffer end + local ubuffer = buffer + ubuffer = gsub(ubuffer,"[\000-\127]","") + ubuffer = gsub(ubuffer,"[\194-\223][\128-\191]","") + ubuffer = gsub(ubuffer,"\224[\160-\191][\128-\191]","") + ubuffer = gsub(ubuffer,"[\225-\236\238\239][\128-\191][\128-\191]","") + ubuffer = gsub(ubuffer,"\237[\128-\159][\128-\191]","") + ubuffer = gsub(ubuffer,"\240[\144-\191][\128-\191][\128-\191]","") + ubuffer = gsub(ubuffer,"[\241-\243][\128-\191][\128-\191][\128-\191]","") + ubuffer = gsub(ubuffer,"\244[\128-\143][\128-\191][\128-\191]","") + if ubuffer == "" then return buffer end -- now convert to utf8 buffer = gsub(buffer, "([\129-\253])([\65-\254])", function(a, b) diff --git a/Master/texmf-dist/tex/luatex/luatexko/luatexko.lua b/Master/texmf-dist/tex/luatex/luatexko/luatexko.lua index aa14bbc249f..fd0c5c1d68c 100644 --- a/Master/texmf-dist/tex/luatex/luatexko/luatexko.lua +++ b/Master/texmf-dist/tex/luatex/luatexko/luatexko.lua @@ -12,8 +12,8 @@ local err,warn,info,log = luatexbase.provides_module({ name = 'luatexko', - date = '2014/05/11', - version = 1.5, + date = '2014/06/17', + version = 1.6, description = 'Korean linebreaking and font-switching', author = 'Dohyun Kim', license = 'LPPL v1.3+', @@ -1123,7 +1123,7 @@ local function inject_char_widow_penalty (head,curr,uni,cjattr) end if np and np.id == penaltynode then curr = np - if curr.penalty < pv then + if curr.penalty < pv and curr.penalty > 0 then -- bypass \\ case curr.penalty = pv end elseif curr and curr.id == gluenode then @@ -1663,8 +1663,8 @@ local function draw_underline(head,curr,width,ulinenum,ulstart) local glue = get_gluenode(width) glue.subtype = 101 -- cleaders glue.leader = copy_node(ulinebox[ulinenum]) - insert_before(head, curr, get_kernnode(-width)) - insert_before(head, curr, glue) + head = insert_before(head, ulstart, glue) + head = insert_before(head, ulstart, get_kernnode(-width)) end for _,nd in ipairs({ulstart,curr}) do if nd.id == whatsitnode @@ -1872,6 +1872,24 @@ otffeatures.register { } ------------------------------------ +-- no embedding +------------------------------------ +local function dontembedthisfont (tfmdata, value) + if value == "no" then + fonts.constructors.dontembed[tfmdata.properties.filename] = 1 + end +end + +otffeatures.register { + name = "embedding", + description = "dont embed this font", + initializers = { + base = dontembedthisfont, + node = dontembedthisfont, + } +} + +------------------------------------ -- italic correction for fake-slant font ------------------------------------ local function fakeslant_itlc (tfmdata) @@ -1937,6 +1955,7 @@ add_to_callback("luaotfload.patch_font", ------------------------------------ local function actualtext (str) local t = {} + str = stringgsub(str,"##","#") for uni in string.utfvalues(str) do if uni < 0x10000 then t[#t+1] = stringformat("%04X",uni) 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 |