| 816 | } |
| 817 | |
| 818 | ofRectangle RetinaTrueTypeFont::DrawStringWrap(std::string str, float size, float x, float y, float width) |
| 819 | { |
| 820 | if (!mLoaded) |
| 821 | return ofRectangle(); |
| 822 | |
| 823 | TheSynth->LockRender(true); |
| 824 | nvgFontFaceId(gNanoVG, mFontHandle); |
| 825 | nvgFontSize(gNanoVG, size); |
| 826 | nvgTextBox(gNanoVG, x, y, width, str.c_str(), nullptr); |
| 827 | float bounds[4]; |
| 828 | nvgTextBoxBounds(gNanoVG, x, y, width, str.c_str(), nullptr, bounds); |
| 829 | ofRectangle rect(bounds[0], bounds[1], bounds[2] - bounds[0], bounds[3] - bounds[1]); |
| 830 | TheSynth->LockRender(false); |
| 831 | return rect; |
| 832 | } |
| 833 | |
| 834 | float RetinaTrueTypeFont::GetStringWidth(std::string str, float size) |
| 835 | { |
no test coverage detected