Added: font style to <pre> element

This commit is contained in:
Nimetu 2016-07-24 16:07:36 +03:00
parent 9e17c46d19
commit db6a314479

View file

@ -1914,7 +1914,29 @@ namespace NLGUI
newParagraph(PBeginSpace); newParagraph(PBeginSpace);
break; break;
case HTML_PRE: case HTML_PRE:
_PRE.push_back(true); {
CStyleParams style;
style.TextColor = getTextColor();
style.FontFamily = "monospace";
style.FontSize = getFontSize();
style.FontWeight = getFontWeight();
style.FontOblique = getFontOblique();
style.Underlined = getFontUnderlined();
style.StrikeThrough = getFontStrikeThrough();
if (present[MY_HTML_SPAN_STYLE] && value[MY_HTML_SPAN_STYLE])
getStyleParams(value[MY_HTML_SPAN_STYLE], style);
_TextColor.push_back(style.TextColor);
_FontFamily.push_back(style.FontFamily);
_FontSize.push_back(style.FontSize);
_FontWeight.push_back(style.FontWeight);
_FontOblique.push_back(style.FontOblique);
_FontUnderlined.push_back(style.Underlined);
_FontStrikeThrough.push_back(style.StrikeThrough);
_PRE.push_back(true);
}
break; break;
case HTML_TABLE: case HTML_TABLE:
{ {
@ -2333,6 +2355,13 @@ namespace NLGUI
endParagraph(); endParagraph();
break; break;
case HTML_PRE: case HTML_PRE:
popIfNotEmpty (_FontFamily);
popIfNotEmpty (_FontSize);
popIfNotEmpty (_FontWeight);
popIfNotEmpty (_FontOblique);
popIfNotEmpty (_TextColor);
popIfNotEmpty (_FontUnderlined);
popIfNotEmpty (_FontStrikeThrough);
popIfNotEmpty (_PRE); popIfNotEmpty (_PRE);
break; break;
case HTML_DIV: case HTML_DIV: