]> git.lyx.org Git - features.git/commitdiff
Fix bug #6469: Times Roman and \textgreek produce error with pdflatex on a PC
authorEnrico Forestieri <forenr@lyx.org>
Sat, 23 Jan 2010 17:24:58 +0000 (17:24 +0000)
committerEnrico Forestieri <forenr@lyx.org>
Sat, 23 Jan 2010 17:24:58 +0000 (17:24 +0000)
The problem here is that the metafont sources and tfm files are missing
in normal installations, because the Times Roman Greek fonts are not free
and should be purchased. When the grtimes package is not installed, the
fonts are substitued with cmr glyphs. However, if grtimes is installed
and and the actual fonts are missing, an error is generated. So, we simply
check whether the greek fonts are installed and, if they are not, we
perform the font substitution by ourselves. In this way the error is
avoided whether grtimes is installed or not.

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

src/LaTeXFeatures.cpp

index 7b32eac8a13ee6c7ae76b2b00d5288d5bf9502f1..1629186280413fe8ba5d87bcd18f183f107ed095 100644 (file)
@@ -804,8 +804,19 @@ docstring const LaTeXFeatures::getMacros() const
        if (mustProvide("lyxarrow"))
                macros << lyxarrow_def << '\n';
 
-       if (mustProvide("textgreek"))
-               macros << textgreek_def << '\n';
+       if (mustProvide("textgreek")) {
+               // Avoid a LaTeX error if times fonts are used and the grtimes
+               // package is installed but actual fonts are not (bug 6469).
+               if (params_.fontsRoman == "times")
+                       macros << subst(textgreek_def,
+                                       from_ascii("\\greektext #1"),
+                                       from_ascii("%\n  \\IfFileExists"
+                                                  "{grtm10.tfm}{}{\\fontfamily"
+                                                  "{cmr}}\\greektext #1"))
+                              << '\n';
+               else
+                       macros << textgreek_def << '\n';
+       }
 
        if (mustProvide("textcyr"))
                macros << textcyr_def << '\n';