summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/generic/hyph-utf8/generate-pattern-loaders.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/generic/hyph-utf8/generate-pattern-loaders.rb')
-rw-r--r--Master/texmf-dist/source/generic/hyph-utf8/generate-pattern-loaders.rb30
1 files changed, 28 insertions, 2 deletions
diff --git a/Master/texmf-dist/source/generic/hyph-utf8/generate-pattern-loaders.rb b/Master/texmf-dist/source/generic/hyph-utf8/generate-pattern-loaders.rb
index f00a19d3e68..d92627cf2fc 100644
--- a/Master/texmf-dist/source/generic/hyph-utf8/generate-pattern-loaders.rb
+++ b/Master/texmf-dist/source/generic/hyph-utf8/generate-pattern-loaders.rb
@@ -63,17 +63,36 @@ languages.each do |language|
file.puts("\\lccode`\\-=`\\-")
end
- if language.encoding == "ascii" then
+ # some special cases firs
+ #
+ # some languages (sanskrit) are useless in 8-bit engines; we only want to load them for UTF engines
+ # TODO - maybe consider doing something similar for ibycus
+ if language.code == 'sa' then
+ file.puts(text_if_native_utf)
+ file.puts(" \\message{UTF-8 #{language.message}}")
+ file.puts(' % Set \lccode for ZWNJ and ZWJ.')
+ file.puts(' \lccode"200C="200C')
+ file.puts(' \lccode"200D="200D')
+ file.puts(" \\input hyph-#{language.code}.tex")
+ file.puts('\else')
+ file.puts(" \\message{No #{language.message}}")
+ file.puts('\fi')
+ # for ASCII encoding, we don't load any special support files, but simply load everything
+ elsif language.encoding == "ascii" then
file.puts('% ASCII patterns - no additional support is needed')
+ # for UK English we simply load the old file without bothering about renaming it
if language.use_old_patterns then
file.puts("\\input #{language.filename_old_patterns}")
+ # for the rest we load the new file
else
file.puts("\\message{ASCII #{language.message}}")
file.puts("\\input hyph-#{language.code}.tex")
end
+ # when lanugage uses old patterns for 8-bit engines, load two different patterns rather than using the converter
elsif language.use_old_patterns then
file.puts(text_if_native_utf)
file.puts(" \\message{UTF-8 #{language.message}}")
+ # some catcodes for XeTeX
if language.code == 'grc' or language.code.slice(0,2) == 'el' then
file.puts(" \\lccode`'=`'\\lccode`’=`’\\lccode`ʼ=`ʼ\\lccode`᾽=`᾽\\lccode`᾿=`᾿")
end
@@ -94,11 +113,18 @@ languages.each do |language|
file.puts(" \\message{UTF-8 #{language.message}}")
file.puts('\else')
file.puts(" \\message{#{language.encoding.upcase} #{language.message}}")
+ # a hack for OT1 encoding in three languages
+ if language.code == 'da' or language.code == 'fr' or language.code == 'la' then
+ file.puts(" % A hack to support both EC and OT1 encoding in 8-bit engines.")
+ file.puts(" % Kept for backward compatibility only, though we would prefer to drop it.")
+ file.puts(" % OT1 encoding is close-to-useless for proper hyphenation.")
+ file.puts(" \\input spechyph-ot1-#{language.code}.tex")
+ end
file.puts(" \\input conv-utf8-#{language.encoding}.tex")
file.puts('\fi')
if language.code == 'sr-latn' then
file.puts("% Load Serbo-Croatian patterns")
- file.puts("\\input hyph-hbs.tex")
+ file.puts("\\input hyph-sh-latn.tex")
else
file.puts("\\input hyph-#{language.code}.tex")
end