feat: add internal support for underlined text (closes #29)

This commit is contained in:
Brendan Hagan
2022-07-26 22:11:09 -04:00
parent 393923a292
commit 78227a30da
4 changed files with 14 additions and 8 deletions
+4 -1
View File
@@ -50,7 +50,7 @@ void Font::initDependencies(Context& ctx, const Dependency& dep) const {
shadow_color.initDependencies(ctx, dep);
}
FontP Font::make(int add_flags, String const* other_family, Color const* other_color, double const* other_size) const {
FontP Font::make(int add_flags, bool add_underline, String const* other_family, Color const* other_color, double const* other_size) const {
FontP f(new Font(*this));
f->flags |= add_flags;
if (add_flags & FONT_CODE_STRING) {
@@ -66,6 +66,9 @@ FontP Font::make(int add_flags, String const* other_family, Color const* other_c
if (add_flags & FONT_SOFT) {
f->color = f->separator_color;
f->shadow_displacement = RealSize(0,0); // no shadow
}
if (add_underline) {
f->underline = true;
}
if (other_color) {
f->color = *other_color;
+1 -1
View File
@@ -60,7 +60,7 @@ public:
}
/// Add style to a font, and optionally change the font family, color and size
FontP make(int add_flags, String const* other_family, Color const* other_color, double const* other_size) const;
FontP make(int add_flags, bool add_underline, String const* other_family, Color const* other_color, double const* other_size) const;
/// Convert this font to a wxFont
wxFont toWxFont(double scale) const;