]> git.lyx.org Git - lyx.git/commitdiff
Cmake export tests: Set inputencoding to ascii if test with xetex and tex fonts.
authorKornel Benko <kornel@lyx.org>
Tue, 10 Nov 2015 12:01:49 +0000 (13:01 +0100)
committerKornel Benko <kornel@lyx.org>
Tue, 10 Nov 2015 12:01:49 +0000 (13:01 +0100)
development/autotests/lyxStatus.pm
development/autotests/revertedTests
development/autotests/useSystemFonts.pl

index c9a45830d686f68d736edd0722d769501b376564..ef18c897bb2854ada818ed5eedcd5075d71f1f5b 100644 (file)
@@ -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);
   }
index 5bb5a47fe7eb6afff17423d2d1562124055b096d..18e482c5898c281d2470c8415725a4a87ab4e0de 100644 (file)
@@ -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.
index ebd057ce104d0c06c4d39855527a845f63203e16..01b8b05dd109156ae335ca984df081622c4f529e 100644 (file)
@@ -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 = <FI>) {
     chomp($l);