commit cd120b3ffb27113f8f86b05b693106d28d1b994c
Author: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
AuthorDate: Fri Sep 19 11:29:07 2025 +0200
Commit: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
CommitDate: Fri Sep 19 11:29:07 2025 +0200
Underline does not appear in some fonts and scales (Windows,X11-noCairo) (#1308)
src/Fl_Graphics_Driver.cxx | 3 ++-
src/drivers/GDI/Fl_GDI_Graphics_Driver.H | 1 -
src/drivers/GDI/Fl_GDI_Graphics_Driver_font.cxx | 10 ----------
3 files changed, 2 insertions(+), 12 deletions(-)
diff --git src/Fl_Graphics_Driver.cxx src/Fl_Graphics_Driver.cxx
index 494d633..1fc645e 100644
--- src/Fl_Graphics_Driver.cxx
+++ src/Fl_Graphics_Driver.cxx
@@ -979,7 +979,8 @@ int Fl_Scalable_Graphics_Driver::descent() {
void Fl_Scalable_Graphics_Driver::draw(const char *str, int n, int x, int y) {
if (!size_ || !font_descriptor()) font(FL_HELVETICA, FL_NORMAL_SIZE);
Fl_Region r2 = scale_clip(scale());
- draw_unscaled(str, n, floor(x), floor(y));
+ int offset = (scale() == 1 ? 0 : -1); // for issue #1308
+ draw_unscaled(str, n, floor(x), floor(y + offset));
unscale_clip(r2);
}
diff --git src/drivers/GDI/Fl_GDI_Graphics_Driver.H src/drivers/GDI/Fl_GDI_Graphics_Driver.H
index 4d6cc9c..1f33b0b 100644
--- src/drivers/GDI/Fl_GDI_Graphics_Driver.H
+++ src/drivers/GDI/Fl_GDI_Graphics_Driver.H
@@ -79,7 +79,6 @@ public:
static HBITMAP calc_HBITMAP_mask(Fl_RGB_Image *mask);
void delete_bitmask(fl_uintptr_t bm) FL_OVERRIDE;
HBITMAP create_alphamask(int w, int h, int d, int ld, const uchar *array);
- void draw(const char *str, int n, int x, int y) FL_OVERRIDE;
void draw_unscaled(const char* str, int n, int x, int y) FL_OVERRIDE;
void draw_unscaled(int angle, const char *str, int n, int x, int y) FL_OVERRIDE;
void rtl_draw_unscaled(const char* str, int n, int x, int y) FL_OVERRIDE;
diff --git src/drivers/GDI/Fl_GDI_Graphics_Driver_font.cxx src/drivers/GDI/Fl_GDI_Graphics_Driver_font.cxx
index b74241b..daf12d5 100644
--- src/drivers/GDI/Fl_GDI_Graphics_Driver_font.cxx
+++ src/drivers/GDI/Fl_GDI_Graphics_Driver_font.cxx
@@ -593,16 +593,6 @@ exit_error:
return;
} // fl_text_extents
-
-void Fl_GDI_Graphics_Driver::draw(const char *str, int n, int x, int y) {
- if (!size_ || !font_descriptor()) font(FL_HELVETICA, FL_NORMAL_SIZE);
- Fl_Region r2 = scale_clip(scale());
- int offset = (scale() == 1 ? 0 : -1); // for issue #1308
- draw_unscaled(str, n, floor(x), floor(y + offset));
- unscale_clip(r2);
-}
-
-
void Fl_GDI_Graphics_Driver::draw_unscaled(const char* str, int n, int x, int y) {
COLORREF oldColor = SetTextColor(gc_, fl_RGB());
// avoid crash if no font has been set yet
[ Direct Link to Message ]