void PaintCharacterSys(Painter& sw, double x, double y, int ch, Font fnt) { DrawLock __; PAINTER_TIMING("CharacterOp"); FT_Face face = FTFace(fnt, NULL); int glyph_index = FT_Get_Char_Index(face, ch); if(glyph_index && FT_Load_Glyph(face, glyph_index, FT_LOAD_DEFAULT) == 0) RenderOutline(face->glyph->outline, sw, x, y + fnt.GetAscent()); sw.EvenOdd(true); }
void Path(Painter& sw) { sw.Translate(52, 52); for(int i = 0; i < 2; i++) { sw.Rectangle(20, 20, 60, 60); sw.Move(0, 0); sw.Cubic(99, 0, 50, 50, 99, 99); sw.Cubic(0, 99, 50, 50, 0, 0); sw.EvenOdd(i).Fill(Green()); sw.Stroke(1, Black()); sw.Translate(120, 0); } }
void PaintCharacter(Painter& sw, const Pointf& p, int chr, Font font) { GlyphInfo gi = GetGlyphInfo(font, chr); PaintCharPath pw; pw.sw = &sw; if(gi.IsNormal()) font.Render(pw, p.x, p.y, chr); else if(gi.IsReplaced()) { Font fnt = font; fnt.Face(gi.lspc); fnt.Height(gi.rspc); fnt.Render(pw, p.x, p.y + font.GetAscent() - fnt.GetAscent(), chr); } else if(gi.IsComposed()) { ComposedGlyph cg; Compose(font, chr, cg); font.Render(pw, p.x, p.y, cg.basic_char); sw.Div(); cg.mark_font.Render(pw, p.x + cg.mark_pos.x, p.y + cg.mark_pos.y, cg.mark_char); } sw.EvenOdd(true); }