Mercurial > hg > openttd
comparison src/gfx.cpp @ 20676:7e084f1014bd draft
-Fix: Textbuf caret rendering for complex scripts (e.g. Tamil).
author | Michael Lutz <michi@icosahedron.de> |
---|---|
date | Wed, 17 Jul 2013 22:46:06 +0200 |
parents | e98038d83f05 |
children | 42bd8405a50c |
comparison
equal
deleted
inserted
replaced
20675:63f66b340b9a | 20676:7e084f1014bd |
---|---|
706 GetString(buffer, strid, lastof(buffer)); | 706 GetString(buffer, strid, lastof(buffer)); |
707 return GetStringBoundingBox(buffer); | 707 return GetStringBoundingBox(buffer); |
708 } | 708 } |
709 | 709 |
710 /** | 710 /** |
711 * Get the leading corner of a character in a single-line string relative | |
712 * to the start of the string. | |
713 * @param str String containing the character. | |
714 * @param ch Pointer to the character in the string. | |
715 * @param start_fontsize Font size to start the text with. | |
716 * @return Upper left corner of the glyph associated with the character. | |
717 */ | |
718 Point GetCharPosInString(const char *str, const char *ch, FontSize start_fontsize) | |
719 { | |
720 Layouter layout(str, INT32_MAX, TC_FROMSTRING, start_fontsize); | |
721 return layout.GetCharPosition(ch); | |
722 } | |
723 | |
724 /** | |
711 * Draw single character horizontally centered around (x,y) | 725 * Draw single character horizontally centered around (x,y) |
712 * @param c Character (glyph) to draw | 726 * @param c Character (glyph) to draw |
713 * @param x X position to draw character | 727 * @param x X position to draw character |
714 * @param y Y position to draw character | 728 * @param y Y position to draw character |
715 * @param colour Colour to use, see DoDrawString() for details | 729 * @param colour Colour to use, see DoDrawString() for details |