macros << getPreambleSnippets();
}
+ if (mustProvide("xetexdashbreakstate"))
+ macros << "\\XeTeXdashbreakstate 0" << '\n';
+
if (mustProvide("papersize")) {
if (runparams_.flavor == OutputParams::LATEX
|| runparams_.flavor == OutputParams::DVILUATEX)
case 0x2013:
case 0x2014:
- if (bparams.use_dash_ligatures && !bparams.useNonTeXFonts) {
+ // XeTeX's dash behaviour is determined via a global setting
+ if (bparams.use_dash_ligatures
+ && owner_->getFontSettings(bparams, i).fontInfo().family() != TYPEWRITER_FAMILY
+ && (!bparams.useNonTeXFonts || runparams.flavor != OutputParams::XETEX)) {
if (c == 0x2013) {
// en-dash
os << "--";
os << "\\textvertline" << termcmd;
column += 14;
return true;
+ case 0x2013:
+ os << "\\textendash" << termcmd;
+ column += 12;
+ return true;
+ case 0x2014:
+ os << "\\textemdash" << termcmd;
+ column += 12;
+ return true;
default:
return false;
}
void Paragraph::Private::validate(LaTeXFeatures & features) const
{
+ Buffer const & buf = inset_owner_->buffer();
+ BufferParams const & bp = features.runparams().is_child
+ ? buf.masterParams() : buf.params();
if (layout_->inpreamble && inset_owner_) {
bool const is_command = layout_->latextype == LATEX_COMMAND;
- Buffer const & buf = inset_owner_->buffer();
- BufferParams const & bp = features.runparams().is_child
- ? buf.masterParams() : buf.params();
Font f;
// Using a string stream here circumvents the encoding
// switching machinery of odocstream. Therefore the
}
// then the contents
- BufferParams const bp = features.buffer().masterParams();
for (pos_type i = 0; i < int(text_.size()) ; ++i) {
char_type c = text_[i];
if (c == 0x0022) {
|| ((&owner_->getFontSettings(bp, i))->language()->internalFontEncoding()))
features.require("textquotedbl");
}
+ if (!bp.use_dash_ligatures
+ && (c == 0x2013 || c == 0x2014)
+ && bp.useNonTeXFonts
+ && features.runparams().flavor == OutputParams::XETEX)
+ // XeTeX's dash behaviour is determined via a global setting
+ features.require("xetexdashbreakstate");
BufferEncodings::validate(c, features);
}
}
fontModule->fontsRomanCO->currentIndex()).toString();
fontModule->fontScCB->setEnabled(providesSC(font));
fontModule->fontOsfCB->setEnabled(providesOSF(font));
- fontModule->dashesCB->setEnabled(tex_fonts);
updateMathFonts(font);
}
fromqstr(fontModule->cjkFontLE->text());
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->font_sf_scale;
fontModule->cjkFontLE->setText(QString());
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->fontOsfCB->setChecked(bp_.fonts_old_figures);
<item row="11" column="1">
<widget class="QCheckBox" name="dashesCB">
<property name="toolTip">
- <string>Use font ligatures -- and --- instead of \textendash and \textemdash for en- and em-dashes</string>
+ <string>By default, a line break can occur after en- and em-dashes and before em-dashes. Checking this box prevents that.</string>
</property>
<property name="text">
- <string>Output en- and &em-dashes as ligatures</string>
+ <string>Disallow l&ine breaks at dashes</string>
</property>
</widget>
</item>