* 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 pos Index 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. */
| 423 | * @return Upper left corner of the glyph associated with the character. |
| 424 | */ |
| 425 | ParagraphLayouter::Position GetCharPosInString(std::string_view str, size_t pos, FontSize start_fontsize) |
| 426 | { |
| 427 | assert(pos <= str.size()); |
| 428 | auto it_ch = str.begin() + pos; |
| 429 | |
| 430 | Layouter layout(str, INT32_MAX, start_fontsize); |
| 431 | return layout.GetCharPosition(it_ch); |
| 432 | } |
| 433 | |
| 434 | /** |
| 435 | * Get the character from a string that is drawn at a specific position. |
no test coverage detected