public int MeasureTextWidth(string text, ILm15Sgfnz07Font font = null) { ILm15Sgfnz07Font destFont = font ?? DefaultFont; int result = text.Length * (destFont.Width + 1); return(result); }
public void Text(string text, int x, int y, ushort foreColor, ushort backColor, ILm15Sgfnz07Font font = null) { ILm15Sgfnz07Font destFont = font ?? DefaultFont; for (int i = 0; i < text.Length; i++) { char chr = text[i]; if (chr != '\n' && chr != '\r') { Char(chr, destFont, x, y, foreColor, backColor); } x = (byte)(x + destFont.Width + 1); if (x > Width || chr == '\n') { y = (byte)(y + destFont.Height + 1); x = 0; } } }
public int MeasureTextWidth(string text, ILm15Sgfnz07Font font = null) { ILm15Sgfnz07Font destFont = font ?? DefaultFont; int result = text.Length * (destFont.Width + 1); return result; }
public void Text(string text, int x, int y, ushort foreColor, ushort backColor, ILm15Sgfnz07Font font = null) { ILm15Sgfnz07Font destFont = font ?? DefaultFont; for (int i = 0; i < text.Length; i++) { char chr = text[i]; if (chr != '\n' && chr != '\r') Char(chr, destFont, x, y, foreColor, backColor); x = (byte)(x + destFont.Width + 1); if (x > Width || chr == '\n') { y = (byte)(y + destFont.Height + 1); x = 0; } } }
private void Char(char value, ILm15Sgfnz07Font font, int x, int y, ushort foreColor, ushort backColor) { ushort[] img = font.GetImage(value, foreColor, backColor); DrawImage(img, x, y, font.Width, font.Height); }