mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
feat: add internal support for underlined text (closes #29)
This commit is contained in:
@@ -34,7 +34,7 @@ struct Margins {
|
||||
// Helper class for TextElements::fromString, to allow persistent formating state accross recusive calls
|
||||
struct TextElementsFromString {
|
||||
// What formatting is enabled?
|
||||
int bold = 0, italic = 0, symbol = 0;
|
||||
int bold = 0, italic = 0, underline = 0, symbol = 0;
|
||||
int soft = 0, kwpph = 0, param = 0, line = 0, soft_line = 0;
|
||||
int code = 0, code_kw = 0, code_string = 0, param_ref = 0;
|
||||
int param_id = 0, li = 0;
|
||||
@@ -78,7 +78,9 @@ private:
|
||||
if (is_tag(text, tag_start, _( "<b"))) bold += 1;
|
||||
else if (is_tag(text, tag_start, _("</b"))) bold -= 1;
|
||||
else if (is_tag(text, tag_start, _( "<i"))) italic += 1;
|
||||
else if (is_tag(text, tag_start, _("</i"))) italic -= 1;
|
||||
else if (is_tag(text, tag_start, _("</i"))) italic -= 1;
|
||||
else if (is_tag(text, tag_start, _("<u"))) underline += 1;
|
||||
else if (is_tag(text, tag_start, _("</u"))) underline -= 1;
|
||||
else if (is_tag(text, tag_start, _( "<sym"))) symbol += 1;
|
||||
else if (is_tag(text, tag_start, _("</sym"))) symbol -= 1;
|
||||
else if (is_tag(text, tag_start, _( "<line"))) line += 1;
|
||||
@@ -299,7 +301,8 @@ private:
|
||||
(kwpph > 0 ? FONT_SOFT : FONT_NORMAL) |
|
||||
(code > 0 ? FONT_CODE : FONT_NORMAL) |
|
||||
(code_kw > 0 ? FONT_CODE_KW : FONT_NORMAL) |
|
||||
(code_string > 0 ? FONT_CODE_STRING : FONT_NORMAL),
|
||||
(code_string > 0 ? FONT_CODE_STRING : FONT_NORMAL),
|
||||
underline > 0,
|
||||
fonts.empty() ? nullptr : &fonts.back(),
|
||||
param > 0 || param_ref > 0
|
||||
? ¶m_colors[(param_id++) % param_colors_count]
|
||||
|
||||
Reference in New Issue
Block a user