| 309 | } |
| 310 | |
| 311 | Float2 Font::MeasureText(const StringView& text, const TextLayoutOptions& layout) |
| 312 | { |
| 313 | // Check if there is no need to do anything |
| 314 | if (text.IsEmpty()) |
| 315 | return Float2::Zero; |
| 316 | |
| 317 | // Process text |
| 318 | Array<FontLineCache, InlinedAllocation<8>> lines; |
| 319 | ProcessText(text, lines, layout); |
| 320 | |
| 321 | // Calculate bounds |
| 322 | Float2 max = Float2::Zero; |
| 323 | for (int32 i = 0; i < lines.Count(); i++) |
| 324 | { |
| 325 | const FontLineCache& line = lines[i]; |
| 326 | max = Float2::Max(max, line.Location + line.Size); |
| 327 | } |
| 328 | |
| 329 | return max; |
| 330 | } |
| 331 | |
| 332 | int32 Font::HitTestText(const StringView& text, const Float2& location, const TextLayoutOptions& layout) |
| 333 | { |
no test coverage detected