* src/BufferParams.{cpp,h}:
- new param fontsCJK (font_cjk).
* src/output_latex.cpp:
- use fontsCJK param.
* src/Buffer.cpp:
- increase file format
* src/frontends/qt4/GuiDocument.cpp:
* src/frontends/qt4/ui/FontUi.ui:
- GUI for the CJK font param
* lib/lyx2lyx/lyx_1_6.py:
- remove font_cjk param on reversion.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25135
a592a061-630c-0410-9148-
cb99ea01b6c8
LyX file-format changes
-----------------------
LyX file-format changes
-----------------------
+2008-06-04 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
+ * Format incremented to 336: new param \font_cjk.
+
2008-05-30 Richard Heck <rgheck@brown.edu>
* Format incremented to 335: fixes for InsetSpace problems.
2008-05-30 Richard Heck <rgheck@brown.edu>
* Format incremented to 335: fixes for InsetSpace problems.
document.body[i] = document.body[i].replace('\\begin_inset space', '\\begin_inset Space')
document.body[i] = document.body[i].replace('\\begin_inset space', '\\begin_inset Space')
+def remove_fontsCJK(document):
+ ' Remove font_cjk param '
+ i = find_token(document.header, "\\font_cjk", 0)
+ if i != -1:
+ del document.header[i]
+
+
def convert_plain_layout(document):
" Convert 'PlainLayout' to 'Plain Layout'"
i = 0
def convert_plain_layout(document):
" Convert 'PlainLayout' to 'Plain Layout'"
i = 0
[333, [update_apa_styles]],
[334, [convert_paper_sizes]],
[335, [convert_InsetSpace]],
[333, [update_apa_styles]],
[334, [convert_paper_sizes]],
[335, [convert_InsetSpace]],
-revert = [[334, [revert_InsetSpace]],
+revert = [[335, [remove_fontsCJK]],
+ [334, [revert_InsetSpace]],
[333, [revert_paper_sizes]],
[332, []],
[331, [revert_graphics_group]],
[333, [revert_paper_sizes]],
[332, []],
[331, [revert_graphics_group]],
-int const LYX_FORMAT = 335;
+int const LYX_FORMAT = 336;
typedef map<string, bool> DepClean;
typedef map<docstring, pair<InsetLabel const *, Buffer::References> > RefCache;
typedef map<string, bool> DepClean;
typedef map<docstring, pair<InsetLabel const *, Buffer::References> > RefCache;
params().headsep.erase();
params().footskip.erase();
params().columnsep.erase();
params().headsep.erase();
params().footskip.erase();
params().columnsep.erase();
+ params().fontsCJK.erase();
params().listings_params.clear();
params().clearLayoutModules();
params().pdfoptions().clear();
params().listings_params.clear();
params().clearLayoutModules();
params().pdfoptions().clear();
lex >> fontsSansScale;
} else if (token == "\\font_tt_scale") {
lex >> fontsTypewriterScale;
lex >> fontsSansScale;
} else if (token == "\\font_tt_scale") {
lex >> fontsTypewriterScale;
+ } else if (token == "\\font_cjk") {
+ lex >> fontsCJK;
} else if (token == "\\paragraph_separation") {
string parsep;
lex >> parsep;
} else if (token == "\\paragraph_separation") {
string parsep;
lex >> parsep;
<< "\n\\font_osf " << convert<string>(fontsOSF)
<< "\n\\font_sf_scale " << fontsSansScale
<< "\n\\font_tt_scale " << fontsTypewriterScale
<< "\n\\font_osf " << convert<string>(fontsOSF)
<< "\n\\font_sf_scale " << fontsSansScale
<< "\n\\font_tt_scale " << fontsTypewriterScale
- << "\n\\graphics " << graphicsDriver << '\n';
+ << '\n';
+ if (!fontsCJK.empty()) {
+ os << "\\font_cjk " << fontsCJK << '\n';
+ }
+ os << "\n\\graphics " << graphicsDriver << '\n';
if (!float_placement.empty()) {
os << "\\float_placement " << float_placement << '\n';
if (!float_placement.empty()) {
os << "\\float_placement " << float_placement << '\n';
int fontsSansScale;
/// the scale factor of the tt font
int fontsTypewriterScale;
int fontsSansScale;
/// the scale factor of the tt font
int fontsTypewriterScale;
+ /// the font used by the CJK command
+ std::string fontsCJK;
///
Spacing & spacing();
Spacing const & spacing() const;
///
Spacing & spacing();
Spacing const & spacing() const;
this, SLOT(change_adaptor()));
connect(fontModule->fontsizeCO, SIGNAL(activated(int)),
this, SLOT(change_adaptor()));
this, SLOT(change_adaptor()));
connect(fontModule->fontsizeCO, SIGNAL(activated(int)),
this, SLOT(change_adaptor()));
+ connect(fontModule->cjkFontLE, SIGNAL(textChanged(const QString &)),
+ this, SLOT(change_adaptor()));
connect(fontModule->scaleSansSB, SIGNAL(valueChanged(int)),
this, SLOT(change_adaptor()));
connect(fontModule->scaleTypewriterSB, SIGNAL(valueChanged(int)),
connect(fontModule->scaleSansSB, SIGNAL(valueChanged(int)),
this, SLOT(change_adaptor()));
connect(fontModule->scaleTypewriterSB, SIGNAL(valueChanged(int)),
params.fontsTypewriter =
tex_fonts_monospaced[fontModule->fontsTypewriterCO->currentIndex()];
params.fontsTypewriter =
tex_fonts_monospaced[fontModule->fontsTypewriterCO->currentIndex()];
+ params.fontsCJK =
+ fromqstr(fontModule->cjkFontLE->text());
+
params.fontsSansScale = fontModule->scaleSansSB->value();
params.fontsTypewriterScale = fontModule->scaleTypewriterSB->value();
params.fontsSansScale = fontModule->scaleSansSB->value();
params.fontsTypewriterScale = fontModule->scaleTypewriterSB->value();
+ if (!params.fontsCJK.empty())
+ fontModule->cjkFontLE->setText(
+ toqstr(params.fontsCJK));
+ else
+ fontModule->cjkFontLE->setText(QString());
+
fontModule->fontScCB->setChecked(params.fontsSC);
fontModule->fontOsfCB->setChecked(params.fontsOSF);
fontModule->scaleSansSB->setValue(params.fontsSansScale);
fontModule->fontScCB->setChecked(params.fontsSC);
fontModule->fontOsfCB->setChecked(params.fontsOSF);
fontModule->scaleSansSB->setValue(params.fontsSansScale);
- <width>409</width>
- <height>232</height>
+ <width>414</width>
+ <height>268</height>
</rect>
</property>
<property name="windowTitle" >
</rect>
</property>
<property name="windowTitle" >
<property name="spacing" >
<number>6</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
- <item row="7" column="0" colspan="4" >
+ <item row="8" column="0" colspan="4" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
<property name="sizeHint" >
<size>
<width>391</width>
<property name="sizeHint" >
<size>
<width>391</width>
</size>
</property>
</spacer>
</item>
</size>
</property>
</spacer>
</item>
- <item row="2" column="2" colspan="2" >
+ <item row="5" column="0" >
+ <widget class="QLabel" name="cjkFontLA" >
+ <property name="text" >
+ <string>C&JK:</string>
+ </property>
+ <property name="buddy" >
+ <cstring>cjkFontLE</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="1" >
+ <widget class="QLineEdit" name="cjkFontLE" >
+ <property name="toolTip" >
+ <string>Input the font to be used for Chinese, Japanese or Korean (CJK) script</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="2" colspan="2" >
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<height>20</height>
</size>
</property>
</spacer>
</item>
<height>20</height>
</size>
</property>
</spacer>
</item>
- <item row="4" column="3" >
- <widget class="QSpinBox" name="scaleTypewriterSB" >
- <property name="maximum" >
- <number>200</number>
+ <item row="7" column="1" >
+ <widget class="QCheckBox" name="fontOsfCB" >
+ <property name="toolTip" >
+ <string>Use old style instead of lining figures</string>
- <property name="minimum" >
- <number>10</number>
+ <property name="text" >
+ <string>Use &Old Style Figures</string>
</property>
</widget>
</item>
</property>
</widget>
</item>
- <item row="4" column="2" >
- <widget class="QLabel" name="scaleTypewriterLA" >
+ <item row="6" column="1" >
+ <widget class="QCheckBox" name="fontScCB" >
+ <property name="toolTip" >
+ <string>Use a real small caps shape, if the font provides one</string>
+ </property>
- <string>Sc&ale (%):</string>
+ <string>Use true S&mall Caps</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QComboBox" name="fontsDefaultCO" >
+ <property name="toolTip" >
+ <string>Select the default family for the document</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2" >
+ <widget class="QLabel" name="TextLabel2_2" >
+ <property name="text" >
+ <string>&Base Size:</string>
</property>
<property name="buddy" >
</property>
<property name="buddy" >
- <cstring>scaleTypewriterSB</cstring>
+ <cstring>fontsizeCO</cstring>
</property>
</widget>
</item>
</property>
</widget>
</item>
- <item row="4" column="1" >
- <widget class="QComboBox" name="fontsTypewriterCO" />
+ <item row="0" column="3" >
+ <widget class="QComboBox" name="fontsizeCO" >
+ <property name="toolTip" >
+ <string/>
+ </property>
+ </widget>
- <item row="4" column="0" >
- <widget class="QLabel" name="fontsTypewriterLA" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="fontsDefaultLA" >
- <string>&Typewriter:</string>
+ <string>&Default Family:</string>
</property>
<property name="buddy" >
</property>
<property name="buddy" >
- <cstring>fontsTypewriterCO</cstring>
+ <cstring>fontsDefaultCO</cstring>
</property>
</widget>
</item>
</property>
</widget>
</item>
- <item row="2" column="1" >
- <widget class="QComboBox" name="fontsRomanCO" />
+ <item row="1" column="1" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>182</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
- <item row="2" column="0" >
- <widget class="QLabel" name="fontsRomanLA" >
+ <item row="3" column="0" >
+ <widget class="QLabel" name="fontsSansLA" >
- <string>&Roman:</string>
+ <string>&Sans Serif:</string>
</property>
<property name="buddy" >
</property>
<property name="buddy" >
- <cstring>fontsRomanCO</cstring>
+ <cstring>fontsSansCO</cstring>
</property>
</widget>
</item>
</property>
</widget>
</item>
- <item row="3" column="3" >
- <widget class="QSpinBox" name="scaleSansSB" >
- <property name="maximum" >
- <number>200</number>
- </property>
- <property name="minimum" >
- <number>10</number>
+ <item row="3" column="1" >
+ <widget class="QComboBox" name="fontsSansCO" >
+ <property name="toolTip" >
+ <string>Select the Sans Serif (grotesque) typeface</string>
</property>
</widget>
</item>
</property>
</widget>
</item>
</property>
</widget>
</item>
</property>
</widget>
</item>
- <item row="3" column="1" >
- <widget class="QComboBox" name="fontsSansCO" />
+ <item row="3" column="3" >
+ <widget class="QSpinBox" name="scaleSansSB" >
+ <property name="toolTip" >
+ <string>Scale the Sans Serif font to match the base font's dimensions</string>
+ </property>
+ <property name="maximum" >
+ <number>200</number>
+ </property>
+ <property name="minimum" >
+ <number>10</number>
+ </property>
+ </widget>
- <item row="3" column="0" >
- <widget class="QLabel" name="fontsSansLA" >
+ <item row="2" column="0" >
+ <widget class="QLabel" name="fontsRomanLA" >
- <string>&Sans Serif:</string>
+ <string>&Roman:</string>
</property>
<property name="buddy" >
</property>
<property name="buddy" >
- <cstring>fontsSansCO</cstring>
+ <cstring>fontsRomanCO</cstring>
</property>
</widget>
</item>
</property>
</widget>
</item>
- <item row="1" column="1" >
- <spacer>
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" >
- <size>
- <width>182</width>
- <height>16</height>
- </size>
+ <item row="2" column="1" >
+ <widget class="QComboBox" name="fontsRomanCO" >
+ <property name="toolTip" >
+ <string>Select the roman (serif) typeface</string>
- <item row="6" column="1" >
- <widget class="QCheckBox" name="fontOsfCB" >
+ <item row="4" column="0" >
+ <widget class="QLabel" name="fontsTypewriterLA" >
- <string>Use &Old Style Figures</string>
+ <string>&Typewriter:</string>
+ </property>
+ <property name="buddy" >
+ <cstring>fontsTypewriterCO</cstring>
</property>
</widget>
</item>
</property>
</widget>
</item>
- <item row="5" column="1" >
- <widget class="QCheckBox" name="fontScCB" >
- <property name="text" >
- <string>Use true S&mall Caps</string>
+ <item row="4" column="1" >
+ <widget class="QComboBox" name="fontsTypewriterCO" >
+ <property name="toolTip" >
+ <string>Select the typewriter (monospaced) typeface</string>
</property>
</widget>
</item>
</property>
</widget>
</item>
- <item row="0" column="0" >
- <widget class="QLabel" name="fontsDefaultLA" >
+ <item row="4" column="2" >
+ <widget class="QLabel" name="scaleTypewriterLA" >
- <string>&Default Family:</string>
+ <string>Sc&ale (%):</string>
</property>
<property name="buddy" >
</property>
<property name="buddy" >
- <cstring>fontsDefaultCO</cstring>
+ <cstring>scaleTypewriterSB</cstring>
</property>
</widget>
</item>
</property>
</widget>
</item>
- <item row="0" column="3" >
- <widget class="QComboBox" name="fontsizeCO" />
- </item>
- <item row="0" column="2" >
- <widget class="QLabel" name="TextLabel2_2" >
- <property name="text" >
- <string>&Base Size:</string>
+ <item row="4" column="3" >
+ <widget class="QSpinBox" name="scaleTypewriterSB" >
+ <property name="toolTip" >
+ <string>Scale the Typewriter font to match the base font's dimensions</string>
- <property name="buddy" >
- <cstring>fontsizeCO</cstring>
+ <property name="maximum" >
+ <number>200</number>
+ </property>
+ <property name="minimum" >
+ <number>10</number>
</property>
</widget>
</item>
</property>
</widget>
</item>
- <item row="0" column="1" >
- <widget class="QComboBox" name="fontsDefaultCO" />
+ <item row="2" column="2" colspan="2" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>131</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
if (par_language->encoding()->package() == Encoding::CJK &&
open_encoding_ != CJK && pit->isMultiLingual(bparams)) {
os << "\\begin{CJK}{" << from_ascii(par_language->encoding()->latexName())
if (par_language->encoding()->package() == Encoding::CJK &&
open_encoding_ != CJK && pit->isMultiLingual(bparams)) {
os << "\\begin{CJK}{" << from_ascii(par_language->encoding()->latexName())
+ << "}{" << from_ascii(bparams.fontsCJK) << "}%\n";
open_encoding_ = CJK;
cjk_nested = true;
texrow.newline();
open_encoding_ = CJK;
cjk_nested = true;
texrow.newline();
if (par_language->encoding()->package() == Encoding::CJK &&
open_encoding_ != CJK && cjk_inherited_ == 0) {
os << "\\begin{CJK}{" << from_ascii(par_language->encoding()->latexName())
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";
open_encoding_ = CJK;
texrow.newline();
}
open_encoding_ = CJK;
texrow.newline();
}
// if the document's language is a CJK language
if (maintext && bparams.encoding().package() == Encoding::CJK) {
os << "\\begin{CJK}{" << from_ascii(bparams.encoding().latexName())
// if the document's language is a CJK language
if (maintext && bparams.encoding().package() == Encoding::CJK) {
os << "\\begin{CJK}{" << from_ascii(bparams.encoding().latexName())
+ << "}{" << from_ascii(bparams.fontsCJK) << "}%\n";
texrow.newline();
open_encoding_ = CJK;
}
texrow.newline();
open_encoding_ = CJK;
}
os << "\\egroup";
count += 7;
}
os << "\\egroup";
count += 7;
}
- os << "\\begin{CJK}{" << inputenc_arg << "}{}";
+ os << "\\begin{CJK}{" << inputenc_arg << "}{"
+ << from_ascii(bparams.fontsCJK) << "}";
open_encoding_ = CJK;
return make_pair(true, count + 15);
}
open_encoding_ = CJK;
return make_pair(true, count + 15);
}