- // track whether we have opened these tags
- bool emph_flag = false;
- bool bold_flag = false;
- bool noun_flag = false;
- bool ubar_flag = false;
- bool dbar_flag = false;
- bool sout_flag = false;
- bool wave_flag = false;
- // shape tags
- bool shap_flag = false;
- // family tags
- bool faml_flag = false;
- // size tags
- bool size_flag = false;
-
- Layout const & style = *d->layout_;
-
- if (start_paragraph)
- xs.startDivision(allowEmpty());
-
- FontInfo font_old =
- style.labeltype == LABEL_MANUAL ? style.labelfont : style.font;
-
- FontShape curr_fs = INHERIT_SHAPE;
- FontFamily curr_fam = INHERIT_FAMILY;
- FontSize curr_size = INHERIT_SIZE;
-
- string const default_family =
- buf.masterBuffer()->params().fonts_default_family;
-
- vector<xml::FontTag> tagsToOpen;
- vector<xml::EndFontTag> tagsToClose;
-
- // parsing main loop
- for (pos_type i = initial; i < size(); ++i) {
- // let's not show deleted material in the output
- if (isDeleted(i))
- continue;
-
- Font const font = getFont(buf.masterBuffer()->params(), i, outerfont);
-
- // emphasis
- FontState curstate = font.fontInfo().emph();
- if (font_old.emph() != curstate)
- doFontSwitchDocBook(tagsToOpen, tagsToClose, emph_flag, curstate, xml::FT_EMPH);
-
- // noun
- curstate = font.fontInfo().noun();
- if (font_old.noun() != curstate)
- doFontSwitchDocBook(tagsToOpen, tagsToClose, noun_flag, curstate, xml::FT_NOUN);
-
- // underbar
- curstate = font.fontInfo().underbar();
- if (font_old.underbar() != curstate)
- doFontSwitchDocBook(tagsToOpen, tagsToClose, ubar_flag, curstate, xml::FT_UBAR);
-
- // strikeout
- curstate = font.fontInfo().strikeout();
- if (font_old.strikeout() != curstate)
- doFontSwitchDocBook(tagsToOpen, tagsToClose, sout_flag, curstate, xml::FT_SOUT);
-
- // double underbar
- curstate = font.fontInfo().uuline();
- if (font_old.uuline() != curstate)
- doFontSwitchDocBook(tagsToOpen, tagsToClose, dbar_flag, curstate, xml::FT_DBAR);
-
- // wavy line
- curstate = font.fontInfo().uwave();
- if (font_old.uwave() != curstate)
- doFontSwitchDocBook(tagsToOpen, tagsToClose, wave_flag, curstate, xml::FT_WAVE);
-
- // bold
- // a little hackish, but allows us to reuse what we have.
- curstate = (font.fontInfo().series() == BOLD_SERIES ? FONT_ON : FONT_OFF);
- if (font_old.series() != font.fontInfo().series())
- doFontSwitchDocBook(tagsToOpen, tagsToClose, bold_flag, curstate, xml::FT_BOLD);
-
- // Font shape
- curr_fs = font.fontInfo().shape();
- FontShape old_fs = font_old.shape();
- if (old_fs != curr_fs) {
+ // track whether we have opened these tags
+ bool emph_flag = false;
+ bool bold_flag = false;
+ bool noun_flag = false;
+ bool ubar_flag = false;
+ bool dbar_flag = false;
+ bool sout_flag = false;
+ bool wave_flag = false;
+ // shape tags
+ bool shap_flag = false;
+ // family tags
+ bool faml_flag = false;
+ // size tags
+ bool size_flag = false;
+
+ Layout const & style = *d->layout_;
+
+ if (start_paragraph)
+ xs.startDivision(allowEmpty());
+
+ FontInfo font_old =
+ style.labeltype == LABEL_MANUAL ? style.labelfont : style.font;
+
+ FontShape curr_fs = INHERIT_SHAPE;
+ FontFamily curr_fam = INHERIT_FAMILY;
+ FontSize curr_size = INHERIT_SIZE;
+
+ string const default_family =
+ buf.masterBuffer()->params().fonts_default_family;
+
+ vector<xml::FontTag> tagsToOpen;
+ vector<xml::EndFontTag> tagsToClose;
+
+ // parsing main loop
+ for (pos_type i = initial; i < size(); ++i) {
+ // let's not show deleted material in the output
+ if (isDeleted(i))
+ continue;
+
+ Font const font = getFont(buf.masterBuffer()->params(), i, outerfont);
+
+ // emphasis
+ FontState curstate = font.fontInfo().emph();
+ if (font_old.emph() != curstate)
+ doFontSwitchDocBook(tagsToOpen, tagsToClose, emph_flag, curstate, xml::FT_EMPH);
+
+ // noun
+ curstate = font.fontInfo().noun();
+ if (font_old.noun() != curstate)
+ doFontSwitchDocBook(tagsToOpen, tagsToClose, noun_flag, curstate, xml::FT_NOUN);
+
+ // underbar
+ curstate = font.fontInfo().underbar();
+ if (font_old.underbar() != curstate)
+ doFontSwitchDocBook(tagsToOpen, tagsToClose, ubar_flag, curstate, xml::FT_UBAR);
+
+ // strikeout
+ curstate = font.fontInfo().strikeout();
+ if (font_old.strikeout() != curstate)
+ doFontSwitchDocBook(tagsToOpen, tagsToClose, sout_flag, curstate, xml::FT_SOUT);
+
+ // double underbar
+ curstate = font.fontInfo().uuline();
+ if (font_old.uuline() != curstate)
+ doFontSwitchDocBook(tagsToOpen, tagsToClose, dbar_flag, curstate, xml::FT_DBAR);
+
+ // wavy line
+ curstate = font.fontInfo().uwave();
+ if (font_old.uwave() != curstate)
+ doFontSwitchDocBook(tagsToOpen, tagsToClose, wave_flag, curstate, xml::FT_WAVE);
+
+ // bold
+ // a little hackish, but allows us to reuse what we have.
+ curstate = (font.fontInfo().series() == BOLD_SERIES ? FONT_ON : FONT_OFF);
+ if (font_old.series() != font.fontInfo().series())
+ doFontSwitchDocBook(tagsToOpen, tagsToClose, bold_flag, curstate, xml::FT_BOLD);
+
+ // Font shape
+ curr_fs = font.fontInfo().shape();
+ FontShape old_fs = font_old.shape();
+ if (old_fs != curr_fs) {