3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Lars Gullik Bjønnes
7 * \author Jean-Marc Lasgouttes
8 * \author Angus Leeming
12 * Full author contact details are available in file CREDITS.
19 #include "BufferParams.h" // stateText
23 #include "LaTeXFeatures.h"
26 #include "output_latex.h"
27 #include "OutputParams.h"
28 #include "texstream.h"
30 #include "support/lassert.h"
31 #include "support/convert.h"
32 #include "support/debug.h"
33 #include "support/gettext.h"
34 #include "support/lstrings.h"
39 using namespace lyx::support;
44 // Strings used to read and write .lyx format files
46 // These are defined in FontInfo.cpp
47 extern char const * LyXFamilyNames[NUM_FAMILIES + 2];
48 extern char const * LyXSeriesNames[NUM_SERIES + 2];
49 extern char const * LyXShapeNames[NUM_SHAPE + 2];
50 extern char const * LyXSizeNames[NUM_SIZE + 4];
51 extern char const * LyXMiscNames[5];
52 extern char const * GUIMiscNames[5];
57 // Strings used to write LaTeX files
59 char const * LaTeXFamilyCommandNames[NUM_FAMILIES + 2] =
60 { "textrm", "textsf", "texttt", "error1", "error2", "error3", "error4",
61 "error5", "error6", "error7", "error8", "error9", "error10", "error11",
62 "error12", "error13", "error14" };
64 char const * LaTeXFamilySwitchNames[NUM_FAMILIES + 2] =
65 { "rmfamily", "sffamily", "ttfamily", "error1", "error2", "error3", "error4",
66 "error5", "error6", "error7", "error8", "error9", "error10", "error11",
67 "error12", "error13", "error14" };
69 char const * LaTeXSeriesCommandNames[NUM_SERIES + 2] =
70 { "textmd", "textbf", "error4", "error5" };
72 char const * LaTeXSeriesSwitchNames[NUM_SERIES + 2] =
73 { "mdseries", "bfseries", "error4", "error5" };
75 char const * LaTeXShapeCommandNames[NUM_SHAPE + 2] =
76 { "textup", "textit", "textsl", "textsc", "error6", "error7" };
78 char const * LaTeXShapeSwitchNames[NUM_SHAPE + 2] =
79 { "upshape", "itshape", "slshape", "scshape", "error6", "error7" };
81 char const * LaTeXSizeSwitchNames[NUM_SIZE + 4] =
82 { "tiny", "scriptsize", "footnotesize", "small", "normalsize", "large",
83 "Large", "LARGE", "huge", "Huge", "error8", "error9", "error10", "error11" };
88 Font::Font(FontInfo bits, Language const * l)
89 : bits_(bits), lang_(l), open_encoding_(false)
92 lang_ = default_language;
96 bool Font::isRightToLeft() const
98 return lang_->rightToLeft();
102 bool Font::isVisibleRightToLeft() const
104 return (lang_->rightToLeft() &&
105 bits_.number() != FONT_ON);
109 void Font::setLanguage(Language const * l)
115 /// Updates font settings according to request
116 void Font::update(Font const & newfont,
117 Language const * document_language,
120 bits_.update(newfont.fontInfo(), toggleall);
122 if (newfont.language() == language() && toggleall)
123 if (language() == document_language)
124 setLanguage(default_language);
126 setLanguage(document_language);
127 else if (newfont.language() == reset_language)
128 setLanguage(document_language);
129 else if (newfont.language() != ignore_language)
130 setLanguage(newfont.language());
134 docstring const Font::stateText(BufferParams * params, bool const terse) const
137 os << bits_.stateText(terse);
138 if ((!params || (language() != params->language))
139 && (!terse || language() != ignore_language)) {
140 // reset_language is a null pointer!
141 os << bformat(_("Language: %1$s, "),
142 (language() == reset_language) ? _("Default")
143 : _(language()->display()));
145 if (bits_.number() != FONT_OFF)
146 os << " " << bformat(_("Number %1$s"),
147 _(GUIMiscNames[bits_.number()]));
148 return rtrim(os.str(), ", ");
152 // Returns size in latex format
153 string const Font::latexSize() const
155 return LaTeXSizeSwitchNames[bits_.size()];
159 /// Writes the changes from this font to orgfont in .lyx format in file
160 void Font::lyxWriteChanges(Font const & orgfont,
164 if (orgfont.fontInfo().family() != bits_.family())
165 os << "\\family " << LyXFamilyNames[bits_.family()] << "\n";
166 if (orgfont.fontInfo().series() != bits_.series())
167 os << "\\series " << LyXSeriesNames[bits_.series()] << "\n";
168 if (orgfont.fontInfo().shape() != bits_.shape())
169 os << "\\shape " << LyXShapeNames[bits_.shape()] << "\n";
170 if (orgfont.fontInfo().size() != bits_.size())
171 os << "\\size " << LyXSizeNames[bits_.size()] << "\n";
172 // FIXME: shall style be handled there? Probably not.
173 if (orgfont.fontInfo().emph() != bits_.emph())
174 os << "\\emph " << LyXMiscNames[bits_.emph()] << "\n";
175 if (orgfont.fontInfo().number() != bits_.number())
176 os << "\\numeric " << LyXMiscNames[bits_.number()] << "\n";
177 if (orgfont.fontInfo().nospellcheck() != bits_.nospellcheck())
178 os << "\\nospellcheck " << LyXMiscNames[bits_.nospellcheck()] << "\n";
179 if (orgfont.fontInfo().underbar() != bits_.underbar()) {
180 // This is only for backwards compatibility
181 switch (bits_.underbar()) {
182 case FONT_OFF: os << "\\bar no\n"; break;
183 case FONT_ON: os << "\\bar under\n"; break;
184 case FONT_TOGGLE: lyxerr << "Font::lyxWriteFontChanges: "
185 "FONT_TOGGLE should not appear here!"
188 case FONT_INHERIT: os << "\\bar default\n"; break;
189 case FONT_IGNORE: lyxerr << "Font::lyxWriteFontChanges: "
190 "IGNORE should not appear here!"
195 if (orgfont.fontInfo().strikeout() != bits_.strikeout()) {
196 os << "\\strikeout " << LyXMiscNames[bits_.strikeout()] << "\n";
198 if (orgfont.fontInfo().xout() != bits_.xout()) {
199 os << "\\xout " << LyXMiscNames[bits_.xout()] << "\n";
201 if (orgfont.fontInfo().uuline() != bits_.uuline()) {
202 os << "\\uuline " << LyXMiscNames[bits_.uuline()] << "\n";
204 if (orgfont.fontInfo().uwave() != bits_.uwave()) {
205 os << "\\uwave " << LyXMiscNames[bits_.uwave()] << "\n";
207 if (orgfont.fontInfo().noun() != bits_.noun()) {
208 os << "\\noun " << LyXMiscNames[bits_.noun()] << "\n";
210 if (orgfont.fontInfo().color() != bits_.color())
211 os << "\\color " << lcolor.getLyXName(bits_.color()) << '\n';
212 // FIXME: uncomment this when we support background.
213 //if (orgfont.fontInfo().background() != bits_.background())
214 // os << "\\color " << lcolor.getLyXName(bits_.background()) << '\n';
215 if (orgfont.language() != language() &&
216 language() != latex_language) {
218 os << "\\lang " << language()->lang() << "\n";
220 os << "\\lang unknown\n";
225 /// Writes the head of the LaTeX needed to impose this font
226 // Returns number of chars written.
227 int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
228 OutputParams const & runparams,
231 bool const & non_inherit_inset,
232 bool const & needs_cprotection) const
236 // polyglossia or babel?
237 if (runparams.use_polyglossia
238 && language()->lang() != base.language()->lang()
239 && language() != prev.language()) {
240 if (!language()->polyglossia().empty()) {
242 if (needs_cprotection) {
243 if (contains(runparams.active_chars, '^'))
244 // cprotect relies on ^ being on catcode 7
245 tmp += "\\begingroup\\catcode`\\^=7";
248 tmp += "\\text" + language()->polyglossia();
249 if (!language()->polyglossiaOpts().empty()) {
250 tmp += "[" + language()->polyglossiaOpts() + "]";
251 if (runparams.use_hyperref && runparams.moving_arg) {
252 // We need to strip the command for
253 // the pdf string, see #11813
255 if (needs_cprotection) {
256 if (contains(runparams.active_chars, '^'))
257 // cprotect relies on ^ being on catcode 7
258 os << "\\begingroup\\catcode`\\^=7";
261 tmp = tmpp + "\\texorpdfstring{" + tmp + "}{}";
265 os << from_ascii(tmp);
266 count += tmp.length();
267 pushLanguageName(language()->polyglossia(), true);
268 } else if (language()->encoding()->package() != Encoding::CJK) {
272 } else if (language()->babel() != base.language()->babel() &&
273 language() != prev.language()) {
274 if (language()->lang() == "farsi") {
275 if (needs_cprotection) {
276 if (contains(runparams.active_chars, '^'))
277 // cprotect relies on ^ being on catcode 7
278 os << "\\begingroup\\catcode`\\^=7";
284 } else if (!isRightToLeft() &&
285 base.language()->lang() == "farsi") {
286 if (needs_cprotection) {
287 if (contains(runparams.active_chars, '^'))
288 // cprotect relies on ^ being on catcode 7
289 os << "\\begingroup\\catcode`\\^=7";
295 } else if (language()->lang() == "arabic_arabi") {
296 if (needs_cprotection) {
297 if (contains(runparams.active_chars, '^'))
298 // cprotect relies on ^ being on catcode 7
299 os << "\\begingroup\\catcode`\\^=7";
305 } else if (!isRightToLeft() &&
306 base.language()->lang() == "arabic_arabi") {
307 if (needs_cprotection) {
308 if (contains(runparams.active_chars, '^'))
309 // cprotect relies on ^ being on catcode 7
310 os << "\\begingroup\\catcode`\\^=7";
316 // currently the remaining RTL languages are arabic_arabtex and hebrew
317 } else if (isRightToLeft() != prev.isRightToLeft()) {
318 if (needs_cprotection) {
319 if (contains(runparams.active_chars, '^'))
320 // cprotect relies on ^ being on catcode 7
321 os << "\\begingroup\\catcode`\\^=7";
325 if (isRightToLeft()) {
332 } else if (!language()->babel().empty()) {
334 subst(lyxrc.language_command_local,
335 "$$lang", language()->babel());
336 if (needs_cprotection && !prefixIs(tmp, "\\begin{")) {
337 if (contains(runparams.active_chars, '^'))
338 // cprotect relies on ^ being on catcode 7
339 os << "\\begingroup\\catcode`\\^=7";
343 os << from_ascii(tmp);
344 count += tmp.length();
345 if (!lyxrc.language_command_end.empty())
346 pushLanguageName(language()->babel(), true);
347 } else if (language()->encoding()->package() != Encoding::CJK) {
353 if (language()->encoding()->package() == Encoding::CJK) {
354 pair<bool, int> const c = switchEncoding(os.os(), bparams,
355 runparams, *(language()->encoding()));
357 open_encoding_ = true;
359 runparams.encoding = language()->encoding();
364 f.reduce(base.bits_);
366 p.reduce(prev.bits_);
368 if (f.size() != INHERIT_SIZE) {
372 << LaTeXSizeSwitchNames[f.size()] << termcmd;
373 count += strlen(LaTeXSizeSwitchNames[f.size()]) + 1;
375 if (f.family() != INHERIT_FAMILY) {
376 if (non_inherit_inset) {
379 os << '\\' << LaTeXFamilySwitchNames[f.family()] << termcmd;
380 count += strlen(LaTeXFamilySwitchNames[f.family()]) + 1;
382 if (needs_cprotection) {
383 if (contains(runparams.active_chars, '^'))
384 // cprotect relies on ^ being on catcode 7
385 os << "\\begingroup\\catcode`\\^=7";
390 << LaTeXFamilyCommandNames[f.family()]
392 count += strlen(LaTeXFamilyCommandNames[f.family()]) + 2;
395 if (f.series() != INHERIT_SERIES) {
396 if (non_inherit_inset) {
399 os << '\\' << LaTeXSeriesSwitchNames[f.series()] << termcmd;
400 count += strlen(LaTeXSeriesSwitchNames[f.series()]) + 1;
402 if (needs_cprotection) {
403 if (contains(runparams.active_chars, '^'))
404 // cprotect relies on ^ being on catcode 7
405 os << "\\begingroup\\catcode`\\^=7";
410 << LaTeXSeriesCommandNames[f.series()]
412 count += strlen(LaTeXSeriesCommandNames[f.series()]) + 2;
415 if (f.shape() != INHERIT_SHAPE) {
416 if (non_inherit_inset) {
419 os << '\\' << LaTeXShapeSwitchNames[f.shape()] << termcmd;
420 count += strlen(LaTeXShapeSwitchNames[f.shape()]) + 1;
422 if (needs_cprotection) {
423 if (contains(runparams.active_chars, '^'))
424 // cprotect relies on ^ being on catcode 7
425 os << "\\begingroup\\catcode`\\^=7";
430 << LaTeXShapeCommandNames[f.shape()]
432 count += strlen(LaTeXShapeCommandNames[f.shape()]) + 2;
435 if (f.color() != Color_inherit && f.color() != Color_ignore) {
436 if (f.color() == Color_none && p.color() != Color_none) {
437 // Color none: Close previous color, if any
440 } else if (f.color() != Color_none) {
441 if (needs_cprotection) {
442 if (contains(runparams.active_chars, '^'))
443 // cprotect relies on ^ being on catcode 7
444 os << "\\begingroup\\catcode`\\^=7";
449 << from_ascii(lcolor.getLaTeXName(f.color()))
451 count += lcolor.getLaTeXName(f.color()).length() + 13;
454 // FIXME: uncomment this when we support background.
456 if (f.background() != Color_inherit && f.background() != Color_ignore) {
458 << from_ascii(lcolor.getLaTeXName(f.background()))
460 count += lcolor.getLaTeXName(f.background()).length() + 13;
461 env = true; //We have opened a new environment
464 // If the current language is Hebrew, Arabic, or Farsi
465 // the numbers are written Left-to-Right. ArabTeX package
466 // and bidi (polyglossia with XeTeX) reorder the number automatically
467 // but the packages used for Hebrew and Farsi (Arabi) do not.
468 if (!runparams.useBidiPackage()
469 && !runparams.pass_thru
470 && bits_.number() == FONT_ON
471 && prev.fontInfo().number() != FONT_ON
472 && (language()->lang() == "hebrew"
473 || language()->lang() == "farsi"
474 || language()->lang() == "arabic_arabi")) {
475 if (runparams.use_polyglossia) {
484 if (f.emph() == FONT_ON) {
485 if (needs_cprotection) {
486 if (contains(runparams.active_chars, '^'))
487 // cprotect relies on ^ being on catcode 7
488 os << "\\begingroup\\catcode`\\^=7";
495 // \noun{} is a LyX special macro
496 if (f.noun() == FONT_ON) {
497 if (needs_cprotection) {
498 if (contains(runparams.active_chars, '^'))
499 // cprotect relies on ^ being on catcode 7
500 os << "\\begingroup\\catcode`\\^=7";
507 // The ulem commands need to be on the deepest nesting level
508 // because ulem puts every nested group or macro in a box,
509 // which prevents linebreaks (#8424, #8733)
510 if (f.underbar() == FONT_ON) {
511 if (needs_cprotection) {
512 if (contains(runparams.active_chars, '^'))
513 // cprotect relies on ^ being on catcode 7
514 os << "\\begingroup\\catcode`\\^=7";
520 ++runparams.inulemcmd;
522 if (f.uuline() == FONT_ON) {
523 if (needs_cprotection) {
524 if (contains(runparams.active_chars, '^'))
525 // cprotect relies on ^ being on catcode 7
526 os << "\\begingroup\\catcode`\\^=7";
532 ++runparams.inulemcmd;
534 if (f.strikeout() == FONT_ON) {
535 if (needs_cprotection) {
536 if (contains(runparams.active_chars, '^'))
537 // cprotect relies on ^ being on catcode 7
538 os << "\\begingroup\\catcode`\\^=7";
544 ++runparams.inulemcmd;
546 if (f.xout() == FONT_ON) {
547 if (needs_cprotection) {
548 if (contains(runparams.active_chars, '^'))
549 // cprotect relies on ^ being on catcode 7
550 os << "\\begingroup\\catcode`\\^=7";
556 ++runparams.inulemcmd;
558 if (f.uwave() == FONT_ON) {
559 if (runparams.inulemcmd) {
560 // needed with nested uwave in xout
561 // see https://tex.stackexchange.com/a/263042
562 os << "\\ULdepth=1000pt";
565 if (needs_cprotection) {
566 if (contains(runparams.active_chars, '^'))
567 // cprotect relies on ^ being on catcode 7
568 os << "\\begingroup\\catcode`\\^=7";
574 ++runparams.inulemcmd;
580 /// Writes ending block of LaTeX needed to close use of this font
581 // Returns number of chars written
582 // This one corresponds to latexWriteStartChanges(). (Asger)
583 int Font::latexWriteEndChanges(otexstream & os, BufferParams const & bparams,
584 OutputParams const & runparams,
588 bool const & closeLanguage) const
592 // reduce the current font to changes against the base
593 // font (of the layout). We use a temporary for this to
594 // avoid changing this font instance, as that would break
596 f.reduce(base.bits_);
598 if (f.family() != INHERIT_FAMILY) {
602 if (f.series() != INHERIT_SERIES) {
606 if (f.shape() != INHERIT_SHAPE) {
610 if (f.color() != Color_inherit && f.color() != Color_ignore && f.color() != Color_none) {
614 if (f.emph() == FONT_ON) {
618 if (f.noun() == FONT_ON) {
622 if (f.size() != INHERIT_SIZE) {
623 // We do not close size group in front of
624 // insets with InheritFont() false (as opposed
625 // to all other font properties) (#8384)
626 if (needPar && !closeLanguage) {
634 if (f.underbar() == FONT_ON) {
637 --runparams.inulemcmd;
639 if (f.strikeout() == FONT_ON) {
642 --runparams.inulemcmd;
644 if (f.xout() == FONT_ON) {
647 --runparams.inulemcmd;
649 if (f.uuline() == FONT_ON) {
652 --runparams.inulemcmd;
654 if (f.uwave() == FONT_ON) {
657 --runparams.inulemcmd;
660 // If the current language is Hebrew, Arabic, or Farsi
661 // the numbers are written Left-to-Right. ArabTeX package
662 // and bidi (polyglossia with XeTeX) reorder the number automatically
663 // but the packages used for Hebrew and Farsi (Arabi) do not.
664 if (!runparams.useBidiPackage()
665 && !runparams.pass_thru
666 && bits_.number() == FONT_ON
667 && next.fontInfo().number() != FONT_ON
668 && (language()->lang() == "hebrew"
669 || language()->lang() == "farsi"
670 || language()->lang() == "arabic_arabi")) {
671 if (runparams.use_polyglossia) {
681 if (open_encoding_) {
682 // We need to close the encoding even if it does not change
683 // to do correct environment nesting
684 Encoding const * const ascii = encodings.fromLyXName("ascii");
685 pair<bool, int> const c = switchEncoding(os.os(), bparams,
689 runparams.encoding = ascii;
690 open_encoding_ = false;
694 && language() != base.language() && language() != next.language()
695 && (language()->encoding()->package() != Encoding::CJK)) {
698 bool const using_begin_end =
699 runparams.use_polyglossia ||
700 !lyxrc.language_command_end.empty();
709 string Font::toString(bool const toggle) const
711 string const lang = (language() == reset_language)
712 ? "reset" : language()->lang();
715 os << "family " << bits_.family() << '\n'
716 << "series " << bits_.series() << '\n'
717 << "shape " << bits_.shape() << '\n'
718 << "size " << bits_.size() << '\n'
719 << "emph " << bits_.emph() << '\n'
720 << "underbar " << bits_.underbar() << '\n'
721 << "strikeout " << bits_.strikeout() << '\n'
722 << "xout " << bits_.xout() << '\n'
723 << "uuline " << bits_.uuline() << '\n'
724 << "uwave " << bits_.uwave() << '\n'
725 << "noun " << bits_.noun() << '\n'
726 << "number " << bits_.number() << '\n'
727 << "nospellcheck " << bits_.nospellcheck() << '\n'
728 << "color " << bits_.color() << '\n'
729 << "language " << lang << '\n'
730 << "toggleall " << convert<string>(toggle);
735 bool Font::fromString(string const & data, bool & toggle)
737 istringstream is(data);
745 token = lex.getString();
747 if (token.empty() || !lex.next())
750 if (token == "family") {
751 int const next = lex.getInteger();
752 bits_.setFamily(FontFamily(next));
754 } else if (token == "series") {
755 int const next = lex.getInteger();
756 bits_.setSeries(FontSeries(next));
758 } else if (token == "shape") {
759 int const next = lex.getInteger();
760 bits_.setShape(FontShape(next));
762 } else if (token == "size") {
763 int const next = lex.getInteger();
764 bits_.setSize(FontSize(next));
765 // FIXME: shall style be handled there? Probably not.
766 } else if (token == "emph" || token == "underbar"
767 || token == "noun" || token == "number"
768 || token == "uuline" || token == "uwave"
769 || token == "strikeout" || token == "xout"
770 || token == "nospellcheck") {
772 int const next = lex.getInteger();
773 FontState const misc = FontState(next);
777 else if (token == "underbar")
778 bits_.setUnderbar(misc);
779 else if (token == "strikeout")
780 bits_.setStrikeout(misc);
781 else if (token == "xout")
783 else if (token == "uuline")
784 bits_.setUuline(misc);
785 else if (token == "uwave")
786 bits_.setUwave(misc);
787 else if (token == "noun")
789 else if (token == "number")
790 bits_.setNumber(misc);
791 else if (token == "nospellcheck")
792 bits_.setNoSpellcheck(misc);
794 } else if (token == "color") {
795 int const next = lex.getInteger();
796 bits_.setColor(ColorCode(next));
799 } else if (token == "background") {
800 int const next = lex.getInteger();
801 bits_.setBackground(ColorCode(next));
804 } else if (token == "language") {
805 string const next = lex.getString();
806 setLanguage(languages.getLanguage(next));
808 } else if (token == "toggleall") {
809 toggle = lex.getBool();
812 // Unrecognised token
822 void Font::validate(LaTeXFeatures & features) const
824 BufferParams const & bparams = features.bufferParams();
825 Language const * doc_language = bparams.language;
827 if (bits_.noun() == FONT_ON) {
828 LYXERR(Debug::LATEX, "font.noun: " << bits_.noun());
829 features.require("noun");
830 LYXERR(Debug::LATEX, "Noun enabled. Font: " << to_utf8(stateText()));
832 if (bits_.underbar() == FONT_ON) {
833 LYXERR(Debug::LATEX, "font.underline: " << bits_.underbar());
834 features.require("ulem");
835 LYXERR(Debug::LATEX, "Underline enabled. Font: " << to_utf8(stateText()));
837 if (bits_.strikeout() == FONT_ON) {
838 LYXERR(Debug::LATEX, "font.strikeout: " << bits_.strikeout());
839 features.require("ulem");
840 LYXERR(Debug::LATEX, "Strike out enabled. Font: " << to_utf8(stateText()));
842 if (bits_.xout() == FONT_ON) {
843 LYXERR(Debug::LATEX, "font.xout: " << bits_.xout());
844 features.require("ulem");
845 LYXERR(Debug::LATEX, "Cross out enabled. Font: " << to_utf8(stateText()));
847 if (bits_.uuline() == FONT_ON) {
848 LYXERR(Debug::LATEX, "font.uuline: " << bits_.uuline());
849 features.require("ulem");
850 LYXERR(Debug::LATEX, "Double underline enabled. Font: " << to_utf8(stateText()));
852 if (bits_.uwave() == FONT_ON) {
853 LYXERR(Debug::LATEX, "font.uwave: " << bits_.uwave());
854 features.require("ulem");
855 LYXERR(Debug::LATEX, "Wavy underline enabled. Font: " << to_utf8(stateText()));
857 switch (bits_.color()) {
861 // probably we should put here all interface colors used for
862 // font displaying! For now I just add this ones I know of (Jug)
864 case Color_notelabel:
869 case Color_lightgray:
877 features.require("xcolor");
880 features.require("color");
881 LYXERR(Debug::LATEX, "Color enabled. Font: " << to_utf8(stateText()));
884 // FIXME: Do something for background and soul package?
886 if (((features.usePolyglossia() && lang_->polyglossia() != doc_language->polyglossia())
887 || (features.useBabel() && lang_->babel() != doc_language->babel())
888 || (doc_language->encoding()->package() == Encoding::CJK && lang_ != doc_language))
889 && lang_ != ignore_language
890 && lang_ != latex_language)
892 features.useLanguage(lang_);
893 LYXERR(Debug::LATEX, "Found language " << lang_->lang());
898 ostream & operator<<(ostream & os, FontState fms)
900 return os << int(fms);
904 ostream & operator<<(ostream & os, FontInfo const & f)
907 << " family " << f.family()
908 << " series " << f.series()
909 << " shape " << f.shape()
910 << " size " << f.size()
911 << " style " << f.style()
912 << " color " << f.color()
913 // FIXME: uncomment this when we support background.
914 //<< " background " << f.background()
915 << " emph " << f.emph()
916 << " underbar " << f.underbar()
917 << " strikeout " << f.strikeout()
918 << " xout " << f.xout()
919 << " uuline " << f.uuline()
920 << " uwave " << f.uwave()
921 << " noun " << f.noun()
922 << " number " << f.number()
923 << " nospellcheck " << f.nospellcheck();
927 ostream & operator<<(ostream & os, Font const & font)
929 return os << font.bits_
930 << " lang: " << (font.lang_ ? font.lang_->lang() : nullptr);