public static SizeF DrawSelectedString(this IGUIContext ctx, string text, IGUIFont font, int selStart, int selLength, RectangleF rect, float offsetX, FontFormat format, Color foreColor, Color selectionBackColor, Color selectionForeColor) { if (ctx == null || text == null) { return(SizeF.Empty); } SizeF retVal; font.Begin(ctx); retVal = font.PrintSelectedString(text, selStart, selLength, rect, offsetX, format, foreColor, selectionBackColor, selectionForeColor); font.End(); return(retVal); }
public SizeF PrintSelectedString(IGUIContext ctx, string fontTag, string text, int selStart, int selLength, RectangleF bounds, float offsetX, FontFormat format, Color foreColor, Color selectionBackColor, Color selectionForeColor) { IGUIFont font = FontByTag(fontTag); if (font == null) { return(SizeF.Empty); } font.Begin(ctx); try { return(font.PrintSelectedString(text, selStart, selLength, bounds, offsetX, format, foreColor, selectionBackColor, selectionForeColor)); } catch (Exception ex) { ex.LogError(); return(SizeF.Empty); } finally { font.End(); } }