diff options
| author | Greg Ercolano <erco@seriss.com> | 2012-05-08 16:15:34 +0000 |
|---|---|---|
| committer | Greg Ercolano <erco@seriss.com> | 2012-05-08 16:15:34 +0000 |
| commit | ebf71d633b39f82437f440917729767e5572a61e (patch) | |
| tree | d7afb6aeba6970fa12c5f5618b5c1d7187377dcb /documentation | |
| parent | 21520a3d5eb3222fc255fe046ac5794a30bf35ef (diff) | |
Documentation improvements:
o Added fl_text_extents() to the 'Drawing things in FLTK' section
o Added 'see also' sections to all the text measuring functions in that section
o Added detail to fl_text_extents() docs regarding it not handling FLTK symbols,
as non-public comment for that method indicates.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9463 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'documentation')
| -rw-r--r-- | documentation/src/drawing.dox | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/documentation/src/drawing.dox b/documentation/src/drawing.dox index b5c69c4b1..e0981d051 100644 --- a/documentation/src/drawing.dox +++ b/documentation/src/drawing.dox @@ -627,8 +627,18 @@ void fl_measure(const char *str, int& w, int& h, int draw_symbols) \par Measure how wide and tall the string will be when printed by -the \p fl_draw(...align) function. +the \p fl_draw(...align) function. This includes leading/trailing +white space in the string, kerning, etc. +\par If the incoming \p w is non-zero it will wrap to that width. +\par +Refer to the full documentation for fl_measure() for details +on usage and how to avoide common pitfalls. + +\see fl_text_extents() -- measure the 'inked' area of a string +\see fl_width() -- measure the pixel width of a string or single character +\see fl_height() -- measure the pixel height of the current font +\see fl_descent() -- the height of the descender for the current font int fl_height() @@ -637,6 +647,8 @@ Recommended minimum line spacing for the current font. You can also just use the value of \p size passed to \ref drawing_fl_font "fl_font()". +\see fl_text_extents(), fl_measure(), fl_width(), fl_descent() + int fl_descent() \par @@ -651,6 +663,24 @@ double fl_width(unsigned int unicode_char) Return the pixel width of a nul-terminated string, a sequence of \p n characters, or a single character in the current font. +\see fl_measure(), fl_text_extents(), fl_height(), fl_descent() + +void fl_text_extents(const char* txt, int& dx, int& dy, int& w, int& h) + +\par +Determines the minimum pixel dimensions of a nul-terminated string, +ie. the 'inked area'. +\par +Given a string "txt" drawn using fl_draw(txt, x, y) you would determine +its pixel extents on the display using fl_text_extents(txt, dx, dy, wo, ho) +such that a bounding box that exactly fits around the inked area of the text +could be drawn with fl_rect(x+dx, y+dy, wo, ho). +\par +Refer to the full documentation for fl_text_extents() for details +on usage. + +\see fl_measure(), fl_width(), fl_height(), fl_descent() + const char* fl_shortcut_label(int shortcut) \par |
