From: Kornel Benko Date: Tue, 10 Nov 2015 12:01:49 +0000 (+0100) Subject: Cmake export tests: Set inputencoding to ascii if test with xetex and tex fonts. X-Git-Tag: 2.2.0alpha1~34 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;ds=sidebyside;h=c4ae71ceb2cfbc3e8fb52cfbc8396a6309af5dbc;hp=a8c1161d7b3b36c9cc5cdc2e990d0b7abf9d6363;p=lyx.git Cmake export tests: Set inputencoding to ascii if test with xetex and tex fonts. --- diff --git a/development/autotests/lyxStatus.pm b/development/autotests/lyxStatus.pm index c9a45830d6..ef18c897bb 100644 --- a/development/autotests/lyxStatus.pm +++ b/development/autotests/lyxStatus.pm @@ -14,7 +14,7 @@ BEGIN { } # Prototypes -sub initLyxStack($$); +sub initLyxStack($$$); sub diestack($); sub closeLyxStack(); sub setMatching($); @@ -36,6 +36,7 @@ sub checkLyxLine($); my @stack = (); # list of HASH-Arrays my $rFont = {}; my $useNonTexFont = "true"; +my $inputEncoding = undef; # The elements are: # type (layout, inset, header, preamble, ...) @@ -49,7 +50,7 @@ my $useNonTexFont = "true"; # but first set the modified value into $result->[$fileidx] # numerical value will be replaced with appropriate matching group value -sub initLyxStack($$) +sub initLyxStack($$$) { $rFont = $_[0]; if ($_[1] eq "systemF") { @@ -57,6 +58,7 @@ sub initLyxStack($$) } else { $useNonTexFont = "false"; + $inputEncoding = $_[2]; } $stack[0] = { type => "Starting"}; } @@ -215,6 +217,12 @@ sub checkForHeader($) "filetype" => "replace_only", "result" => ["\\use_non_tex_fonts $useNonTexFont"]); push(@rElems, $elemntf); + if (defined($inputEncoding)) { + my $inputenc = newMatch("search" => '^\\\\inputencoding\s+(' . $inputEncoding->{search} . ')', + "filetype" => "replace_only", + "result" => ["\\inputencoding " . $inputEncoding->{out}]); + push(@rElems, $inputenc); + } setMatching(\@rElems); return(1); } diff --git a/development/autotests/revertedTests b/development/autotests/revertedTests index 5bb5a47fe7..18e482c589 100644 --- a/development/autotests/revertedTests +++ b/development/autotests/revertedTests @@ -76,7 +76,7 @@ export/examples/ko/splash_(dvi||pdf[23]?) export/templates/DocBook_article_(dvi3_|pdf2|pdf[45]_).* export/templates/JSS-article_(dvi|dvi3_.*|pdf3?) export/templates/attic/latex8_(dvi|dvi3_.*) -export/templates/ctex_pdf[23]? +export/templates/ctex_(pdf[23]?|pdf4_texF) export/templates/ja_.*(pdf[245]|dvi3).* # # The following exports worked with TeX Live 2013, but not in 2014. diff --git a/development/autotests/useSystemFonts.pl b/development/autotests/useSystemFonts.pl index ebd057ce10..01b8b05dd1 100644 --- a/development/autotests/useSystemFonts.pl +++ b/development/autotests/useSystemFonts.pl @@ -79,6 +79,7 @@ if ($source =~ /\/([a-z][a-z](_[A-Z][A-Z])?)[\/_]/) { $lang = $1; } +my $inputEncoding = undef; if ($fontT eq "systemF") { if ($lang =~ /^(ru|uk|sk)$/) { $font{roman} = "DejaVu Serif"; @@ -120,6 +121,20 @@ if ($fontT eq "systemF") { } else { # use tex font here + if ($format =~ /^(pdf4)$/) { # xelatex + # set input encoding to 'ascii' always + $inputEncoding = { + "search" => '.*', # this will be substituted from '\inputencoding'-line + "out" => "ascii", + }; + } + elsif ($format =~ /^(dvi3|pdf5)$/) { # (dvi)?lualatex + # when to set input encoding to 'ascii'? + #$inputEncoding = { + # "search" => 'auto|default', # this will be substituted from '\inputencoding'-line + # "out" => "ascii", + #}; + } } my $sourcedir = dirname($source); @@ -176,7 +191,7 @@ sub interpretedCopy($$$$) diestack("could not read \"$source\"") if (!open(FI, $source)); diestack("could not write \"$dest\"") if (! open(FO, '>', $dest)); - initLyxStack(\%font, $fontT); + initLyxStack(\%font, $fontT, $inputEncoding); while (my $l = ) { chomp($l);