Author: greg.ercolano
Date: 2012-05-08 09:15:34 -0700 (Tue, 08 May 2012)
New Revision: 9463
Log:
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.
Modified:
branches/branch-1.3/FL/fl_draw.H
branches/branch-1.3/documentation/src/drawing.dox
Modified: branches/branch-1.3/FL/fl_draw.H
===================================================================
--- branches/branch-1.3/FL/fl_draw.H 2012-05-08 15:22:39 UTC (rev 9462)
+++ branches/branch-1.3/FL/fl_draw.H 2012-05-08 16:15:34 UTC (rev 9463)
@@ -528,6 +528,8 @@
such that a bounding box that exactly fits around the text could be drawn
with
fl_rect(x+dx, y+dy, wo, ho). Note the dx, dy values hold the offset of the
first
"colored in" pixel of the string, from the draw origin.
+
+ No FLTK symbol expansion will be performed.
*/
FL_EXPORT void fl_text_extents(const char*, int& dx, int& dy, int& w, int& h);
// NO fltk symbol expansion will be performed
/** Determines the minimum pixel dimensions of a sequence of \p n characters.
Modified: branches/branch-1.3/documentation/src/drawing.dox
===================================================================
--- branches/branch-1.3/documentation/src/drawing.dox 2012-05-08 15:22:39 UTC
(rev 9462)
+++ branches/branch-1.3/documentation/src/drawing.dox 2012-05-08 16:15:34 UTC
(rev 9463)
@@ -627,9 +627,19 @@
\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()
\par
@@ -637,6 +647,8 @@
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 @@
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
_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit