命名优化,达芬奇字体修改工具

This commit is contained in:
GG Z
2025-10-04 08:52:23 +08:00
parent 0d0afbc78e
commit 4722a4c881
121 changed files with 1801 additions and 1368 deletions

View File

@@ -13,20 +13,23 @@ public partial class TemplateManagerViewModel : ObservableObject
{
private readonly ActionEventHandler handler;
[ObservableProperty]
private FontFamily[] fontFamilies;
public partial FontFamily[] FontFamilies { get; set; }
[ObservableProperty]
private FontFamily selectFontFamily;
public partial FontFamily SelectFontFamily { get; set; }
[ObservableProperty]
private double fontSize;
public partial double FontSize { get; set; }
[ObservableProperty]
private double widthScale;
public partial double WidthScale { get; set; }
public TemplateManagerViewModel()
{
handler = new ActionEventHandler();
// 创建 InstalledFontCollection 对象
var installedFonts = new InstalledFontCollection();
// 获取已安装的字体数组
fontFamilies = installedFonts.Families;
FontFamilies = installedFonts.Families;
}
[RelayCommand]
private void CleanFontType()
@@ -86,7 +89,7 @@ public partial class TemplateManagerViewModel : ObservableObject
{
var doc = uiapp.ActiveUIDocument.Document;
doc.InvokeGroup(
tg =>
_ =>
{
var col = doc.OfClass<Family>()
.Cast<Family>()
@@ -100,7 +103,7 @@ public partial class TemplateManagerViewModel : ObservableObject
var familyEditing = doc.EditFamily(family);
//所有标签文字;
familyEditing.Invoke(
ts =>
_ =>
{
var textElements = familyEditing.OfClass<TextElement>().Cast<TextElement>();
foreach (var text in textElements)
@@ -144,7 +147,7 @@ public partial class TemplateManagerViewModel : ObservableObject
}
});
doc.Invoke(
ts =>
_ =>
{
familyEditing.LoadFamily(doc, new FamilyLoadOptions(true));
},