diff options
author | Hans Hagen <pragma@wxs.nl> | 2010-05-06 22:30:00 +0200 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2010-05-06 22:30:00 +0200 |
commit | ec9c0aa1126e13b1e536a7f26d93278c46c1d347 (patch) | |
tree | 4ca4b1af21183f686c0a1d47670cd2cc851b5033 | |
parent | 65ac490d12b57da094d98763d515f178d3db0195 (diff) | |
download | context-ec9c0aa1126e13b1e536a7f26d93278c46c1d347.tar.gz |
stable 2010.05.06 22:30
-rw-r--r-- | tex/context/base/buff-ini.lua | 2 | ||||
-rw-r--r-- | tex/context/base/lang-cjk.mkiv | 14 | ||||
-rw-r--r-- | tex/context/base/lang-ini.lua | 16 | ||||
-rw-r--r-- | tex/context/base/lang-ini.mkiv | 15 | ||||
-rw-r--r-- | tex/context/base/sort-lan.lua | 43 | ||||
-rw-r--r-- | tex/context/base/spac-ver.lua | 1 | ||||
-rw-r--r-- | tex/context/base/spac-ver.mkiv | 10 | ||||
-rw-r--r-- | tex/context/fonts/husayni.lfg | 3 |
8 files changed, 69 insertions, 35 deletions
diff --git a/tex/context/base/buff-ini.lua b/tex/context/base/buff-ini.lua index 74096b0b3..a075bcbf5 100644 --- a/tex/context/base/buff-ini.lua +++ b/tex/context/base/buff-ini.lua @@ -113,7 +113,7 @@ function buffers.verbatimbreak(n,m) if flags.optimize_verbatim then if n == 2 or n == m then texsprint(no_break_command) - else + elseif n > 1 then texsprint(do_break_command) end end diff --git a/tex/context/base/lang-cjk.mkiv b/tex/context/base/lang-cjk.mkiv index 138f6d263..5f736d4a1 100644 --- a/tex/context/base/lang-cjk.mkiv +++ b/tex/context/base/lang-cjk.mkiv @@ -133,13 +133,13 @@ \setuplabeltext [\s!ja] [\v!november=11] \setuplabeltext [\s!ja] [\v!december=12] -\setuplabeltext [\s!ja] [\v!sunday=月曜日] -\setuplabeltext [\s!ja] [\v!monday=火曜日] -\setuplabeltext [\s!ja] [\v!tuesday=水曜日] -\setuplabeltext [\s!ja] [\v!wednesday=木曜日] -\setuplabeltext [\s!ja] [\v!thursday=金曜日] -\setuplabeltext [\s!ja] [\v!friday=土曜日] -\setuplabeltext [\s!ja] [\v!saturday=日曜日] +\setuplabeltext [\s!ja] [\v!monday=月曜日] +\setuplabeltext [\s!ja] [\v!tuesday=火曜日] +\setuplabeltext [\s!ja] [\v!wednesday=水曜日] +\setuplabeltext [\s!ja] [\v!thursday=木曜日] +\setuplabeltext [\s!ja] [\v!friday=金曜日] +\setuplabeltext [\s!ja] [\v!saturday=土曜日] +\setuplabeltext [\s!ja] [\v!sunday=日曜日] %D Korean diff --git a/tex/context/base/lang-ini.lua b/tex/context/base/lang-ini.lua index 512df1b0b..0538b44f8 100644 --- a/tex/context/base/lang-ini.lua +++ b/tex/context/base/lang-ini.lua @@ -168,6 +168,20 @@ local function tolang(what) end end +function languages.setup(what,settings) + what = languages.tolang(what or tex.language) + local lefthyphen = settings.lefthyphen + local righthyphen = settings.righthyphen + lefthyphen = lefthyphen ~= "" and lefthyphen or nil + righthyphen = righthyphen ~= "" and righthyphen or nil + lefthyphen = lefthyphen and utf.byte(lefthyphen) or 0 + righthyphen = righthyphen and utf.byte(righthyphen) or 0 + lang.posthyphenchar(what,lefthyphen) + lang.prehyphenchar (what,righthyphen) + lang.postexhyphenchar(what,lefthyphen) + lang.preexhyphenchar (what,righthyphen) +end + function languages.prehyphenchar(what) return lang.prehyphenchar(tolang(what)) end @@ -289,7 +303,7 @@ languages.words.colors = { ["unknown"] = "red", } -do +do -- can use predefined patterns local spacing = lpeg.S(" \n\r\t") local markup = lpeg.S("-=") diff --git a/tex/context/base/lang-ini.mkiv b/tex/context/base/lang-ini.mkiv index 623af4a2a..0662e5870 100644 --- a/tex/context/base/lang-ini.mkiv +++ b/tex/context/base/lang-ini.mkiv @@ -318,10 +318,12 @@ \newtoks \everylanguage \def\sethyphenationvariables - {\lefthyphenmin 0\languageparameter\s!lefthyphenmin \relax - \righthyphenmin0\languageparameter\s!righthyphenmin\relax - \lefthyphenmin \numexpr\lefthyphenmin +\hyphenminoffset\relax - \righthyphenmin\numexpr\righthyphenmin+\hyphenminoffset\relax} + {\ctxlua{languages.setup(tex.language, { + lefthyphen = "\languageparameter\c!lefthyphen", + righthyphen = "\languageparameter\c!righthyphen", + } )}% + \lefthyphenmin \numexpr0\languageparameter\s!lefthyphenmin +\hyphenminoffset\relax + \righthyphenmin\numexpr0\languageparameter\s!righthyphenmin+\hyphenminoffset\relax} \def\docomplexlanguage% assumes that \currentlanguage is set {\edef\currentdefaultlanguage{\defaultlanguage\currentlanguage}% @@ -332,6 +334,11 @@ % will be definable and move to core-spa ! \doifelse{\languageparameter\c!spacing}\v!broad\nonfrenchspacing\frenchspacing} +% \mainlanguage[nl] \setuplanguage[nl][lefthyphen=,righthyphen=?] +% +% \dorecurse{100}{dit is toch wel een heel\normalhyphendiscretionary lang\normalhyphendiscretionary woord \recurselevel\ } +% \dorecurse{100}{dit is toch wel een heellangwoord \recurselevel\ } + % The following may be a solution for the fact that one cannot % change catcodes of characters like : and ; inside an environment. diff --git a/tex/context/base/sort-lan.lua b/tex/context/base/sort-lan.lua index 477a5ab0e..d80254728 100644 --- a/tex/context/base/sort-lan.lua +++ b/tex/context/base/sort-lan.lua @@ -98,7 +98,8 @@ sorters.entries['cz'] = { ['o'] = "o", ['p'] = "p", ['q'] = "q", - ['s'] = "r", + ['r'] = "r", + [uc(0x00F3)] = uc(0x00F3), -- oacute [uc(0x0147)] = uc(0x0147), -- rcaron ['s'] = "s", [uc(0x0161)] = uc(0x0161), -- scaron @@ -106,11 +107,12 @@ sorters.entries['cz'] = { [uc(0x0165)] = uc(0x0165), -- tcaron ['u'] = "u", [uc(0x00FA)] = "u", - [uc(0x01F6)] = "u", + [uc(0x016F)] = "u", ['v'] = "v", ['w'] = "w", ['x'] = "x", ['y'] = "y", + [uc(0x00FD)] = uc(0x00FD), -- yacute ['z'] = "z", [uc(0x017E)] = uc(0x017E), -- zcaron } @@ -138,24 +140,25 @@ sorters.mappings['cz'] = { ['m'] = 20, -- m ['n'] = 21, -- n [uc(0x0147)] = 22, -- ncaron - ['o'] = 23, -- o - ['p'] = 24, -- p - ['q'] = 25, -- q - ['s'] = 26, -- r - [uc(0x0147)] = 27, -- rcaron - ['s'] = 28, -- s - [uc(0x0161)] = 29, -- scaron - ['t'] = 30, -- t - [uc(0x0165)] = 31, -- tcaron - ['u'] = 32, -- u - [uc(0x00FA)] = 33, -- uacute - [uc(0x01F6)] = 34, -- uring - ['v'] = 35, -- v - ['w'] = 36, -- w - ['x'] = 37, -- x - ['y'] = 38, -- y - ['z'] = 39, -- z - [uc(0x017E)] = 40, -- zcaron + [uc(0x00F3)] = 24, -- oacute + ['p'] = 25, -- p + ['q'] = 26, -- q + ['r'] = 27, -- r + [uc(0x0147)] = 28, -- rcaron + ['s'] = 29, -- s + [uc(0x0161)] = 20, -- scaron + ['t'] = 31, -- t + [uc(0x0165)] = 32, -- tcaron + ['u'] = 33, -- u + [uc(0x00FA)] = 34, -- uacute + [uc(0x016F)] = 35, -- uring + ['v'] = 36, -- v + ['w'] = 37, -- w + ['x'] = 38, -- x + ['y'] = 39, -- y + [uc(0x00FD)] = 40, -- yacute + ['z'] = 41, -- z + [uc(0x017E)] = 42, -- zcaron } -- French diff --git a/tex/context/base/spac-ver.lua b/tex/context/base/spac-ver.lua index 45ca1475a..ec3d29849 100644 --- a/tex/context/base/spac-ver.lua +++ b/tex/context/base/spac-ver.lua @@ -644,6 +644,7 @@ local function collapser(head,where,what,trace,snap) -- maybe also pass tail texdimen.globalbodyfontstrutheight, texdimen.globalbodyfontstrutdepth, texdimen.bodyfontstrutheight, texdimen.bodyfontstrutdepth) end + if trace then trace_info("start analyzing",where,what) end while current do local id, subtype = current.id, current.subtype if id == hlist or id == vlist then diff --git a/tex/context/base/spac-ver.mkiv b/tex/context/base/spac-ver.mkiv index a5b391a2f..f7c8a82fa 100644 --- a/tex/context/base/spac-ver.mkiv +++ b/tex/context/base/spac-ver.mkiv @@ -928,9 +928,17 @@ % treatment; tests with using an attribute so far have shown that % it's slower because testing the attribute takes time too +\newdimen\tempstrutdimen + \def\dosetstrut {\let\strut\normalstrut - \edef\strutheight{\the\strutht}% + \tempstrutdimen\dimexpr\strutht+\strutdp-\lineheight\relax + \ifabsnum\tempstrutdimen<\plustwo + % compensate rounding error /- 1sp to avoid too many + % 1sp baselineskips in for instance verbatim + \strutht\dimexpr\strutht-\tempstrutdimen\relax + \fi + \edef\strutheight{\the\strutht}% maybe better \number\strutht sp \edef\strutdepth {\the\strutdp}% \ifdim\strutwidth=\zeropoint \dosetstruthide diff --git a/tex/context/fonts/husayni.lfg b/tex/context/fonts/husayni.lfg index 1019d33f6..2cc4d6111 100644 --- a/tex/context/fonts/husayni.lfg +++ b/tex/context/fonts/husayni.lfg @@ -167,7 +167,8 @@ return { [3] = { "Ttaa.waqf", "SsLY.waqf", "QLY.waqf", "Miim.waqf", "LA.waqf", "Jiim.waqf", "Threedotsabove.waqf", "Siin.waqf", "Ssaad.waqf", "Qaaf.waqf", "SsL.waqf", "QF.waqf", "SKTH.waqf", "WQFH.waqf", "Kaaf.waqf", "Ayn.ruku", "Miim.nuun_high", "Siin.Ssaad", "Nuunsmall", "emptydot_low", "emptydot_high", "Sifr.fill", "Miim.nuun_low", "Nuun.tanwiin", }, - [4] = {"ZeroArabic.ayah", "OneArabic.ayah", "TwoArabic.ayah", "ThreeArabic.ayah", "FourArabic.ayah", "FiveArabic.ayah", "SixArabic.ayah", "SevenArabic.ayah", "EightArabic.ayah", "NineArabic.ayah", "FourFarsi.ayah", "FiveFarsi.ayah", "SixFarsi.ayah", "FourFarsi.urdu_ayah", "SevenFarsi.urdu_ayah","ZeroArabic.ayah_small","OneArabic.ayah_small","TwoArabic.ayah_small","ThreeArabic.ayah_small","FourArabic.ayah.001","FiveArabic.ayah_small","SixArabic.ayah_small","SevenArabic.ayah_small","EightArabic.ayah_small","NineArabic.ayah_small", + [4] = { + "ZeroArabic.ayah", "OneArabic.ayah", "TwoArabic.ayah", "ThreeArabic.ayah", "FourArabic.ayah", "FiveArabic.ayah", "SixArabic.ayah", "SevenArabic.ayah", "EightArabic.ayah", "NineArabic.ayah", "FourFarsi.ayah", "FiveFarsi.ayah", "SixFarsi.ayah", "FourFarsi.urdu_ayah", "SevenFarsi.urdu_ayah","ZeroArabic.ayah_small","OneArabic.ayah_small","TwoArabic.ayah_small","ThreeArabic.ayah_small","FourArabic.ayah.001","FiveArabic.ayah_small","SixArabic.ayah_small","SevenArabic.ayah_small","EightArabic.ayah_small","NineArabic.ayah_small", }, [5] = { "Ayah", "Ayah.alt1", "Ayah.alt2", "Ayah.alt3", "Ayah2", |