PDFsharp & MigraDoc Foundation
http://forum.pdfsharp.de/

A Question About Cannot Draw Path from Font
http://forum.pdfsharp.de/viewtopic.php?f=2&t=4671
Page 1 of 1

Author:  AnonymousCoder [ Wed Sep 04, 2024 3:41 pm ]
Post subject:  A Question About Cannot Draw Path from Font

My develope environment is .Net8.0, I need to draw the path from a character (for example, to draw the outlines of a character or make some matrix transformation of the font then draw it)
but when I use the [XGraphicsPath.AddString(...)] method to convert the font to path, it did not work, the output file does not have any about the character.
(I tried to use breakpoint debugging then I find the Parameter CorePath.PathPoints of XGraphicsPath object did not have any point after the [XGraphicsPath.AddString(...)] method done.)
This question have puzzled me three whole days...
BTW:
I can successfully use [GraphicsPath.AddString(...)] method in [system.draw]package to convert font to path then draw it in winform.
I tried to find method which can convert GraphicsPath to XGraphicsPath but failed.
My English is not well, please forgive the grammar mistake.

Code:
            //Code of try to draw the outline, but failed.

            XGraphicsPath path2 = new XGraphicsPath();
            string text = "Hello";
            XFontFamily family = new XFontFamily("Arial");
            path2.AddString(text, family, XFontStyleEx.Regular, 80, new XRect(100, 100, 250, 140), XStringFormats.Center);
            gfx.DrawPath(new XPen(XColors.Blue, 5), XBrushes.DarkOrchid, path2);


Attachments:
File comment: Debug Message
无标题.png
无标题.png [ 182.3 KiB | Viewed 7872 times ]

Author:  TH-Soft [ Mon Sep 09, 2024 9:55 am ]
Post subject:  Re: A Question About Cannot Draw Path from Font

IIRC this is one of the features that work with the GDI and WPF builds, but not (yet) with the Core build.
For applications that run under Windows only, you can use either the GDI or WPF build.

Author:  AnonymousCoder [ Thu Sep 12, 2024 2:15 am ]
Post subject:  Re: A Question About Cannot Draw Path from Font

TH-Soft wrote:
IIRC this is one of the features that work with the GDI and WPF builds, but not (yet) with the Core build.
For applications that run under Windows only, you can use either the GDI or WPF build.


Thank you very much for your answer.
Wish this feature work with Core could come soon.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/