mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-25 19:07:45 +00:00
Compare commits
3 Commits
e3d26bcb5f
...
c87b2d5fc2
Author | SHA1 | Date | |
---|---|---|---|
|
c87b2d5fc2 | ||
|
e72ca6a586 | ||
|
2e408d2fdc |
@ -7,8 +7,8 @@
|
|||||||
# LYX_ROOT = ${TOP_SRC_DIR}/lib/{doc,examples,templates,tabletemplates}
|
# LYX_ROOT = ${TOP_SRC_DIR}/lib/{doc,examples,templates,tabletemplates}
|
||||||
# LYX_USERDIR_VER = Name of environment variable for the user directory
|
# LYX_USERDIR_VER = Name of environment variable for the user directory
|
||||||
# lyx =
|
# lyx =
|
||||||
# format = lyx16x|lyx20x|lyx21x|lyx22x|xhtml|docbook5|epub
|
# format = lyx16x|lyx20x|lyx21x|lyx22x|lyx23x|xhtml|docbook5|epub
|
||||||
# extension = 16.lyx|20.lyx|21.lyx|22.lyx|xhtml|xml|epub
|
# extension = 16.lyx|20.lyx|21.lyx|22.lyx|23.lyx|xhtml|xml|epub
|
||||||
# file = xxx
|
# file = xxx
|
||||||
#
|
#
|
||||||
# Script should be called like:
|
# Script should be called like:
|
||||||
@ -37,6 +37,7 @@ set(_TestResultMessage "")
|
|||||||
message(STATUS "IgnoreErrorMessage = \"${IgnoreErrorMessage}\"")
|
message(STATUS "IgnoreErrorMessage = \"${IgnoreErrorMessage}\"")
|
||||||
set(Perl_Script "${TOP_SRC_DIR}/development/autotests/useSystemFonts.pl")
|
set(Perl_Script "${TOP_SRC_DIR}/development/autotests/useSystemFonts.pl")
|
||||||
set(Structure_Script "${TOP_SRC_DIR}/development/autotests/beginEndStructureCheck.pl")
|
set(Structure_Script "${TOP_SRC_DIR}/development/autotests/beginEndStructureCheck.pl")
|
||||||
|
set(readDefaultOutputFormat "${TOP_SRC_DIR}/development/autotests/readDefaultOutputFormat.pl")
|
||||||
set(LanguageFile "${TOP_SRC_DIR}/lib/languages")
|
set(LanguageFile "${TOP_SRC_DIR}/lib/languages")
|
||||||
set(GetTempDir "${TOP_SRC_DIR}/development/autotests/getTempDir.pl")
|
set(GetTempDir "${TOP_SRC_DIR}/development/autotests/getTempDir.pl")
|
||||||
set(_ft ${fonttype})
|
set(_ft ${fonttype})
|
||||||
@ -226,6 +227,23 @@ set(ENV{LANGUAGE} "US:en")
|
|||||||
if (extension MATCHES "\\.lyx$")
|
if (extension MATCHES "\\.lyx$")
|
||||||
include(${TOP_SRC_DIR}/development/autotests/CheckLoadErrors.cmake)
|
include(${TOP_SRC_DIR}/development/autotests/CheckLoadErrors.cmake)
|
||||||
get_md5sum(LYX_SOURCE source_md5sum _err)
|
get_md5sum(LYX_SOURCE source_md5sum _err)
|
||||||
|
message(STATUS "Executing ${PERL_EXECUTABLE} ${readDefaultOutputFormat} ${LYX_SOURCE}")
|
||||||
|
execute_process(
|
||||||
|
COMMAND ${PERL_EXECUTABLE} ${readDefaultOutputFormat} "${LYX_SOURCE}"
|
||||||
|
OUTPUT_VARIABLE _export_format)
|
||||||
|
message(STATUS "readDefaultOutputFormat = ${_export_format}")
|
||||||
|
if (${_export_format} MATCHES "pdf2")
|
||||||
|
set(_texformat "pdflatex")
|
||||||
|
elsif(${_export_format} MATCHES "pdf3")
|
||||||
|
set(_texformat "platex")
|
||||||
|
elsif(${_export_format} MATCHES "pdf4")
|
||||||
|
set(_texformat "xetex")
|
||||||
|
elsif(${_export_format} MATCHES "pdf5")
|
||||||
|
set(_texformat "luatex")
|
||||||
|
else()
|
||||||
|
set(_texformat "empty")
|
||||||
|
endif()
|
||||||
|
|
||||||
foreach(_lv RANGE 1 20)
|
foreach(_lv RANGE 1 20)
|
||||||
set(used_tex_file "${result_file_base}.tex")
|
set(used_tex_file "${result_file_base}.tex")
|
||||||
set(result_file_base "${result_file_base}.${LYX_FORMAT_NUM}")
|
set(result_file_base "${result_file_base}.${LYX_FORMAT_NUM}")
|
||||||
@ -260,9 +278,11 @@ if (extension MATCHES "\\.lyx$")
|
|||||||
break()
|
break()
|
||||||
endif()
|
endif()
|
||||||
message(STATUS "Create the corresponding .tex file \"${used_tex_file}\"")
|
message(STATUS "Create the corresponding .tex file \"${used_tex_file}\"")
|
||||||
execute_process(
|
if (NOT ${_texformat} MATCHES "empty")
|
||||||
COMMAND ${lyx} -userdir "${LYX_TESTS_USERDIR}" -E pdflatex ${used_tex_file} "${LYX_SOURCE}"
|
execute_process(
|
||||||
RESULT_VARIABLE _errx)
|
COMMAND ${lyx} -userdir "${LYX_TESTS_USERDIR}" -E ${_texformat} ${used_tex_file} "${LYX_SOURCE}"
|
||||||
|
RESULT_VARIABLE _errx)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
get_md5sum(result_file_name result_md5sum _err)
|
get_md5sum(result_file_name result_md5sum _err)
|
||||||
@ -284,12 +304,14 @@ if (extension MATCHES "\\.lyx$")
|
|||||||
endif()
|
endif()
|
||||||
message(STATUS "Source(${LYX_SOURCE}) and dest(${result_file_name}) are equal")
|
message(STATUS "Source(${LYX_SOURCE}) and dest(${result_file_name}) are equal")
|
||||||
message(STATUS "Now try to export the lyx2lyx created file")
|
message(STATUS "Now try to export the lyx2lyx created file")
|
||||||
message(STATUS "Executing ${lyx} -userdir \"${LYX_TESTS_USERDIR}\" -E default \"${result_file_name}.default\" \"${result_file_name}\"")
|
if (_export_format MATCHES "^pdf")
|
||||||
execute_process(
|
message(STATUS "Executing ${lyx} -userdir \"${LYX_TESTS_USERDIR}\" -E ${_export_format} \"${result_file_name}.default\" \"${result_file_name}\"")
|
||||||
COMMAND ${lyx} -userdir "${LYX_TESTS_USERDIR}" -E default "${result_file_name}.default" "${result_file_name}"
|
execute_process(
|
||||||
RESULT_VARIABLE _err
|
COMMAND ${lyx} -userdir "${LYX_TESTS_USERDIR}" -E ${_export_format} "${result_file_name}.default" "${result_file_name}"
|
||||||
ERROR_VARIABLE lyxerr)
|
RESULT_VARIABLE _err
|
||||||
Summary(_err "Test-compilation of \"${result_file_name}\" to format default")
|
ERROR_VARIABLE lyxerr)
|
||||||
|
Summary(_err "Test-compilation of \"${result_file_name}\" to format ${_export_format}")
|
||||||
|
endif()
|
||||||
break()
|
break()
|
||||||
else()
|
else()
|
||||||
list(APPEND _TestResultMessage "Warning: \"${LYX_SOURCE}\" and \"${result_file_name}\" differ")
|
list(APPEND _TestResultMessage "Warning: \"${LYX_SOURCE}\" and \"${result_file_name}\" differ")
|
||||||
|
60
development/autotests/readDefaultOutputFormat.pl
Normal file
60
development/autotests/readDefaultOutputFormat.pl
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
#! /usr/bin/env perl
|
||||||
|
# -*- mode: perl; -*-
|
||||||
|
|
||||||
|
#
|
||||||
|
use strict;
|
||||||
|
|
||||||
|
my $useNonTexFonts = undef;
|
||||||
|
my $outputFormat = undef;
|
||||||
|
my $outputFormat = undef;
|
||||||
|
my $language = undef;
|
||||||
|
if (-e "$ARGV[0]") {
|
||||||
|
if (open(FI, "$ARGV[0]")) {
|
||||||
|
while (my $l = <FI>) {
|
||||||
|
chomp($l);
|
||||||
|
if ($l =~ /^\\use_non_tex_fonts\s+([a-z]+)/) {
|
||||||
|
$useNonTexFonts = ($1 eq "true");
|
||||||
|
}
|
||||||
|
elsif ($l =~ /^\\default_output_format\s+([a-z0-9]+)/) {
|
||||||
|
$outputFormat = $1;
|
||||||
|
}
|
||||||
|
elsif ($l =~ /\\language\s+([\-a-z_]+)/) {
|
||||||
|
$language = $1;
|
||||||
|
}
|
||||||
|
last if (defined($useNonTexFonts) && defined($outputFormat) && defined($language));
|
||||||
|
}
|
||||||
|
close(FI);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (defined($useNonTexFonts) && defined($outputFormat)) {
|
||||||
|
if ($useNonTexFonts) {
|
||||||
|
if ($outputFormat eq "default") {
|
||||||
|
if ($language eq "japanese") {
|
||||||
|
$outputFormat = "pdf3";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$outputFormat = "pdf5";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
elsif ($outputFormat eq "default") {
|
||||||
|
if ($language eq "japanese") {
|
||||||
|
$outputFormat = "pdf3";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$outputFormat = "pdf2";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($outputFormat !~ /^pdf/) {
|
||||||
|
$outputFormat = undef;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (defined($outputFormat)) {
|
||||||
|
print "$outputFormat";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
print "undefined_output_format";
|
||||||
|
}
|
||||||
|
|
||||||
|
exit(0);
|
@ -3219,24 +3219,31 @@ def revert_babelfont(document):
|
|||||||
# set preamble stuff
|
# set preamble stuff
|
||||||
pretext = ["%% This document must be processed with xelatex or lualatex!"]
|
pretext = ["%% This document must be processed with xelatex or lualatex!"]
|
||||||
pretext.append("\\AtBeginDocument{%")
|
pretext.append("\\AtBeginDocument{%")
|
||||||
|
have_append = False
|
||||||
if roman != "default":
|
if roman != "default":
|
||||||
pretext.append("\\babelfont{rm}[Mapping=tex-text]{" + roman + "}")
|
pretext.append("\\babelfont{rm}[Mapping=tex-text]{" + roman + "}")
|
||||||
|
have_append = True
|
||||||
if sans != "default":
|
if sans != "default":
|
||||||
sf = "\\babelfont{sf}["
|
sf = "\\babelfont{sf}["
|
||||||
if sf_scale != 100.0:
|
if sf_scale != 100.0:
|
||||||
sf += "Scale=" + str(sf_scale / 100.0) + ","
|
sf += "Scale=" + str(sf_scale / 100.0) + ","
|
||||||
sf += "Mapping=tex-text]{" + sans + "}"
|
sf += "Mapping=tex-text]{" + sans + "}"
|
||||||
pretext.append(sf)
|
pretext.append(sf)
|
||||||
|
have_append = True
|
||||||
if typew != "default":
|
if typew != "default":
|
||||||
tw = "\\babelfont{tt}"
|
tw = "\\babelfont{tt}"
|
||||||
if tt_scale != 100.0:
|
if tt_scale != 100.0:
|
||||||
tw += "[Scale=" + str(tt_scale / 100.0) + "]"
|
tw += "[Scale=" + str(tt_scale / 100.0) + "]"
|
||||||
tw += "{" + typew + "}"
|
tw += "{" + typew + "}"
|
||||||
pretext.append(tw)
|
pretext.append(tw)
|
||||||
|
have_append = True
|
||||||
if osf:
|
if osf:
|
||||||
pretext.append("\\defaultfontfeatures{Numbers=OldStyle}")
|
pretext.append("\\defaultfontfeatures{Numbers=OldStyle}")
|
||||||
pretext.append("}")
|
have_append = True
|
||||||
insert_to_preamble(document, pretext)
|
|
||||||
|
if have_append:
|
||||||
|
pretext.append("}")
|
||||||
|
insert_to_preamble(document, pretext)
|
||||||
|
|
||||||
|
|
||||||
def revert_minionpro(document):
|
def revert_minionpro(document):
|
||||||
|
@ -22,7 +22,6 @@
|
|||||||
|
|
||||||
#include "BiblioInfo.h"
|
#include "BiblioInfo.h"
|
||||||
|
|
||||||
#include <QAbstractListModel>
|
|
||||||
#include <QStandardItemModel>
|
#include <QStandardItemModel>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <QStringListModel>
|
#include <QStringListModel>
|
||||||
|
Loading…
Reference in New Issue
Block a user