mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Preamble tag for LaTeXFonts (#8530)
This commit is contained in:
parent
33e185e5ed
commit
9cbba74a62
@ -22,6 +22,9 @@
|
||||
# OsfScOption <option for combined osf and true smallcaps support>
|
||||
# ScaleOption <option for font scaling>
|
||||
# Provides <features provided by the font packages (comma-separated)>
|
||||
# Preamble
|
||||
# <some arbitrary LaTeX code to be issued in the preamble>
|
||||
# EndPreamble
|
||||
# EndFont
|
||||
#
|
||||
#
|
||||
@ -53,8 +56,8 @@
|
||||
# The value "none" tells LyX not to load any font in OT1 encoding.
|
||||
# OT1Fonts need to be defined separately using AltFont ... EndFont tags.
|
||||
# * The CompleteFont is loaded if the current font is selected as rm and
|
||||
# both sf and tt are set to "default" (this allows f. ex. to load "bera"
|
||||
# as opposed to "beraserif").
|
||||
# both sf and tt are set to "default" (this allows for instance to load
|
||||
# "bera" as opposed to "beraserif").
|
||||
# CompleteFonts need to be defined separately using AltFont ... EndFont
|
||||
# tags.
|
||||
# * OsfFont is a font that is loaded additionally in and that provides
|
||||
@ -65,9 +68,12 @@
|
||||
# default and provide an option for lining figures. Pass this option
|
||||
# to OsfOption.
|
||||
# * ScaleOption supports the placeholder $$val for the scale value.
|
||||
# * The Preamble code is output immediately after the respective font
|
||||
# loading command.
|
||||
#
|
||||
##########################################################################
|
||||
|
||||
|
||||
#
|
||||
# ROMAN FONTS
|
||||
#
|
||||
|
@ -275,6 +275,9 @@ string const LaTeXFont::getLaTeXCode(bool dryrun, bool ot1, bool complete, bool
|
||||
if (osf && providesOSF(ot1, complete, nomath) && !osffont_.empty())
|
||||
os << altFont(osffont_).getLaTeXCode(dryrun, ot1, complete, sc, osf, nomath, scale);
|
||||
|
||||
if (!preamble_.empty())
|
||||
os << preamble_;
|
||||
|
||||
return os.str();
|
||||
}
|
||||
|
||||
@ -295,6 +298,7 @@ bool LaTeXFont::readFont(Lexer & lex)
|
||||
LF_OT1_FONT,
|
||||
LF_PACKAGE,
|
||||
LF_PACKAGEOPTION,
|
||||
LF_PREAMBLE,
|
||||
LF_PROVIDES,
|
||||
LF_REQUIRES,
|
||||
LF_SCALEOPTION,
|
||||
@ -317,6 +321,7 @@ bool LaTeXFont::readFont(Lexer & lex)
|
||||
{ "ot1font", LF_OT1_FONT },
|
||||
{ "package", LF_PACKAGE },
|
||||
{ "packageoption", LF_PACKAGEOPTION },
|
||||
{ "preamble", LF_PREAMBLE },
|
||||
{ "provides", LF_PROVIDES },
|
||||
{ "requires", LF_REQUIRES },
|
||||
{ "scaleoption", LF_SCALEOPTION },
|
||||
@ -386,6 +391,9 @@ bool LaTeXFont::readFont(Lexer & lex)
|
||||
case LF_PACKAGEOPTION:
|
||||
lex >> packageoption_;
|
||||
break;
|
||||
case LF_PREAMBLE:
|
||||
preamble_ = lex.getLongString("EndPreamble");
|
||||
break;
|
||||
case LF_PROVIDES: {
|
||||
lex.eatLine();
|
||||
string features = lex.getString();
|
||||
|
@ -127,6 +127,8 @@ private:
|
||||
///
|
||||
docstring requires_;
|
||||
///
|
||||
std::string preamble_;
|
||||
///
|
||||
bool osfdefault_;
|
||||
///
|
||||
bool switchdefault_;
|
||||
|
Loading…
Reference in New Issue
Block a user