From ce59f6705d9b2bd6df0d3eeadbaf43b25fa58b4f Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Wed, 19 Oct 2011 00:01:18 +0200 Subject: parser caching (-> *great* speedup); generalized the yer-hack --- .../third/transliterator/t-transliterator.mkiv | 23 +++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'tex/context/third/transliterator/t-transliterator.mkiv') diff --git a/tex/context/third/transliterator/t-transliterator.mkiv b/tex/context/third/transliterator/t-transliterator.mkiv index ed9fda7..2ff4736 100644 --- a/tex/context/third/transliterator/t-transliterator.mkiv +++ b/tex/context/third/transliterator/t-transliterator.mkiv @@ -57,6 +57,7 @@ hyphenate=cz, mode=ru_old, sr_exceptions=\v!yes, + deficient_font=\v!no, ] %D Possible values for \type{mode} are by the time of this writing: @@ -64,11 +65,13 @@ %D \type{all}, \type{iso9_ocs}, \type{ocs}, \type{ocs_gla}, \type{ru_cz}, %D \type{ocs_cz}, \type{gr} and \type{gr_n}. %D As not all fonts, even the expensive ones, support some of the most frequent -%D unicode signs used in ISO~9 there are fallbacks for the transliterations of -%D the weak and hard sign: \type{iso9_ocs_hack}, which is essentially -%D \type{iso9_ocs}, and \type{ru_old_jer_hack}, which is essentially -%D \type{ru_old}. These two transliterate {\em ь} and {\em ъ} (both upper and -%D lower case) to the more common, but non-ISO characters {\em '} and {\em ''} +%D unicode signs used in ISO~9, there are fallbacks for the transliterations of +%D the weak and hard sign. +%D They work with the modes \type{iso9_ocs}, \type{all} and +%D \type{ru_old} only and can be triggered by setting the +%D variable \type{deficient_font} to the value {\em yes}. +%D This will transliterate {\em ь} and {\em ъ} (both upper and +%D lower case) to the more common, but non-ISO characters {\em ’} and {\em ”} %D respectively. %D Possible values for \type{hyphenate} are all valid \CONTEXT\ language code, for an %D overview see \type{http://wiki.contextgarden.net/Language_Codes}. @@ -134,7 +137,10 @@ \setuptransliterate[#1]% \fi \language[\transliterateparameter{hyphenate}]% - \ctxlua{thirddata.translit.transliterate("\transliterateparameter{mode}","\luaescapestring{#2}")}% + \ctxlua{ + thirddata.translit.deficient_font = "\transliterateparameter{deficient_font}" + thirddata.translit.transliterate("\transliterateparameter{mode}","\luaescapestring{#2}") + }% \egroup% } @@ -144,7 +150,10 @@ %\bgroup %\setuptransliterate[#1]% %\language[\transliterateparameter{hyphenate}]% - \ctxlua{thirddata.translit.transliterate("\transliterateparameter{mode}","#2")}% + \ctxlua{ + thirddata.translit.deficient_font = "\transliterateparameter{deficient_font}" + thirddata.translit.transliterate("\transliterateparameter{mode}","#2") + }% %\egroup% } -- cgit v1.2.3