From 6cf1d2be8ef6b6f20ef697d9d73e574d40247b29 Mon Sep 17 00:00:00 2001 From: =?utf8?q?G=C3=BCnter=20Milde?= Date: Tue, 3 Sep 2019 22:54:05 +0200 Subject: [PATCH] ctests: update supported-languages tests. Simplify user preamble. Use common test document for Xe- and LuaTeX with polyglossia and special one for languages only supported by XeTeX. Update tagging patterns and comments. --- .../latex/languages/supported-languages.lyx | 152 ++++++++++++------ ...supported-languages_polyglossia-XeTeX.lyx} | 81 ++++++---- .../supported-languages_polyglossia.lyx | 90 +++++++---- development/autotests/ignoredTests | 2 +- development/autotests/invertedTests | 6 +- development/autotests/unreliableTests | 28 ++-- 6 files changed, 233 insertions(+), 126 deletions(-) rename autotests/export/latex/languages/{supported-languages_luatex.lyx => supported-languages_polyglossia-XeTeX.lyx} (68%) diff --git a/autotests/export/latex/languages/supported-languages.lyx b/autotests/export/latex/languages/supported-languages.lyx index 8bdb02d516..d2ba3adcad 100644 --- a/autotests/export/latex/languages/supported-languages.lyx +++ b/autotests/export/latex/languages/supported-languages.lyx @@ -5,48 +5,6 @@ \save_transient_properties true \origin unavailable \textclass scrartcl -\begin_preamble -\@ifpackageloaded{fontspec}{ -\ifdefined\luatexversion\else - \newfontfamily\amharicfont[Script=Ethiopic]{Noto Sans Ethiopic} -\fi -\newfontfamily\churchslavonicfont[Script=Cyrillic]{MonomakhUnicode} -\newfontfamily\devanagarifont[Script=Devanagari]{Noto Sans Devanagari} -\newfontfamily\hangulfont[Script=Hangul]{Baekmuk Batang} -\newfontfamily\kannadafont[Script=Kannada]{Noto Serif Kannada} -\newfontfamily\khmerfont[Script=Khmer]{Noto Serif Khmer} -\newfontfamily\laofont[Script=Lao]{Noto Serif Lao} -% gloss-marathi.ldf has a spelling error: "script=Devaganari" -\newfontfamily\marathifont[Script=Devanagari]{Noto Sans Devanagari} -% prevent spurious polyglossia error (missing script tag): -\newfontfamily\syriacfont[Script=Syriac]{FreeSans} -\newfontfamily\tamilfont[Script=Tamil]{Noto Serif Tamil} -\newfontfamily\telugufont[Script=Telugu]{Noto Serif Telugu} -\newfontfamily\thaanafont[Script=Thaana]{Noto Sans Thaana} -\newfontfamily\tibetanfont[Script=Tibetan]{Noto Sans Tibetan} - -% Font setup for Japanese (not supported by Polyglossia) -% with XeTeX, https://ctan.org/pkg/xecjk -\usepackage{ifxetex} -\ifxetex - \usepackage{xeCJK} - \setCJKmainfont{IPAexMincho} - \setCJKsansfont{IPAexGothic} -\fi -% with LuaTeX, https://www.ctan.org/pkg/luatexja -% see https://tex.stackexchange.com/questions/222980/how-to-use-chinese-with-lualatex -\usepackage{ifluatex} -\ifluatex - %\usepackage{luatexja-fontspec} - % use Mainfont (DejaVu) for Greek and Cyrillic: - %\ltjsetparameter{jacharrange={-2}} - %\usepackage[match]{luatexja-fontspec} - %\setmainjfont[Mapping=tex-text]{WenQuanYi Micro Hei} - %\setsansjfont[Mapping=tex-text]{WenQuanYi Micro Hei} - %\setmonojfont{WenQuanYi Micro Hei Mono} -\fi -}{} -\end_preamble \use_default_options false \begin_modules enumitem @@ -3407,12 +3365,17 @@ status open \end_inset +\begin_inset Branch polyglossia-only +inverted 0 +status open + +\begin_layout Standard \begin_inset Branch conflict-ko -inverted 1 +inverted 0 status open \begin_layout Standard -\begin_inset Branch polyglossia-only +\begin_inset Branch conflict-luatex inverted 0 status open @@ -3433,6 +3396,11 @@ status open \end_inset +\end_layout + +\end_inset + + \end_layout \begin_layout Labeling @@ -3496,9 +3464,32 @@ utf8-cjk \begin_layout Itemize XeTeX and LuaTeX work only with non-TeX fonts. - Font setup with XeCJK conflicts with Polyglossia-Korean. + +\end_layout + +\begin_deeper +\begin_layout Itemize +Font setup with +\emph on +XeCJK +\emph default + is ignored with +\emph on +Polyglossia +\emph default + if the document contains text marked up as Korean. +\end_layout + +\begin_layout Itemize +Font setup with +\emph on +luatexja-fontspec +\emph default + affects some non-Japanese characters (here, missing U+2059 FIVE DOT PUNCTUATION + (Church Slavonic) and some typographical quotes). \end_layout +\end_deeper \begin_layout Subsection* Kannada \end_layout @@ -3680,13 +3671,13 @@ Korean \end_layout \begin_layout Standard -\begin_inset Branch conflict-ko +\begin_inset Branch polyglossia-only inverted 0 status open \begin_layout Standard -\begin_inset Branch polyglossia-only -inverted 0 +\begin_inset Branch conflict-ko +inverted 1 status open \begin_layout Quote @@ -3753,7 +3744,7 @@ LangCode ko_KR \begin_layout Labeling \labelwidthstring 00.00.0000 -Requires CJK +Requires CJK or Polyglossia \end_layout \begin_layout Itemize @@ -3764,9 +3755,70 @@ The different CJK languages (simplified and traditional Chinese, Japanese, \begin_layout Itemize XeTeX and LuaTeX work only with non-TeX fonts. - Font setup with XeCJK conflicts with Polyglossia-Korean. + \end_layout +\begin_deeper +\begin_layout Itemize +Font setup with +\emph on +XeCJK +\emph default + is ignored when using +\emph on + Polyglossia +\emph default +. +\end_layout + +\begin_layout Itemize +LuaTeX finishes with exit value 1 +\emph on + +\emph default +and error message +\end_layout + +\begin_deeper +\begin_layout LyX-Code +[ +\backslash +directlua]:1: You cannot set field spec in a node of type glue +\end_layout + +\begin_layout Standard +\paragraph_spacing single +It seems that +\emph on +gloss-korean.ldf +\emph default + (unnumbered Version from Debian/stable, Mar +\begin_inset space ~ +\end_inset + +25 2016) has an error somewhere in the directlua definitions. + This leads to LyX reporting a LaTeX error. + The generated PDF can be viewed via +\family sans +Document>LaTeX +\begin_inset space ~ +\end_inset + +log>Open +\begin_inset space ~ +\end_inset + +containing +\begin_inset space ~ +\end_inset + +directory +\family default +. +\end_layout + +\end_deeper +\end_deeper \begin_layout Subsection* Kurmanji \end_layout diff --git a/autotests/export/latex/languages/supported-languages_luatex.lyx b/autotests/export/latex/languages/supported-languages_polyglossia-XeTeX.lyx similarity index 68% rename from autotests/export/latex/languages/supported-languages_luatex.lyx rename to autotests/export/latex/languages/supported-languages_polyglossia-XeTeX.lyx index 2b0f890944..15a96f4b0d 100644 --- a/autotests/export/latex/languages/supported-languages_luatex.lyx +++ b/autotests/export/latex/languages/supported-languages_polyglossia-XeTeX.lyx @@ -6,34 +6,42 @@ \origin unavailable \textclass scrartcl \begin_preamble -%\newfontfamily\amharicfont{Noto Sans Ethiopic} -\newfontfamily\churchslavonicfont[Script=Cyrillic]{MonomakhUnicode} -\newfontfamily\devanagarifont[Script=Devanagari]{Noto Sans Devanagari} -\newfontfamily\hangulfont[Script=Hangul]{Baekmuk Batang} -\newfontfamily\kannadafont[Script=Kannada]{Noto Serif Kannada} -\newfontfamily\khmerfont[Script=Khmer]{Noto Serif Khmer} -\newfontfamily\laofont[Script=Lao]{Noto Serif Lao} -% gloss-marathi.ldf has a spelling error: "script=Devaganari" -\newfontfamily\marathifont[Script=Devanagari]{Noto Sans Devanagari} -\newfontfamily\syriacfont[Script=Syriac]{FreeSans} -\newfontfamily\tamilfont[Script=Tamil]{Noto Serif Tamil} -\newfontfamily\telugufont[Script=Telugu]{Noto Serif Telugu} -\newfontfamily\thaanafont[Script=Thaana]{Noto Sans Thaana} -\newfontfamily\tibetanfont[Script=Tibetan]{Noto Sans Tibetan} - +\newfontfamily\amharicfont{Noto Sans Ethiopic} +\newfontfamily\churchslavonicfont{Monomakh Unicode} +\newfontfamily\devanagarifont{Noto Serif Devanagari} +\newfontfamily\hangulfont{Baekmuk Batang} +\newfontfamily\kannadafont{Noto Serif Kannada} +\newfontfamily\khmerfont{Noto Serif Khmer} +\newfontfamily\laofont{Noto Serif Lao} +\newfontfamily\marathifont{FreeSerif} % gloss-marathi.ldf has a spelling error: "script=Devaganari" +%\newfontfamily\marathifont{Noto Serif Devanagari} % works, too +\newfontfamily\syriacfont{FreeSans} +\newfontfamily\tamilfont{Noto Serif Tamil} +\newfontfamily\telugufont{Noto Serif Telugu} +\newfontfamily\thaanafont{FreeSerif} % missing script tag +%\newfontfamily\thaanafont{Noto Sans Thaana} % works, too +\newfontfamily\tibetanfont{Noto Sans Tibetan} % Font setup for Japanese (not supported by Polyglossia) +\usepackage{ifxetex} +\ifxetex + \usepackage{xeCJK} % https://ctan.org/pkg/xecjk + \setCJKmainfont{IPAexMincho} + \setCJKsansfont{IPAexGothic} +\else % with LuaTeX, https://www.ctan.org/pkg/luatexja % see https://tex.stackexchange.com/questions/222980/how-to-use-chinese-with-lualatex -% Unfortunately, this conflicts with Korean font setup via Polyglossia. -\ifdefined\luatexversion - %\usepackage{luatexja-fontspec} - % use Mainfont (DejaVu) for Greek and Cyrillic: - %\ltjsetparameter{jacharrange={-2}} - %\usepackage[match]{luatexja-fontspec} - %\setmainjfont[Mapping=tex-text]{WenQuanYi Micro Hei} - %\setsansjfont[Mapping=tex-text]{WenQuanYi Micro Hei} - %\setmonojfont{WenQuanYi Micro Hei Mono} +% Unfortunately, this conflicts with Korean font setup via Polyglossia +% and leads to missing glyphs: (church slavonic ⁙ (U+2059)) and +% typographical quotes). +% \ifdefined\luatexversion +% %\usepackage{luatexja-fontspec} +% \usepackage[match]{luatexja-fontspec} +% % use Mainfont for Greek and Cyrillic: +% \ltjsetparameter{jacharrange={-2}} +% \setmainjfont{IPAexMincho} +% \setsansjfont{IPAexGothic} +% %\setmonojfont{WenQuanYi Micro Hei Mono} \fi \end_preamble \use_default_options false @@ -61,7 +69,7 @@ enumitem \use_microtype false \use_dash_ligatures true \graphics default -\default_output_format pdf5 +\default_output_format pdf4 \output_sync 0 \bibtex_command default \index_command default @@ -158,7 +166,12 @@ enumitem \color #faf0e6 \end_branch \branch conflict-luatex -\selected 0 +\selected 1 +\filename_suffix 0 +\color #faf0e6 +\end_branch +\branch conflict-ko +\selected 1 \filename_suffix 0 \color #faf0e6 \end_branch @@ -196,7 +209,21 @@ With language examples that work with \emph on Polyglossia \emph default - and LuaTeX. + and XeTeX. +\end_layout + +\begin_layout Standard +Some languages require set up of a complementary font in the +\emph on +user preamble +\emph default + ( +\family sans +Document\SpecialChar menuseparator +Settings\SpecialChar menuseparator +LaTeX preamble +\family default +). \end_layout \begin_layout Standard diff --git a/autotests/export/latex/languages/supported-languages_polyglossia.lyx b/autotests/export/latex/languages/supported-languages_polyglossia.lyx index 37a4688b83..aa1e50f738 100644 --- a/autotests/export/latex/languages/supported-languages_polyglossia.lyx +++ b/autotests/export/latex/languages/supported-languages_polyglossia.lyx @@ -6,42 +6,45 @@ \origin unavailable \textclass scrartcl \begin_preamble -\newfontfamily\amharicfont{Noto Sans Ethiopic} -\newfontfamily\churchslavonicfont[Script=Cyrillic]{MonomakhUnicode} -\newfontfamily\devanagarifont[Script=Devanagari]{Noto Serif Devanagari} -\newfontfamily\hangulfont[Script=Hangul]{Baekmuk Batang} -\newfontfamily\kannadafont[Script=Kannada]{Noto Serif Kannada} -\newfontfamily\khmerfont[Script=Khmer]{Noto Serif Khmer} -\newfontfamily\laofont[Script=Lao]{Noto Serif Lao} -% gloss-marathi.ldf has a spelling error: "script=Devaganari" -\newfontfamily\marathifont[Script=Devanagari]{Noto Serif Devanagari} -% prevent spurious polyglossia error (missing script tag): -\newfontfamily\syriacfont[Script=Syriac]{FreeSans} -\newfontfamily\tamilfont[Script=Tamil]{Noto Serif Tamil} -\newfontfamily\telugufont[Script=Telugu]{Noto Serif Telugu} -\newfontfamily\thaanafont[Script=Thaana]{Noto Sans Thaana} -\newfontfamily\tibetanfont[Script=Tibetan]{Noto Sans Tibetan} +% Setup complementing fonts with Polyglossia: +% \newfontfamily\amharicfont{Noto Sans Ethiopic} % LuaTeX does not find it +\newfontfamily\churchslavonicfont{Monomakh Unicode} +\newfontfamily\devanagarifont{Noto Serif Devanagari} +\newfontfamily\hangulfont{Baekmuk Batang} +\newfontfamily\kannadafont{Noto Serif Kannada} +\newfontfamily\khmerfont{Noto Serif Khmer} +%\newfontfamily\laofont{Noto Serif Lao} % misses punctuation in current versions. +\newfontfamily\laofont{DejaVu Sans} +\newfontfamily\marathifont{FreeSerif} % gloss-marathi.ldf has a spelling error: "script=Devaganari" +%\newfontfamily\marathifont{Noto Serif Devanagari} % works, too +\newfontfamily\syriacfont{FreeSans} +\newfontfamily\tamilfont{Noto Serif Tamil} +\newfontfamily\telugufont{Noto Serif Telugu} +\newfontfamily\thaanafont{FreeSerif} % missing script tag in FreeSerif +%\newfontfamily\thaanafont{Noto Sans Thaana} % works, too +\newfontfamily\tibetanfont{Noto Sans Tibetan} % Font setup for Japanese (not supported by Polyglossia) -% with XeTeX, https://ctan.org/pkg/xecjk \usepackage{ifxetex} \ifxetex - \usepackage{xeCJK} + \usepackage{xeCJK} % https://ctan.org/pkg/xecjk \setCJKmainfont{IPAexMincho} \setCJKsansfont{IPAexGothic} -\fi +\else % with LuaTeX, https://www.ctan.org/pkg/luatexja % see https://tex.stackexchange.com/questions/222980/how-to-use-chinese-with-lualatex -\usepackage{ifluatex} -\ifluatex - \usepackage{luatexja-fontspec} - % use Mainfont (DejaVu) for Greek and Cyrillic: - \ltjsetparameter{jacharrange={-2}} - %\usepackage[match]{luatexja-fontspec} - %\setmainjfont[Mapping=tex-text]{WenQuanYi Micro Hei} - %\setsansjfont[Mapping=tex-text]{WenQuanYi Micro Hei} - %\setmonojfont{WenQuanYi Micro Hei Mono} +% Unfortunately, this conflicts with Korean font setup via Polyglossia +% and leads to missing glyphs: (church slavonic ⁙ (U+2059)) and +% typographical quotes). +% \ifdefined\luatexversion +% %\usepackage{luatexja-fontspec} +% \usepackage[match]{luatexja-fontspec} +% % use Mainfont for Greek and Cyrillic: +% \ltjsetparameter{jacharrange={-2}} +% \setmainjfont{IPAexMincho} +% \setsansjfont{IPAexGothic} +% %\setmonojfont{WenQuanYi Micro Hei Mono} \fi \end_preamble \use_default_options false @@ -166,7 +169,12 @@ enumitem \color #faf0e6 \end_branch \branch conflict-luatex -\selected 1 +\selected 0 +\filename_suffix 0 +\color #faf0e6 +\end_branch +\branch conflict-ko +\selected 0 \filename_suffix 0 \color #faf0e6 \end_branch @@ -202,9 +210,31 @@ Languages supported by LyX \begin_layout Standard With language examples that work with \emph on -Polyglossia +Polyglossia, +\emph default + XeTeX or LuaTeX, and +\begin_inset Quotes eld +\end_inset + +non-TeX fonts +\begin_inset Quotes erd +\end_inset + +. +\end_layout + +\begin_layout Standard +Some languages require set up of a complementary font in the +\emph on +user preamble \emph default - and non-TeX fonts. + ( +\family sans +Document\SpecialChar menuseparator +Settings\SpecialChar menuseparator +LaTeX preamble +\family default +). \end_layout \begin_layout Standard diff --git a/development/autotests/ignoredTests b/development/autotests/ignoredTests index aa36a7011d..8790431ebf 100644 --- a/development/autotests/ignoredTests +++ b/development/autotests/ignoredTests @@ -184,7 +184,7 @@ export/export/latex/lyxbugs/6197-polish-amssymb_pdf5_systemF # don't test with TeX fonts: export/export/latex/languages/supported-languages_babel_non-tex_.*(dvi|pdf.?|texF) export/export/latex/languages/supported-languages_polyglossia_.*(dvi|pdf.?|texF) -export/export/latex/languages/supported-languages_luatex_.*(dvi|pdf.?|texF) +export/export/latex/languages/supported-languages_XeTeX_.*(dvi|pdf.?|texF) export/export/latex/lyxbugs-resolved/9633-.*(dvi|pdf.?|texF) export/export/latex/lyxbugs/11522-systemfonts-Math-missingchars_pdf5_texF diff --git a/development/autotests/invertedTests b/development/autotests/invertedTests index d61510f324..4bd9c5728c 100644 --- a/development/autotests/invertedTests +++ b/development/autotests/invertedTests @@ -214,11 +214,7 @@ export/doc/(sk|nb)/Intro_(dvi3|pdf5)_systemF # l.53 \newXeTeXintercharclass # * RTL-languages: ! Undefined control sequence. # \setLR ->\@RTLfalse \luatexpardir -export/export/latex/languages/supported-languages_polyglossia_(dvi3|pdf5)_systemF - -# Systemcall: 'lualatex "supported-languages.tex"' finished with exit code 1 -# but no error in log and PDF is fine -export/export/latex/languages/supported-languages_luatex_(dvi3|pdf5)_systemF +export/export/latex/languages/supported-languages_polyglossia_XeTeX_(dvi3|pdf5)_systemF # Some packages fail with XeTeX/LuaTeX diff --git a/development/autotests/unreliableTests b/development/autotests/unreliableTests index 5cb6c10a86..c50a0d35ee 100644 --- a/development/autotests/unreliableTests +++ b/development/autotests/unreliableTests @@ -103,8 +103,8 @@ export/export/latex/languages/supported-languages_.*_pdf3 # * as a consequence, `ps2pdf` fails for some documents: export/.*/ja/.*_pdf -# "exotic" languages require "exotic" fonts, e.g. -# MonomakhUnicode (from Debian package "texlive-fonts-extra") or sci.ponomar.net/fonts.html +# "exotic" languages require "exotic" *system* fonts, e.g. +# Monomakh Unicode (from Debian package "texlive-fonts-extra" or sci.ponomar.net/fonts.html) # Noto Serif Devanagari (from Debian package "fonts-noto-hinted") export/export/latex/languages/supported-languages_polyglossia_.*_systemF @@ -123,22 +123,15 @@ Sublabel: erratic Sublabel: varying_versions ########################## -# Test depending on e.g. OS or version of a non-TeX-Live dependency. -# Note that a full, up-to-date TeX Live installation is required so this -# sublabel is about versions of other dependencies. +# If a test with this tag fails, this may be due to, e.g., the OS +# or the version of a dependency. # Encoding cp858 only supported by some iconv variants # Gnu iconv only supports it, if configured with "--enable-extra-encodings" # (see https://www.gnu.org/software/libiconv/) export/export/latex/inputenc-cp858_pdf2 -# aastex: hard-coded version in class name: -# 2018-05-12 aastex6.cls -> aastex62.cls -export/examples/Articles/American_Astronomical_Society_.* -export/templates/Articles/American_Astronomical_Society_.* - - -# New failures with current TexLive (works with TL16/17 from Debian/stable) +# Fails with current TexLive (works with TL16/17 from Debian/stable) # ------------------------------------------------------------------------- # (see "invertedTests" for description) @@ -163,15 +156,24 @@ export/export/latex/languages/supported-languages_babel_non-tex_pdf4_systemF # Fails with TL16/17 from Debian/stable (resolved with new TexLive) # ------------------------------------------------------------------------- +# aastex: hard-coded version in class name: +# 2018-05-12 aastex6.cls -> aastex62.cls +export/examples/Articles/American_Astronomical_Society_.* +export/templates/Articles/American_Astronomical_Society_.* + # LuaTeX for Japanese documents using graphicx.sty # ! Package pdftex.def Error: Option `pdftex' requires pdfTeX, # (pdftex.def) but pdfTeX features are missing. export/doc/ja/Tutorial_(dvi3|pdf5)_systemF # Korean with LuaTeX: -# Language korean not found in language.dat.lua +# pop-up: "external command lualatex finished with an error" +# terminal message: +# Language korean not found in language.dat.lua +# [\directlua]:1: You cannot set field spec in a node of type glue export/examples/ko/Welcome_(dvi3|pdf5)_systemF export/export/latex/CJK/en-de-el-ru-ko_utf8_(dvi3|pdf5)_systemF +export/export/latex/languages/supported-languages_polyglossia_(dvi3|pdf5)_systemF # Arabic Beamer example export/examples/ar/Presentations/Beamer_pdf4_.* -- 2.39.5