类 FontFile
FontFile class
字体文件包含字形定义,用于创建文本配置文件。
public abstract class FontFile : A3DObject
属性
| 名称 | 描述 |
|---|---|
| virtual Name { get; set; } | 获取或设置名称。 |
| Properties { get; } | 获取所有属性的集合。 |
方法
| 名称 | 描述 |
|---|---|
| static FromFile(string) | 从文件名加载 FontFile |
| static Parse(byte[]) | 从字节解析 FontFile |
| FindProperty(string) | 查找属性。它可以是动态属性(由 CreateDynamicProperty/SetProperty 创建)或本地属性(通过其名称识别) |
| GetProperty(string) | 获取指定属性的值 |
| RemoveProperty(Property) | 移除动态属性。 |
| RemoveProperty(string) | 移除通过名称识别的指定属性 |
| SetProperty(string, object) | 设置指定属性的值 |
示例
以下代码展示了如何使用指定的字体文件从文本创建 3D 网格。
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");
另请参见
- class A3DObject
- namespace Aspose.ThreeD.Profiles
- assembly Aspose.3D