Beispiel #1
0
	virtual void Paint(Draw& w, const Rect& r, const Value& q, Color ink, Color paper, dword style) const
	{
		w.DrawRect(r, paper);
		w.DrawText(r.left, r.top, AsString(q), StdFont(), ink);
		Font fnt;
		fnt.FaceName("Bitstream Vera Sans Mono");
//		fnt.Face(Font::ARIAL);
		fnt.Height(20);
		WString txt((int)q, 1);
		w.DrawText(r.left + 40, r.top, txt, Courier(20), ink);
		GlyphInfo gi = GetGlyphMetrics(fnt, q);
		w.DrawRect(r.left + 60, r.top, gi.width, r.GetHeight(), LtCyan());
		gi = GetGlyphInfo(fnt, q);
		if(!gi.IsMissing()) {
			if(gi.IsNormal())
				w.DrawText(r.left + 60, r.top, txt, fnt);
			else
			if(gi.IsReplaced())
				w.DrawText(r.left + 60, r.top, txt, fnt().Face(gi.lspc), Magenta());
			else
			if(gi.IsComposed()) {
				ComposedGlyph g;
				if(Compose(fnt, q, g)) {
					w.DrawText(r.left + 60, r.top, WString(g.basic_char, 1), fnt, LtBlue());
					w.DrawText(r.left + 60 + g.mark_pos.x, r.top + g.mark_pos.y,
					           WString(g.mark_char, 1), g.mark_font, LtRed());
				}
			}
		}
		else
			w.DrawText(r.left + 60, r.top, txt, fnt, ink);
		w.DrawRect(r.left, r.bottom - 1, r.Width(), 1, Black());
	}
Beispiel #2
0
	virtual void Paint(Draw& w) {
		WString h = "Hello ěščřžýáíéúů ";
		for(int i = 0; i < 10; i++)
			h.Cat(20000 + i);
		w.DrawRect(GetSize(), White());
		Font fnt;
		fnt.FaceName("Bitstream Vera Sans Mono");
		fnt.Height(13);
		DoDrawText(w, 100, 100, 0, h, fnt, Black(), h.GetCount(), NULL);
		DoDrawText(w, 100, 300, 300, h, fnt, Black(), h.GetCount(), NULL);
	}