diff options
Diffstat (limited to 'Master/texmf-dist/source/generic/hyph-utf8/generate-tl-files.rb')
-rw-r--r-- | Master/texmf-dist/source/generic/hyph-utf8/generate-tl-files.rb | 82 |
1 files changed, 68 insertions, 14 deletions
diff --git a/Master/texmf-dist/source/generic/hyph-utf8/generate-tl-files.rb b/Master/texmf-dist/source/generic/hyph-utf8/generate-tl-files.rb index f1b4f89193c..6bf7dd3758b 100644 --- a/Master/texmf-dist/source/generic/hyph-utf8/generate-tl-files.rb +++ b/Master/texmf-dist/source/generic/hyph-utf8/generate-tl-files.rb @@ -1,8 +1,9 @@ #!/usr/bin/env ruby +# encoding: utf-8 -load 'languages.rb' +# this file auto-generates tlpsrc files for hyphenation patterns - to be improved -# this file auto-generates loaders for hyphenation patterns - to be improved +load 'languages.rb' $package_name="hyph-utf8" @@ -29,7 +30,7 @@ language_grouping = { 'chinese' => ['zh-latn-pinyin'], 'indic' => ['as', 'bn', 'gu', 'hi', 'kn', 'ml', 'mr', 'or', 'pa', 'ta', 'te'], 'serbian' => ['sh-latn', 'sh-cyrl'], - 'latin' => ['la', 'la-x-classic'], + 'latin' => ['la', 'la-x-classic', 'la-x-liturgic'], } language_used_in_group = Hash.new @@ -80,6 +81,10 @@ end # TLPSRC # #--------# language_groups.sort.each do |language_name,language_list| + files_path_hyph8 = "tex/generic/hyph-utf8" + files_run = [] + files_doc = [] + files_src = [] $file_tlpsrc = File.open("#{$path_tlpsrc}/hyphen-#{language_name}.tlpsrc", 'w') puts "generating #{$path_tlpsrc}/hyphen-#{language_name}.tlpsrc" @@ -93,6 +98,8 @@ language_groups.sort.each do |language_name,language_list| $file_tlpsrc.puts "depend ruhyphen" elsif language_name == "ukrainian" then $file_tlpsrc.puts "depend ukrhyph" + elsif language_name == "norwegian" then + files_run.push("#{files_path_hyph8}/patterns/tex/hyph-no.tex") end language_list.each do |language| if language.description_s != nil then @@ -128,15 +135,45 @@ language_groups.sort.each do |language_name,language_list| file_exceptions = "" if language.use_new_loader then file = "file=loadhyph-#{language.code}.tex" - # we skip the mongolian language - if language.code != "mn-cyrl-x-lmc" then + files_run.push("#{files_path_hyph8}/loadhyph/loadhyph-#{language.code}.tex") + if language.has_quotes then + files_run.push("#{files_path_hyph8}/patterns/quote/hyph-quote-#{language.code}.tex") + end + + if language.code == "mn-cyrl-x-lmc" then + files_run.push("#{files_path_hyph8}/patterns/tex/hyph-#{language.code}.tex") + files_run.push("#{files_path_hyph8}/patterns/ptex/hyph-#{language.code}.#{language.encoding}.tex") + # we skip the mongolian language for luatex files + else if language.code == "sr-latn" or language.code == "sr-cyrl" then + code = language.code.gsub(/sr/, "sh") filename_pat = "hyph-sh-latn.pat.txt,hyph-sh-cyrl.pat.txt" filename_hyp = "hyph-sh-latn.hyp.txt,hyph-sh-cyrl.hyp.txt" + + files_run.push("#{files_path_hyph8}/patterns/tex/hyph-#{code}.tex") + files_run.push("#{files_path_hyph8}/patterns/ptex/hyph-#{code}.#{language.encoding}.tex") + # duplicate entries (will be removed later) + files_run.push("#{files_path_hyph8}/patterns/tex/hyph-sr-cyrl.tex") + ['chr', 'pat', 'hyp', 'lic'].each do |t| + files_run.push("#{files_path_hyph8}/patterns/txt/hyph-#{code}.#{t}.txt") + # duplicate entries (will be removed later) + files_run.push("#{files_path_hyph8}/patterns/txt/hyph-sr-cyrl.#{t}.txt") + end else filename_pat = "hyph-#{language.code}.pat.txt" filename_hyp = "hyph-#{language.code}.hyp.txt" + files_run.push("#{files_path_hyph8}/patterns/tex/hyph-#{language.code}.tex") + if language.encoding != nil and language.encoding != "ascii" then + files_run.push("#{files_path_hyph8}/patterns/ptex/hyph-#{language.code}.#{language.encoding}.tex") + elsif language.code == "cop" then + files_run.push("#{files_path_hyph8}/patterns/tex-8bit/#{language.filename_old_patterns}") + # files_run.push("#{files_path_hyph8}/patterns/tex-8bit/copthyph.tex") + end + ['chr', 'pat', 'hyp', 'lic'].each do |t| + files_run.push("#{files_path_hyph8}/patterns/txt/hyph-#{language.code}.#{t}.txt") + end + # check for existance of patterns and exceptions if !File::exists?( "#{$path_txt}/#{filename_pat}" ) then puts "some problem with #{$path_txt}/#{filename_pat}!!!" @@ -177,25 +214,42 @@ language_groups.sort.each do |language_name,language_list| end # end-of-line $file_tlpsrc.puts + + # add sources + if ['es', 'eu', 'gl', 'hy', 'mul-ethi', 'tk', 'tr'].include?(language.code) then + files_src.push("source/generic/hyph-utf8/languages/#{language.code}") + end + # add documentation + if ['bg', 'es', 'hu', 'sa'].include?(language.code) then + files_doc.push("doc/generic/hyph-utf8/#{language.code}") + end end if language_name != "russian" and language_name != "ukrainian" then - $file_tlpsrc.puts language_list.each do |language| if language.use_old_patterns and language.filename_old_patterns != "zerohyph.tex" and language.filename_old_patterns != "copthyph.tex" then - $file_tlpsrc.puts "runpattern f texmf-dist/tex/generic/hyphen/#{language.filename_old_patterns}" + files_run.push("tex/generic/hyphen/#{language.filename_old_patterns}") end end end + + # documeentation if language_name == "greek" then - $file_tlpsrc.puts - $file_tlpsrc.puts "docpattern d texmf-dist/doc/generic/elhyphen" + files_doc.push("doc/generic/elhyphen") elsif language_name == "hungarian" then - $file_tlpsrc.puts - $file_tlpsrc.puts "docpattern d texmf-dist/doc/generic/huhyphen" + files_doc.push("doc/generic/huhyphen") elsif language_name == "german" then - $file_tlpsrc.puts - $file_tlpsrc.puts "runpattern f texmf-dist/tex/generic/hyphen/dehyphtex.tex" - $file_tlpsrc.puts "runpattern f texmf-dist/tex/generic/hyphen/ghyphen.README" + files_run.push("tex/generic/hyphen/dehyphtex.tex") + files_run.push("tex/generic/hyphen/ghyphen.README") + end + + files_doc.sort.each do |f| + $file_tlpsrc.puts "docpattern d texmf-dist/#{f}" + end + files_src.sort.each do |f| + $file_tlpsrc.puts "srcpattern d texmf-dist/#{f}" + end + files_run.sort.uniq.each do |f| + $file_tlpsrc.puts "runpattern f texmf-dist/#{f}" end $file_tlpsrc.close end |