]> git.lyx.org Git - features.git/commitdiff
Check for fontspec an configure the GUI accordingly.
authorJürgen Spitzmüller <spitz@lyx.org>
Wed, 9 Feb 2011 08:23:11 +0000 (08:23 +0000)
committerJürgen Spitzmüller <spitz@lyx.org>
Wed, 9 Feb 2011 08:23:11 +0000 (08:23 +0000)
If fontspec is not found, the "Use non-TeX fonts" checkbox is disabled, and the tooltip hints at installing the package.
Also add fontspec to LaTeXConfig.lyx, documenting that v2 of the package is needed for LuaTeX support.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37567 a592a061-630c-0410-9148-cb99ea01b6c8

lib/chkconfig.ltx
lib/doc/LaTeXConfig.lyx
src/frontends/qt4/GuiDocument.cpp

index c02902a5664463cf7d3ea0bcb897867d558fe834..95ea1fe2b1423ba9f0b59225d7d4e8315ef04ae8 100644 (file)
 \TestPackage{endnotes}
 \TestPackage{enumitem}
 \TestPackage{esint}
+\TestPackage{fontspec}
 \TestPackage{hhline}
 \TestPackage{ifsym}
 \TestPackage{ifthen}
index c4e64230ab1fe9c4828f0a3966fc623e0b2ae1d2..b875fa772041444e2503518bdc9397d3ef43eb33 100644 (file)
@@ -1,11 +1,12 @@
 #LyX 2.0.0svn created this file. For more info see http://www.lyx.org/
-\lyxformat 410
+\lyxformat 412
 \begin_document
 \begin_header
 \textclass article
 \use_default_options false
 \maintain_unincluded_children false
 \language english
+\language_package default
 \inputencoding default
 \fontencoding global
 \font_roman default
@@ -448,6 +449,37 @@ Diagram
 ).
 \end_layout
 
+\begin_layout Subsection
+fontspec
+\end_layout
+
+\begin_layout Description
+Found: 
+\begin_inset Info
+type  "package"
+arg   "fontspec"
+\end_inset
+
+
+\end_layout
+
+\begin_layout Description
+CTAN: 
+\family typewriter
+macros/latex/contrib/fontspec
+\end_layout
+
+\begin_layout Description
+Notes: The package 
+\family sans
+fontspec
+\family default
+ provides access to your Operating System's OpenType, TrueType and PostScript
+ fonts.
+ The package needs either the XeTeX or the LuaTeX engine for this.
+ Note that LuaTeX is only supported as of fontspec version 2.0 (2010/07/11).
+\end_layout
+
 \begin_layout Subsection
 fourier-GUTenberg
 \end_layout
index 01389e9b38003208fa240c7c993427bb5a82c9bd..a73a12f877fe48fa6ff1699b0d53517512b96989 100644 (file)
@@ -798,6 +798,11 @@ GuiDocument::GuiDocument(GuiView & lv)
                fontModule->fontsDefaultCO->addItem(
                        qt_(GuiDocument::fontfamilies_gui[n]));
 
+       if (!LaTeXFeatures::isAvailable("fontspec"))
+               fontModule->osFontsCB->setToolTip(
+                       qt_("Use OpenType- and TrueType fonts directly (requires XeTeX or LuaTeX)\n"
+                           "You need to install the package \"fontspec\" to use this feature"));
+
 
        // page layout
        pageLayoutModule = new UiWidget<Ui::PageLayoutUi>;
@@ -2874,9 +2879,12 @@ void GuiDocument::paramsToDialog()
        if (index == -1)
                index = 0;
        outputModule->defaultFormatCO->setCurrentIndex(index);
-       fontModule->osFontsCB->setEnabled(bp_.baseClass()->outputType() == lyx::LATEX);
+       bool const os_fonts_available =
+               bp_.baseClass()->outputType() == lyx::LATEX
+               && LaTeXFeatures::isAvailable("fontspec");
+       fontModule->osFontsCB->setEnabled(os_fonts_available);
        fontModule->osFontsCB->setChecked(
-               bp_.baseClass()->outputType() == lyx::LATEX && bp_.useNonTeXFonts);
+               os_fonts_available && bp_.useNonTeXFonts);
 
        outputModule->outputsyncCB->setChecked(bp_.output_sync);
        outputModule->synccustomCB->setEditText(toqstr(bp_.output_sync_macro));
@@ -2889,7 +2897,7 @@ void GuiDocument::paramsToDialog()
        updateFontsize(documentClass().opt_fontsize(),
                        bp_.fontsize);
 
-       if (bp_.useNonTeXFonts) {
+       if (bp_.useNonTeXFonts && os_fonts_available) {
                fontModule->fontencLA->setEnabled(false);
                fontModule->fontencCO->setEnabled(false);
                fontModule->fontencLE->setEnabled(false);