void Div(Painter& sw) { sw.Character(100, 100, 'O', Arial(100)) .Character(100, 150, 'O', Arial(100)) .Fill(Black()); sw.Translate(200, 0); sw.Character(100, 100, 'O', Arial(100)) .Div() .Character(100, 150, 'O', Arial(100)) .Fill(Black()); }
void TextOnPath(Painter& sw) { Font fnt = Roman(100); FontInfo fi = fnt.Info(); double pos = 0; const char *s = "Hello world, this is text on path!"; int l = GetTextSize(s, fnt).cx; double r = l / (2 * M_PI); sw.Circle(300, 300, r).Stroke(1, Red()); while(*s) { double w = fi[*s]; sw.BeginOnPath(pos + w / 2, true); sw.Character(-w / 2, -fi.GetAscent(), *s++, fnt) .Fill(0, -fi.GetAscent(), Yellow(), 0, fi.GetDescent(), Blue()) .Stroke(1, Black()); sw.End(); pos += w; } }