mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
Rename a bunch of BufferParams to conform to our usual style.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36524 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
58978d7bb5
commit
fc3b06eac8
@ -673,7 +673,7 @@ int Buffer::readHeader(Lexer & lex)
|
||||
params().headsep.erase();
|
||||
params().footskip.erase();
|
||||
params().columnsep.erase();
|
||||
params().fontsCJK.erase();
|
||||
params().fonts_cjk.erase();
|
||||
params().listings_params.clear();
|
||||
params().clearLayoutModules();
|
||||
params().clearRemovedModules();
|
||||
|
@ -376,14 +376,14 @@ BufferParams::BufferParams()
|
||||
language = default_language;
|
||||
fontenc = "global";
|
||||
fonts_roman = "default";
|
||||
fontsSans = "default";
|
||||
fontsTypewriter = "default";
|
||||
fontsDefaultFamily = "default";
|
||||
fonts_sans = "default";
|
||||
fonts_typewriter = "default";
|
||||
fonts_default_family = "default";
|
||||
useNonTeXFonts = false;
|
||||
fontsSC = false;
|
||||
fontsOSF = false;
|
||||
fontsSansScale = 100;
|
||||
fontsTypewriterScale = 100;
|
||||
fonts_expert_sc = false;
|
||||
fonts_old_figures = false;
|
||||
fonts_sans_scale = 100;
|
||||
fonts_typewriter_scale = 100;
|
||||
inputenc = "auto";
|
||||
graphicsDriver = "default";
|
||||
defaultOutputFormat = "default";
|
||||
@ -621,24 +621,24 @@ string BufferParams::readToken(Lexer & lex, string const & token,
|
||||
fonts_roman = lex.getString();
|
||||
} else if (token == "\\font_sans") {
|
||||
lex.eatLine();
|
||||
fontsSans = lex.getString();
|
||||
fonts_sans = lex.getString();
|
||||
} else if (token == "\\font_typewriter") {
|
||||
lex.eatLine();
|
||||
fontsTypewriter = lex.getString();
|
||||
fonts_typewriter = lex.getString();
|
||||
} else if (token == "\\font_default_family") {
|
||||
lex >> fontsDefaultFamily;
|
||||
lex >> fonts_default_family;
|
||||
} else if (token == "\\use_non_tex_fonts") {
|
||||
lex >> useNonTeXFonts;
|
||||
} else if (token == "\\font_sc") {
|
||||
lex >> fontsSC;
|
||||
lex >> fonts_expert_sc;
|
||||
} else if (token == "\\font_osf") {
|
||||
lex >> fontsOSF;
|
||||
lex >> fonts_old_figures;
|
||||
} else if (token == "\\font_sf_scale") {
|
||||
lex >> fontsSansScale;
|
||||
lex >> fonts_sans_scale;
|
||||
} else if (token == "\\font_tt_scale") {
|
||||
lex >> fontsTypewriterScale;
|
||||
lex >> fonts_typewriter_scale;
|
||||
} else if (token == "\\font_cjk") {
|
||||
lex >> fontsCJK;
|
||||
lex >> fonts_cjk;
|
||||
} else if (token == "\\paragraph_separation") {
|
||||
string parsep;
|
||||
lex >> parsep;
|
||||
@ -948,17 +948,17 @@ void BufferParams::writeFile(ostream & os) const
|
||||
os << "\\inputencoding " << inputenc
|
||||
<< "\n\\fontencoding " << fontenc
|
||||
<< "\n\\font_roman " << fonts_roman
|
||||
<< "\n\\font_sans " << fontsSans
|
||||
<< "\n\\font_typewriter " << fontsTypewriter
|
||||
<< "\n\\font_default_family " << fontsDefaultFamily
|
||||
<< "\n\\font_sans " << fonts_sans
|
||||
<< "\n\\font_typewriter " << fonts_typewriter
|
||||
<< "\n\\font_default_family " << fonts_default_family
|
||||
<< "\n\\use_non_tex_fonts " << convert<string>(useNonTeXFonts)
|
||||
<< "\n\\font_sc " << convert<string>(fontsSC)
|
||||
<< "\n\\font_osf " << convert<string>(fontsOSF)
|
||||
<< "\n\\font_sf_scale " << fontsSansScale
|
||||
<< "\n\\font_tt_scale " << fontsTypewriterScale
|
||||
<< "\n\\font_sc " << convert<string>(fonts_expert_sc)
|
||||
<< "\n\\font_osf " << convert<string>(fonts_old_figures)
|
||||
<< "\n\\font_sf_scale " << fonts_sans_scale
|
||||
<< "\n\\font_tt_scale " << fonts_typewriter_scale
|
||||
<< '\n';
|
||||
if (!fontsCJK.empty()) {
|
||||
os << "\\font_cjk " << fontsCJK << '\n';
|
||||
if (!fonts_cjk.empty()) {
|
||||
os << "\\font_cjk " << fonts_cjk << '\n';
|
||||
}
|
||||
os << "\n\\graphics " << graphicsDriver << '\n';
|
||||
os << "\\default_output_format " << defaultOutputFormat << '\n';
|
||||
@ -1346,16 +1346,16 @@ bool BufferParams::writeLaTeX(odocstream & os, LaTeXFeatures & features,
|
||||
|
||||
// font selection must be done before loading fontenc.sty
|
||||
string const fonts =
|
||||
loadFonts(fonts_roman, fontsSans,
|
||||
fontsTypewriter, fontsSC, fontsOSF,
|
||||
fontsSansScale, fontsTypewriterScale, useNonTeXFonts);
|
||||
loadFonts(fonts_roman, fonts_sans,
|
||||
fonts_typewriter, fonts_expert_sc, fonts_old_figures,
|
||||
fonts_sans_scale, fonts_typewriter_scale, useNonTeXFonts);
|
||||
if (!fonts.empty()) {
|
||||
os << from_ascii(fonts);
|
||||
texrow.newline();
|
||||
}
|
||||
if (fontsDefaultFamily != "default")
|
||||
if (fonts_default_family != "default")
|
||||
os << "\\renewcommand{\\familydefault}{\\"
|
||||
<< from_ascii(fontsDefaultFamily) << "}\n";
|
||||
<< from_ascii(fonts_default_family) << "}\n";
|
||||
|
||||
// set font encoding
|
||||
// for arabic_arabi and farsi we also need to load the LAE and
|
||||
@ -2061,11 +2061,11 @@ bool BufferParams::addLayoutModule(string const & modName)
|
||||
Font const BufferParams::getFont() const
|
||||
{
|
||||
FontInfo f = documentClass().defaultfont();
|
||||
if (fontsDefaultFamily == "rmdefault")
|
||||
if (fonts_default_family == "rmdefault")
|
||||
f.setFamily(ROMAN_FAMILY);
|
||||
else if (fontsDefaultFamily == "sfdefault")
|
||||
else if (fonts_default_family == "sfdefault")
|
||||
f.setFamily(SANS_FAMILY);
|
||||
else if (fontsDefaultFamily == "ttdefault")
|
||||
else if (fonts_default_family == "ttdefault")
|
||||
f.setFamily(TYPEWRITER_FAMILY);
|
||||
return Font(f, language);
|
||||
}
|
||||
|
@ -210,23 +210,23 @@ public:
|
||||
/// the rm font
|
||||
std::string fonts_roman;
|
||||
/// the sf font
|
||||
std::string fontsSans;
|
||||
std::string fonts_sans;
|
||||
/// the tt font
|
||||
std::string fontsTypewriter;
|
||||
std::string fonts_typewriter;
|
||||
/// the default family (rm, sf, tt)
|
||||
std::string fontsDefaultFamily;
|
||||
std::string fonts_default_family;
|
||||
/// use the fonts of the OS (OpenType, True Type) directly
|
||||
bool useNonTeXFonts;
|
||||
/// use expert Small Caps
|
||||
bool fontsSC;
|
||||
bool fonts_expert_sc;
|
||||
/// use Old Style Figures
|
||||
bool fontsOSF;
|
||||
bool fonts_old_figures;
|
||||
/// the scale factor of the sf font
|
||||
int fontsSansScale;
|
||||
int fonts_sans_scale;
|
||||
/// the scale factor of the tt font
|
||||
int fontsTypewriterScale;
|
||||
int fonts_typewriter_scale;
|
||||
/// the font used by the CJK command
|
||||
std::string fontsCJK;
|
||||
std::string fonts_cjk;
|
||||
///
|
||||
Spacing & spacing();
|
||||
Spacing const & spacing() const;
|
||||
|
@ -2415,24 +2415,24 @@ void GuiDocument::applyView()
|
||||
fromqstr(fontModule->fontsRomanCO->currentText());
|
||||
|
||||
if (fontModule->fontsSansCO->currentIndex() == 0)
|
||||
bp_.fontsSans = "default";
|
||||
bp_.fonts_sans = "default";
|
||||
else
|
||||
bp_.fontsSans =
|
||||
bp_.fonts_sans =
|
||||
fromqstr(fontModule->fontsSansCO->currentText());
|
||||
|
||||
if (fontModule->fontsTypewriterCO->currentIndex() == 0)
|
||||
bp_.fontsTypewriter = "default";
|
||||
bp_.fonts_typewriter = "default";
|
||||
else
|
||||
bp_.fontsTypewriter =
|
||||
bp_.fonts_typewriter =
|
||||
fromqstr(fontModule->fontsTypewriterCO->currentText());
|
||||
} else {
|
||||
bp_.fonts_roman =
|
||||
tex_fonts_roman[fontModule->fontsRomanCO->currentIndex()];
|
||||
|
||||
bp_.fontsSans =
|
||||
bp_.fonts_sans =
|
||||
tex_fonts_sans[fontModule->fontsSansCO->currentIndex()];
|
||||
|
||||
bp_.fontsTypewriter =
|
||||
bp_.fonts_typewriter =
|
||||
tex_fonts_monospaced[fontModule->fontsTypewriterCO->currentIndex()];
|
||||
}
|
||||
|
||||
@ -2443,21 +2443,21 @@ void GuiDocument::applyView()
|
||||
else if (fontModule->fontencCO->currentIndex() == 2)
|
||||
bp_.fontenc = "default";
|
||||
|
||||
bp_.fontsCJK =
|
||||
bp_.fonts_cjk =
|
||||
fromqstr(fontModule->cjkFontLE->text());
|
||||
|
||||
bp_.fontsSansScale = fontModule->scaleSansSB->value();
|
||||
bp_.fonts_sans_scale = fontModule->scaleSansSB->value();
|
||||
|
||||
bp_.fontsTypewriterScale = fontModule->scaleTypewriterSB->value();
|
||||
bp_.fonts_typewriter_scale = fontModule->scaleTypewriterSB->value();
|
||||
|
||||
bp_.fontsSC = fontModule->fontScCB->isChecked();
|
||||
bp_.fonts_expert_sc = fontModule->fontScCB->isChecked();
|
||||
|
||||
bp_.fontsOSF = fontModule->fontOsfCB->isChecked();
|
||||
bp_.fonts_old_figures = fontModule->fontOsfCB->isChecked();
|
||||
|
||||
if (nontexfonts)
|
||||
bp_.fontsDefaultFamily = "default";
|
||||
bp_.fonts_default_family = "default";
|
||||
else
|
||||
bp_.fontsDefaultFamily = GuiDocument::fontfamilies[
|
||||
bp_.fonts_default_family = GuiDocument::fontfamilies[
|
||||
fontModule->fontsDefaultCO->currentIndex()];
|
||||
|
||||
if (fontModule->fontsizeCO->currentIndex() == 0)
|
||||
@ -2854,14 +2854,14 @@ void GuiDocument::paramsToDialog()
|
||||
}
|
||||
|
||||
for (int i = 0; i < fontModule->fontsSansCO->count(); ++i) {
|
||||
if (fontModule->fontsSansCO->itemText(i) == toqstr(bp_.fontsSans)) {
|
||||
if (fontModule->fontsSansCO->itemText(i) == toqstr(bp_.fonts_sans)) {
|
||||
fontModule->fontsSansCO->setCurrentIndex(i);
|
||||
return;
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < fontModule->fontsTypewriterCO->count(); ++i) {
|
||||
if (fontModule->fontsTypewriterCO->itemText(i) ==
|
||||
toqstr(bp_.fontsTypewriter)) {
|
||||
toqstr(bp_.fonts_typewriter)) {
|
||||
fontModule->fontsTypewriterCO->setCurrentIndex(i);
|
||||
return;
|
||||
}
|
||||
@ -2876,31 +2876,31 @@ void GuiDocument::paramsToDialog()
|
||||
romanChanged(n);
|
||||
}
|
||||
|
||||
n = findToken(tex_fonts_sans, bp_.fontsSans);
|
||||
n = findToken(tex_fonts_sans, bp_.fonts_sans);
|
||||
if (n >= 0) {
|
||||
fontModule->fontsSansCO->setCurrentIndex(n);
|
||||
sansChanged(n);
|
||||
}
|
||||
|
||||
n = findToken(tex_fonts_monospaced, bp_.fontsTypewriter);
|
||||
n = findToken(tex_fonts_monospaced, bp_.fonts_typewriter);
|
||||
if (n >= 0) {
|
||||
fontModule->fontsTypewriterCO->setCurrentIndex(n);
|
||||
ttChanged(n);
|
||||
}
|
||||
}
|
||||
|
||||
if (!bp_.fontsCJK.empty())
|
||||
if (!bp_.fonts_cjk.empty())
|
||||
fontModule->cjkFontLE->setText(
|
||||
toqstr(bp_.fontsCJK));
|
||||
toqstr(bp_.fonts_cjk));
|
||||
else
|
||||
fontModule->cjkFontLE->setText(QString());
|
||||
|
||||
fontModule->fontScCB->setChecked(bp_.fontsSC);
|
||||
fontModule->fontOsfCB->setChecked(bp_.fontsOSF);
|
||||
fontModule->scaleSansSB->setValue(bp_.fontsSansScale);
|
||||
fontModule->scaleTypewriterSB->setValue(bp_.fontsTypewriterScale);
|
||||
fontModule->fontScCB->setChecked(bp_.fonts_expert_sc);
|
||||
fontModule->fontOsfCB->setChecked(bp_.fonts_old_figures);
|
||||
fontModule->scaleSansSB->setValue(bp_.fonts_sans_scale);
|
||||
fontModule->scaleTypewriterSB->setValue(bp_.fonts_typewriter_scale);
|
||||
|
||||
int nn = findToken(GuiDocument::fontfamilies, bp_.fontsDefaultFamily);
|
||||
int nn = findToken(GuiDocument::fontfamilies, bp_.fonts_default_family);
|
||||
if (nn >= 0)
|
||||
fontModule->fontsDefaultCO->setCurrentIndex(nn);
|
||||
|
||||
|
@ -181,7 +181,7 @@ private:
|
||||
/// return false if validate_listings_params returns error
|
||||
bool isValid();
|
||||
|
||||
/// font family names for BufferParams::fontsDefaultFamily
|
||||
/// font family names for BufferParams::fonts_default_family
|
||||
static char const * const fontfamilies[5];
|
||||
/// GUI names corresponding fontfamilies
|
||||
static char const * fontfamilies_gui[5];
|
||||
|
@ -226,7 +226,7 @@ TeXEnvironment(Buffer const & buf,
|
||||
open_encoding_ != CJK && pit->isMultiLingual(bparams)) {
|
||||
if (prev_par_language->encoding()->package() == Encoding::CJK)
|
||||
os << "\\begin{CJK}{" << from_ascii(par_language->encoding()->latexName())
|
||||
<< "}{" << from_ascii(bparams.fontsCJK) << "}%\n";
|
||||
<< "}{" << from_ascii(bparams.fonts_cjk) << "}%\n";
|
||||
open_encoding_ = CJK;
|
||||
cjk_nested = true;
|
||||
texrow.newline();
|
||||
@ -602,7 +602,7 @@ ParagraphList::const_iterator TeXOnePar(Buffer const & buf,
|
||||
if (par_language->encoding()->package() == Encoding::CJK &&
|
||||
open_encoding_ != CJK && cjk_inherited_ == 0) {
|
||||
os << "\\begin{CJK}{" << from_ascii(par_language->encoding()->latexName())
|
||||
<< "}{" << from_ascii(bparams.fontsCJK) << "}%\n";
|
||||
<< "}{" << from_ascii(bparams.fonts_cjk) << "}%\n";
|
||||
open_encoding_ = CJK;
|
||||
texrow.newline();
|
||||
}
|
||||
@ -943,7 +943,7 @@ void latexParagraphs(Buffer const & buf,
|
||||
if (maintext && !is_child
|
||||
&& bparams.encoding().package() == Encoding::CJK) {
|
||||
os << "\\begin{CJK}{" << from_ascii(bparams.encoding().latexName())
|
||||
<< "}{" << from_ascii(bparams.fontsCJK) << "}%\n";
|
||||
<< "}{" << from_ascii(bparams.fonts_cjk) << "}%\n";
|
||||
texrow.newline();
|
||||
open_encoding_ = CJK;
|
||||
}
|
||||
@ -1139,7 +1139,7 @@ pair<bool, int> switchEncoding(odocstream & os, BufferParams const & bparams,
|
||||
count += 7;
|
||||
}
|
||||
os << "\\begin{CJK}{" << inputenc_arg << "}{"
|
||||
<< from_ascii(bparams.fontsCJK) << "}";
|
||||
<< from_ascii(bparams.fonts_cjk) << "}";
|
||||
open_encoding_ = CJK;
|
||||
return make_pair(true, count + 15);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user