diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2022-12-04 09:31:24 +0100 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2022-12-04 09:31:24 +0100 |
| commit | 1b938ab8b1ec3087366700a43110a8c6e58694fe (patch) | |
| tree | 2785ed172437f5bf70ed45342d245f466c0e6034 /src/drivers | |
| parent | 70e19a9e007f38aee308b0669caf1e219f2ae7b6 (diff) | |
Fl_Cairo_Graphics_Driver: simpler way to construct font from name+size
Diffstat (limited to 'src/drivers')
| -rw-r--r-- | src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx b/src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx index 590287e48..5a687707b 100644 --- a/src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx +++ b/src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx @@ -1120,9 +1120,7 @@ Fl_Cairo_Font_Descriptor::Fl_Cairo_Font_Descriptor(const char* name, Fl_Fontsize Fl_Font_Descriptor(name, size) { char *string = new char[strlen(name) + 10]; strcpy(string, name); - // The factor of 0.75 below gives cairo-produced text the same size as - // Xft-produced text for the same FLTK font size. - snprintf(string + strlen(string), 10, " %d", int(size * 0.75 + 0.5) ); + snprintf(string + strlen(string), 10, " %dpx", size); //A PangoFontDescription describes a font in an implementation-independent manner. fontref = pango_font_description_from_string(string); delete[] string; |
