public CharStreamer getChar(char c) { int index = (int)c - 32; if (index < 0 || (index > 128-32)) index = 0; CharStreamer result = new CharStreamer(maxHeight, data, (int)(firstChar+index*charWordSize)); return result; }
public Point TextSize(string text) { int width = 0; foreach (char c in text) { CharStreamer cs = getChar(c); width += (int)cs.width; } return(new Point(width, (int)maxHeight)); }
public int TextWidth(Font f, string text) { int width = 0; foreach (char c in text) { CharStreamer cs = f.getChar(c); width += (int)cs.width; } return(width); }
public CharStreamer getChar(char c) { int index = (int)c - 32; if (index < 0 || (index > 128 - 32)) { index = 0; } CharStreamer result = new CharStreamer(maxHeight, data, (int)(firstChar + index * charWordSize)); return(result); }
public void WriteText(Font f, Point p, string text, bool color) { foreach (char c in text) { CharStreamer cs = f.getChar(c); if (p.X + cs.width > Lcd.Width) { break; } DrawBitmap(cs, p, cs.width, cs.height, color); p.X += (int)cs.width; } }