| 783 | } |
| 784 | |
| 785 | int32_t getStringWidth(std::string_view text, FontStyle fontStyle, bool noFormatting) |
| 786 | { |
| 787 | TextDrawInfo info{}; |
| 788 | info.fontStyle = fontStyle; |
| 789 | |
| 790 | info.textDrawFlags.set(TextDrawFlag::noDraw); |
| 791 | if (LocalisationService_UseTrueTypeFont()) |
| 792 | { |
| 793 | info.textDrawFlags.set(TextDrawFlag::ttf); |
| 794 | } |
| 795 | |
| 796 | if (noFormatting) |
| 797 | { |
| 798 | info.textDrawFlags.set(TextDrawFlag::noFormatting); |
| 799 | } |
| 800 | |
| 801 | RenderTarget dummy{}; |
| 802 | processString(dummy, text, info); |
| 803 | |
| 804 | return info.max.x; |
| 805 | } |
| 806 | |
| 807 | /** |
| 808 | * |
no test coverage detected