summaryrefslogtreecommitdiff
path: root/render/font.h
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2013-02-10 18:22:51 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2013-02-10 18:22:51 +0000
commit285a7ca6c3b7a0964f24165dd929f4003b026309 (patch)
treee93bf9795ebf942da59be6ea40ce8ed69786eb98 /render/font.h
parent7bc725fe1f2cb28f824b439a1c2be62fadfecb47 (diff)
downloadnetsurf-285a7ca6c3b7a0964f24165dd929f4003b026309.tar.gz
netsurf-285a7ca6c3b7a0964f24165dd929f4003b026309.tar.bz2
Document new nsfont_split expected behaviour.
Diffstat (limited to 'render/font.h')
-rw-r--r--render/font.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/render/font.h b/render/font.h
index bc7dc7fba..bc8df2335 100644
--- a/render/font.h
+++ b/render/font.h
@@ -73,13 +73,20 @@ struct font_functions
* \param string UTF-8 string to measure
* \param length length of string, in bytes
* \param x width available
- * \param char_offset updated to offset in string of actual_x, [0..length]
+ * \param char_offset updated to offset in string of actual_x, [1..length]
* \param actual_x updated to x coordinate of character closest to x
* \return true on success, false on error and error reported
*
- * On exit, [char_offset == 0 ||
- * string[char_offset] == ' ' ||
- * char_offset == length]
+ * On exit, char_offset indicates first character after split point.
+ *
+ * Note: char_offset of 0 should never be returned.
+ *
+ * Returns:
+ * char_offset giving split point closest to x, where actual_x <= x
+ * else
+ * char_offset giving split point closest to x, where actual_x > x
+ *
+ * Returning char_offset == length means no split possible
*/
bool (*font_split)(const plot_font_style_t *fstyle,
const char *string, size_t length,