diff options
| author | Manolo Gouy <Manolo> | 2016-03-30 17:09:15 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2016-03-30 17:09:15 +0000 |
| commit | 5adda33f962a1c9798d6723aff80e94b4dee69f9 (patch) | |
| tree | a437a9a05bff2199e39b2809777a1f4e3941b61a /src/drivers/PostScript/Fl_PostScript.cxx | |
| parent | 730f2d12b275552cc142970f4f8a6a21e1beb5f0 (diff) | |
Finish removing platform-dependent code from Fl_PostScript.cxx
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11477 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/drivers/PostScript/Fl_PostScript.cxx')
| -rw-r--r-- | src/drivers/PostScript/Fl_PostScript.cxx | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/src/drivers/PostScript/Fl_PostScript.cxx b/src/drivers/PostScript/Fl_PostScript.cxx index 9027faca4..d25915a5a 100644 --- a/src/drivers/PostScript/Fl_PostScript.cxx +++ b/src/drivers/PostScript/Fl_PostScript.cxx @@ -16,9 +16,7 @@ // http://www.fltk.org/str.php // -#include <config.h> #include <FL/Fl.H> -#include <FL/x.H> #include <FL/fl_ask.H> #include <FL/fl_draw.H> #include <stdio.h> @@ -26,12 +24,6 @@ #include <FL/Fl_Native_File_Chooser.H> #include <FL/Fl_System_Driver.H> #include <stdarg.h> -#if defined(USE_X11) -#include <src/Fl_Font.H> -#if USE_XFT -#include <X11/Xft/Xft.h> -#endif -#endif /** \brief Label of the PostScript file chooser window */ const char *Fl_PostScript_File_Device::file_chooser_title = "Select a .ps file"; @@ -1041,12 +1033,8 @@ static uchar *calc_mask(uchar *img, int w, int h, Fl_Color bg) // write to PostScript a bitmap image of a UTF8 string void Fl_PostScript_Graphics_Driver::transformed_draw_extra(const char* str, int n, double x, double y, int w, bool rtl) { - // scale for bitmask computation -#if defined(USE_X11) && !USE_XFT - float scale = 1; // don't scale because we can't expect to have scalable fonts -#else - float scale = 2; -#endif + // scale for bitmask computation is set to 1 when we can't expect to have scalable fonts + float scale = Fl_Display_Device::display_device()->driver()->scale_bitmap_for_PostScript(); Fl_Fontsize old_size = size(); Fl_Font fontnum = Fl_Graphics_Driver::font(); int w_scaled = (int)(w * (scale + 0.5)); @@ -1060,11 +1048,11 @@ void Fl_PostScript_Graphics_Driver::transformed_draw_extra(const char* str, int // color offscreen background with a shade contrasting with the text color fl_rectf(0, 0, w_scaled, (int)(h+3*scale) ); fl_color(text_color); -#if defined(USE_X11) && !USE_XFT - // force seeing this font as new so it's applied to the offscreen graphics context - fl_graphics_driver->font_descriptor(NULL); - fl_font(fontnum, 0); -#endif + if (scale < 1.5) { + // force seeing this font as new so it's applied to the offscreen graphics context + fl_graphics_driver->font_descriptor(NULL); + fl_font(fontnum, 0); + } fl_font(fontnum, (Fl_Fontsize)(scale * old_size) ); int w2 = (int)fl_width(str, n); // draw string in offscreen |
