commit b7e52bb03cfd2d47249019de9c39cadcad18f547
Author: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
AuthorDate: Fri Sep 19 11:10:52 2025 +0200
Commit: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
CommitDate: Fri Sep 19 11:10:52 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 ----------
src/drivers/Xlib/Fl_Xlib_Graphics_Driver.H | 1 -
src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_xft.cxx | 8 --------
5 files changed, 2 insertions(+), 21 deletions(-)
diff --git src/Fl_Graphics_Driver.cxx src/Fl_Graphics_Driver.cxx
index dcdc258..95daea9 100644
--- src/Fl_Graphics_Driver.cxx
+++ src/Fl_Graphics_Driver.cxx
@@ -970,7 +970,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 f505619..336fa1e 100644
--- src/drivers/GDI/Fl_GDI_Graphics_Driver.H
+++ src/drivers/GDI/Fl_GDI_Graphics_Driver.H
@@ -74,7 +74,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 354957b..e901db9 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
diff --git src/drivers/Xlib/Fl_Xlib_Graphics_Driver.H src/drivers/Xlib/Fl_Xlib_Graphics_Driver.H
index fc05747..83146ae 100644
--- src/drivers/Xlib/Fl_Xlib_Graphics_Driver.H
+++ src/drivers/Xlib/Fl_Xlib_Graphics_Driver.H
@@ -122,7 +122,6 @@ public:
// --- bitmap stuff
static unsigned long create_bitmask(int w, int h, const uchar *array); // NOT virtual
void delete_bitmask(fl_uintptr_t bm) FL_OVERRIDE;
- 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/Xlib/Fl_Xlib_Graphics_Driver_font_xft.cxx src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_xft.cxx
index a7f8ae4..a7537a1 100644
--- src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_xft.cxx
+++ src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_xft.cxx
@@ -118,14 +118,6 @@ static void correct_extents (float s, int &dx, int &dy, int &w, int &h) {
}
}
-void Fl_Xlib_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);
-}
-
#if ! USE_PANGO
[ Direct Link to Message ]