Further amendment to 72a488d7

Rephrase positively the check box for the output of en- and em-dashes
and disable it when using non-TeX fonts. The state of the check box
is remembered, so that toggling the non-TeX fonts check box does not
cause information loss.
This commit is contained in:
Enrico Forestieri 2017-03-20 23:59:16 +01:00
parent 167eea3990
commit 16d5c49b38
4 changed files with 19 additions and 8 deletions

View File

@ -88,10 +88,10 @@
!!Caveats when upgrading from earlier versions to 2.3.x !!Caveats when upgrading from earlier versions to 2.3.x
* If the "Use non-TeX fonts" and "Don't use ligatures for en- and em-dashes" * If using TeX fonts and en- and em-dashes are output as font ligatures,
document preferences are not checked, when exporting documents containing when exporting documents containing en- and em-dashes to the format of
en- and em-dashes to the format of LyX 2.0 or earlier, the following line LyX 2.0 or earlier, the following line has to be manually added to the
has to be manually added to the unicodesymbols file of that LyX version:<br> unicodesymbols file of that LyX version:<br>
0x200b "\\hspace{0pt}" "" "" "" "" # ZERO WIDTH SPACE<br> 0x200b "\\hspace{0pt}" "" "" "" "" # ZERO WIDTH SPACE<br>
This avoids "uncodable character" issues if the document is actually This avoids "uncodable character" issues if the document is actually
loaded by that LyX version. LyX 2.1 and later versions already have the loaded by that LyX version. LyX 2.1 and later versions already have the

View File

@ -840,6 +840,8 @@ GuiDocument::GuiDocument(GuiView & lv)
this, SLOT(change_adaptor())); this, SLOT(change_adaptor()));
connect(fontModule->dashesCB, SIGNAL(clicked()), connect(fontModule->dashesCB, SIGNAL(clicked()),
this, SLOT(change_adaptor())); this, SLOT(change_adaptor()));
connect(fontModule->dashesCB, SIGNAL(toggled(bool)),
this, SLOT(dashesToggled(bool)));
connect(fontModule->scaleSansSB, SIGNAL(valueChanged(int)), connect(fontModule->scaleSansSB, SIGNAL(valueChanged(int)),
this, SLOT(change_adaptor())); this, SLOT(change_adaptor()));
connect(fontModule->scaleTypewriterSB, SIGNAL(valueChanged(int)), connect(fontModule->scaleTypewriterSB, SIGNAL(valueChanged(int)),
@ -1936,6 +1938,13 @@ void GuiDocument::fontScToggled(bool state)
} }
void GuiDocument::dashesToggled(bool state)
{
if (!fontModule->osFontsCB->isChecked())
fontModule->dashesCB->setChecked(state);
}
void GuiDocument::updateFontOptions() void GuiDocument::updateFontOptions()
{ {
bool const tex_fonts = !fontModule->osFontsCB->isChecked(); bool const tex_fonts = !fontModule->osFontsCB->isChecked();
@ -1957,6 +1966,7 @@ void GuiDocument::updateFontOptions()
fontModule->fontsRomanCO->currentIndex()).toString(); fontModule->fontsRomanCO->currentIndex()).toString();
fontModule->fontScCB->setEnabled(providesSC(font)); fontModule->fontScCB->setEnabled(providesSC(font));
fontModule->fontOsfCB->setEnabled(providesOSF(font)); fontModule->fontOsfCB->setEnabled(providesOSF(font));
fontModule->dashesCB->setEnabled(tex_fonts);
updateMathFonts(font); updateMathFonts(font);
} }
@ -3048,7 +3058,7 @@ void GuiDocument::applyView()
fromqstr(fontModule->cjkFontLE->text()); fromqstr(fontModule->cjkFontLE->text());
bp_.use_microtype = fontModule->microtypeCB->isChecked(); bp_.use_microtype = fontModule->microtypeCB->isChecked();
bp_.use_dash_ligatures = !fontModule->dashesCB->isChecked(); bp_.use_dash_ligatures = fontModule->dashesCB->isChecked();
bp_.fonts_sans_scale[nontexfonts] = fontModule->scaleSansSB->value(); bp_.fonts_sans_scale[nontexfonts] = fontModule->scaleSansSB->value();
bp_.fonts_sans_scale[!nontexfonts] = fontModule->font_sf_scale; bp_.fonts_sans_scale[!nontexfonts] = fontModule->font_sf_scale;
@ -3553,7 +3563,7 @@ void GuiDocument::paramsToDialog()
fontModule->cjkFontLE->setText(QString()); fontModule->cjkFontLE->setText(QString());
fontModule->microtypeCB->setChecked(bp_.use_microtype); fontModule->microtypeCB->setChecked(bp_.use_microtype);
fontModule->dashesCB->setChecked(!bp_.use_dash_ligatures); fontModule->dashesCB->setChecked(bp_.use_dash_ligatures);
fontModule->fontScCB->setChecked(bp_.fonts_expert_sc); fontModule->fontScCB->setChecked(bp_.fonts_expert_sc);
fontModule->fontOsfCB->setChecked(bp_.fonts_old_figures); fontModule->fontOsfCB->setChecked(bp_.fonts_old_figures);

View File

@ -105,6 +105,7 @@ private Q_SLOTS:
void ttChanged(int); void ttChanged(int);
void fontOsfToggled(bool state); void fontOsfToggled(bool state);
void fontScToggled(bool state); void fontScToggled(bool state);
void dashesToggled(bool state);
void setIndent(int); void setIndent(int);
void enableIndent(bool); void enableIndent(bool);
void setSkip(int); void setSkip(int);

View File

@ -255,10 +255,10 @@
<item row="11" column="1"> <item row="11" column="1">
<widget class="QCheckBox" name="dashesCB"> <widget class="QCheckBox" name="dashesCB">
<property name="toolTip"> <property name="toolTip">
<string>Use \textendash and \textemdash instead of -- and --- for en- and em-dashes</string> <string>Use font ligatures -- and --- instead of \textendash and \textemdash for en- and em-dashes</string>
</property> </property>
<property name="text"> <property name="text">
<string>Don't use ligatures for en- and &amp;em-dashes</string> <string>Output en- and &amp;em-dashes as ligatures</string>
</property> </property>
</widget> </widget>
</item> </item>