diff options
| author | Ian MacArthur <imacarthur@gmail.com> | 2008-11-19 20:34:27 +0000 |
|---|---|---|
| committer | Ian MacArthur <imacarthur@gmail.com> | 2008-11-19 20:34:27 +0000 |
| commit | 865f3d8e61f5fe7a582f1233b90bd2ef8260c827 (patch) | |
| tree | 09421807f61cff4476a26387880c9bcef15e0e27 /src/fl_font.cxx | |
| parent | 9c7af9b2cf586dd9aaf0b11793514f458d09afed (diff) | |
STR 2076: experimental fl_text_extents patch applied. Please feedback comments.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6529 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/fl_font.cxx')
| -rw-r--r-- | src/fl_font.cxx | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/fl_font.cxx b/src/fl_font.cxx index bb65303b7..20bdc198b 100644 --- a/src/fl_font.cxx +++ b/src/fl_font.cxx @@ -25,6 +25,17 @@ // http://www.fltk.org/str.php // +#ifdef WIN32 +# define WIN32_LEAN_AND_MEAN +/* We require Windows 2000 features such as GetGlyphIndices */ +# if !defined(WINVER) || (WINVER < 0x0500) +# define WINVER 0x0500 +# endif +# if !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0500) +# define _WIN32_WINNT 0x0500 +# endif +#endif + // Select fonts from the FLTK font table. #include "flstring.h" #include <FL/Fl.H> @@ -55,6 +66,14 @@ void fl_draw(const char* str, int x, int y) { fl_draw(str, strlen(str), x, y); } +void fl_text_extents(const char *c, int &dx, int &dy, int &w, int &h) { + if (c) return fl_text_extents(c, strlen(c), dx, dy, w, h); + // else + w = 0; h = 0; + dx = 0; dy = 0; +} // fl_text_extents + + #if !USE_XFT && !__APPLE__ void fl_draw(const char* str, int l, float x, float y) { fl_draw(str, l, (int)x, (int)y); |
