-
Hi all, Back in 1.0.0-beta13, it was possible to access the control point information for any glyph via the GlyphInstance class. This appears to have been abstracted away, the GlyphInstance class being refactored out. Is there an equivalent way to access control point information these days? I've been combing through the repository and much of what I can find is internal or inaccessible. Regards, Mavi |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 9 replies
-
The property now lives in You can also use the |
Beta Was this translation helpful? Give feedback.
-
Resurrecting this question as the API appears to have changed again in the latest version. The CodePoint class doesn't appear to contain any information pertaining to control points and glyph contour geometry. I know mine is a niche use-case in the wider context of the library, but it is nonetheless a powerful feature to be able to access this information, and I'd love to stay abreast with the latest library version if possible. Where is this information now located and is it still publicly accessible? Regards, Mavi. |
Beta Was this translation helpful? Give feedback.
-
The public-facing mechanism for doing this is apparently part of if (SystemFonts.TryGet(fontFamily, out var family))
{
var font = family.CreateFont(size);
foreach (var character in characters)
{
var paths = TextBuilder.GenerateGlyphs(character.ToString(), new TextOptions(font));
foreach (var path in paths)
{
var simplePaths = path.Flatten().ToArray();
foreach (var simplePath in simplePaths)
{
foreach (var point in simplePath.Points.ToArray())
{
Console.WriteLine($"{point.X}, {point.Y}");
}
}
}
}
}
else
{
throw new ArgumentException($"The {fontFamily} family of fonts could not be loaded.");
} This is acceptable for my needs, though in my opinion; a mechanism for retrieving the original control point data (in font-unit, em grid coordinates) would be beneficial for the following reasons:
|
Beta Was this translation helpful? Give feedback.
The public-facing mechanism for doing this is apparently part of
SixLabors.ImageSharp.Drawing
(via theTextBuilder
class) rather than directly throughSixLabors.Fonts
.