Dear LyX developers,
State of the art ================ LyX manuals currently use user-preamble code to set the font depending on the export route and availability: * Latin Modern (CM-extension) with PDF(luatex), PDF(pdflatex), if lmodern.sty is installed * CM-Super (another CM lookalike) with all other export routes, if it is installed. * EC (bitmapped CM-extension) with all other export routes if CM-Super Motivation ========== The idea was, that * we wanted to use the default font (Computer Modern (CM)) with the manuals. * we wanted to use LyX default for the font encoding (T1) instead of the TeX default (the 7-bit OT1 font encoding). Using the T1 font encoding is important for non-english languages using the Latin alphabet, otherwise automatic hyphenation fails and the output quality of non-ASCII letters is bad. However, the default font CM does not exist in T1 encoding and TeX automatically selects a substitution - either CM-Super or EC which both have problems: * CM-Super: large (40MB), said to be of inferior quality to LatinModern * EC: Bitmapped fonts take long with first compilation (must be generated from MetaFont sources in required resolution), have a fixed resolution and look bad in old Acrobat readers. The alternative LatinModern CM-lookalike is not guaranteed to be installed on each system. To prevent an additional dependency for compiling the manuals, the following preamble-selection code was chosen: \usepackage{ifpdf} % part of the hyperref bundle \ifpdf % if pdflatex or lualatex is used \@ifpackageloaded{fontspec}{}{% non-tex-fonts default to LModern % set fonts for nicer pdf view \IfFileExists{lmodern.sty}{\usepackage{lmodern}}{} } \fi % end if pdflatex is used Problems ======== Besides beeing not a good example for LyX-use, there are specific problems with the current implementeation: * Bitmapped EC fonts for PDF(XeTeX), PDF(ps2pdf) and PDF(dvipdfm) * Bitmapped EC fonts for PS * LatinModern 8-bit fonts are used with LuaTeX, even if "use-non-TeX-fonts" is selected. This leads to failures in some of our export tests: > For the test with non-TeX fonts, the preamble code involving lmodern.sty > must be changed, otherwise 8-bit fonts are used with wrong font encoding! > One possibility would be to remove the special casing altogether, > possibly selecting a better font in the GUI (but this was rejected some > years ago). > Another option is the following patch (similar in all places where this > preamble code is used): > --- a/lib/doc/fr/UserGuide.lyx > +++ b/lib/doc/fr/UserGuide.lyx > @@ -15,11 +15,11 @@ > % email: lyx-d...@lists.lyx.org > \usepackage{ifpdf} % part of the hyperref bundle > -\ifpdf % if pdflatex is used > - > +\ifpdf % if pdflatex or lualatex is used > +\@ifpackageloaded{fontspec}{}{% non-tex-fonts default to LModern > % set fonts for nicer pdf view > \IfFileExists{lmodern.sty}{\usepackage{lmodern}}{} > - > +} > \fi % end if pdflatex is used > % for correct jump positions whe clicking on a link to a float My preferred solution is still to use not only a LyX-recommended non-default font encoding, but also a matching LyX-recommended non-default font, set via the GUI. * Latin Modern is the community-recommended (but not automatically used) "international" substitution for CM. + It comes with optical sizes and mixes well with the default math fonts. - It is too light for good on-screen reading. - It is not a required part of TeX. * The PSNFSS fonts http://www.ctan.org/tex-archive/macros/latex/required/psnfss/ can be set via the LyX GUI and support the T1 font encoding. + required with every TeX installation - no optical sizes - sub-optimal mix with math fonts without additional packages (acceptable for Palatino (mathpazo) in simple use cases). Günter