FontFile.FromFile

FontFile.FromFile method

Load FontFile from file name

public static FontFile FromFile(string fileName)
ParameterTypeDescription
fileNameStringPath to the font file

Return Value

FontFile instance

Examples

The following code shows how to create a 3D mesh from text using specified font file.

var font = FontFile.FromFile(@"CascadiaCode-Regular.otf");
var text = new Text();
text.Font = font;
text.Content = "ABC";
text.FontSize = 10;
var linear = new LinearExtrusion(text, 10).ToMesh();
var scene = new Scene(linear);
scene.Save(@"test.stl");

See Also