(svn r25651) -Fix: Textbuf caret rendering for complex scripts (e.g. Tamil).

This commit is contained in:
michi_cc
2013-08-05 20:35:23 +00:00
parent dffae26a0e
commit 82d6d4be3d
6 changed files with 105 additions and 25 deletions

View File

@@ -707,6 +707,20 @@ Dimension GetStringBoundingBox(StringID strid)
return GetStringBoundingBox(buffer);
}
/**
* Get the leading corner of a character in a single-line string relative
* to the start of the string.
* @param str String containing the character.
* @param ch Pointer to the character in the string.
* @param start_fontsize Font size to start the text with.
* @return Upper left corner of the glyph associated with the character.
*/
Point GetCharPosInString(const char *str, const char *ch, FontSize start_fontsize)
{
Layouter layout(str, INT32_MAX, TC_FROMSTRING, start_fontsize);
return layout.GetCharPosition(ch);
}
/**
* Draw single character horizontally centered around (x,y)
* @param c Character (glyph) to draw