summaryrefslogtreecommitdiff
path: root/FL/fl_draw.H
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2011-02-18 13:39:48 +0000
committerManolo Gouy <Manolo>2011-02-18 13:39:48 +0000
commit199b32d9213584e232aee11d2a4d16a26f1d508d (patch)
treeff04fbca414c4ab7a497283f082bcf5f12b9a6de /FL/fl_draw.H
parent2c129b4833f45157fde8f90451240d4c00bbc96d (diff)
Added virtual width(), height(), descent() and text_extents() functions to the Fl_Graphics_Driver
class to prepare for the future definition of graphics drivers that fully deal with text measurement. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8442 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'FL/fl_draw.H')
-rw-r--r--FL/fl_draw.H11
1 files changed, 6 insertions, 5 deletions
diff --git a/FL/fl_draw.H b/FL/fl_draw.H
index a9651846d..1211c44a7 100644
--- a/FL/fl_draw.H
+++ b/FL/fl_draw.H
@@ -495,21 +495,21 @@ inline Fl_Fontsize fl_size() {return fl_graphics_driver->size();}
Returns the recommended minimum line spacing for the current font.
You can also use the value of \p size passed to fl_font()
*/
-FL_EXPORT int fl_height(); // using "size" should work ok
+inline int fl_height() {return fl_graphics_driver->height();}
FL_EXPORT int fl_height(int font, int size);
/**
Returns the recommended distance above the bottom of a fl_height() tall box to
draw the text at so it looks centered vertically in that box.
*/
-FL_EXPORT int fl_descent();
+inline int fl_descent() {return fl_graphics_driver->descent();}
/** Return the typographical width of a nul-terminated string */
FL_EXPORT double fl_width(const char* txt);
/** Return the typographical width of a sequence of \p n characters */
-FL_EXPORT double fl_width(const char* txt, int n);
+inline double fl_width(const char* txt, int n) {return fl_graphics_driver->width(txt, n);}
/** Return the typographical width of a single character :
\note if a valid fl_gc is NOT found then it uses the first window gc,
or the screen gc if no fltk window is available when called. */
-FL_EXPORT double fl_width(unsigned int);
+inline double fl_width(unsigned int c) {return fl_graphics_driver->width(c);}
/** Determine the minimum pixel dimensions of a nul-terminated string.
Usage: given a string "txt" drawn using fl_draw(txt, x, y) you would determine
@@ -522,7 +522,8 @@ FL_EXPORT void fl_text_extents(const char*, int& dx, int& dy, int& w, int& h); /
/** Determine the minimum pixel dimensions of a sequence of \p n characters.
\see fl_text_extents(const char*, int& dx, int& dy, int& w, int& h)
*/
-FL_EXPORT void fl_text_extents(const char*, int n, int& dx, int& dy, int& w, int& h);
+inline void fl_text_extents(const char *t, int n, int& dx, int& dy, int& w, int& h)
+ {fl_graphics_driver->text_extents(t, n, dx, dy, w, h);}
// font encoding:
// Note: doxygen comments here to avoid duplication for os-sepecific cases