public static Texture RenderText(TextRenderOptions options, string text) { Texture texture = TextureFactory.CreateTexture(); Bitmap b = new Bitmap(_textRendererDrawText(options, text)); texture.InitFromBitmap(b); return texture; }
private static extern Rect _textRendererGetTextBounds(TextRenderOptions opt,string text);
private static extern IntPtr _textRendererDrawText(TextRenderOptions opt,string text);
public static Rect GetTextBounds(TextRenderOptions options, string text) { return _textRendererGetTextBounds(options, text); }