protected override void TextParagraph(JobHandle job, pointf p, ref textpara_t text) { TextBlock block = new TextBlock(); block.Inlines.Add(text.Text); block.FontFamily = new FontFamily(text.FontName); block.FontSize = text.fontsize; block.Margin = new Thickness(p.x - text.width / 2, p.y - text.yoffset_centerline - text.height / 2, 0, 0); block.Height = text.height; block.Width = text.width; block.Foreground = GetForegroundBrush(job); block.Background = GetBackgroundBrush(job, false); switch ((char)text.just) { case 'l': block.TextAlignment = TextAlignment.Left; break; case 'n': block.TextAlignment = TextAlignment.Center; break; case 'r': block.TextAlignment = TextAlignment.Right; break; } _canvas.Children.Add(block); }
protected virtual void TextParagraph(JobHandle job, pointf p, ref textpara_t text) { }