4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Jürgen Spitzmüller
9 * Full author contact details are available in file CREDITS.
15 #include "support/docstring.h"
25 /// LaTeX Font definition
29 LaTeXFont() : switchdefault_(false) {}
31 docstring const & name() { return name_; }
32 /// The name to appear in the document dialog
33 docstring const & guiname() { return guiname_; }
34 /// Font family (rm, sf, tt)
35 docstring const & family() { return family_; }
36 /// The package that provides this font
37 docstring const & package() { return package_; }
38 /// Alternative packages if package() is not available
39 std::vector<docstring> const & altpackages() { return altpackages_; }
40 /// A package that provides all families
41 docstring const & completepackage() { return completepackage_; }
42 /// A package specifically needed for OT1 font encoding
43 docstring const & ot1package() { return ot1package_; }
44 /// A package that provides Old Style Figures for this font
45 docstring const & osfpackage() { return osfpackage_; }
46 /// A package option for Old Style Figures
47 docstring const & osfoption() { return osfoption_; }
48 /// A package option for true SmallCaps
49 docstring const & scoption() { return scoption_; }
50 /// A package option for both Old Style Figures and SmallCaps
51 docstring const & osfscoption() { return osfscoption_; }
52 /// A package option for font scaling
53 docstring const & scaleoption() { return scaleoption_; }
54 /// Alternative requirement to test for
55 docstring const & requires() { return requires_; }
56 /// Issue the familydefault switch
57 bool switchdefault() const { return switchdefault_; }
58 /// Is this font available?
59 bool available(bool ot1 = false) const;
60 /// Does this font provide Old Style Figures?
61 bool providesOSF(bool ot1 = false) const;
62 /// Does this font provide optional true SmallCaps?
63 bool providesSC(bool ot1 = false) const;
64 /// Does this font provide scaling?
65 bool providesScale(bool ot1 = false) const;
66 /// Return the preferred available package
67 std::string const getAvailablePackage(bool ot1 = false, bool complete = false);
68 /// Return the package options
69 std::string const getPackageOptions(bool const & ot1,
72 int const & scale = 100);
74 bool read(Lexer & lex);
76 bool readFont(Lexer & lex);
87 std::vector<docstring> altpackages_;
89 docstring completepackage_;
91 docstring ot1package_;
93 docstring osfpackage_;
99 docstring osfscoption_;
101 docstring scaleoption_;
113 /** The list of available LaTeX fonts
118 typedef std::map<docstring, LaTeXFont> TexFontMap;
119 /// Get all LaTeXFonts
120 TexFontMap getLaTeXFonts();
121 /// Get a specific LaTeXFont \p name
122 LaTeXFont getLaTeXFont(docstring const & name);
125 void readLaTeXFonts();
127 TexFontMap texfontmap_;
130 /// Implementation is in LyX.cpp
131 extern LaTeXFonts & theLaTeXFonts();