تعيين نمط نص فني محدد مسبقًا لنص الشكل

سيناريوهات الاستخدام المحتملة

يمكنك تعيين نمط نص فني محدد مسبقًا لنص الشكل باستخدام Aspose.Cells. يرجى استخدام FontSetting.SetWordArtStyle() أو FontSettingCollection.SetWordArtStyle() لهذا الغرض.

تعيين نمط WordArt المحدد مسبقًا لنص الشكل

الكود النموذجي التالي ينشئ صندوق نص مع بعض النصوص ومن ثم يعين نمط نص فني محدد مسبقًا لنصه باستخدام طريقة FontSetting.SetWordArtStyle(). هكذا يبدو ملف الإكسل الناتج في Microsoft Excel.

todo:image_alt_text

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
// Create workbook object
Workbook workbook = new Workbook();
// Access first worksheet
Worksheet worksheet = workbook.Worksheets[0];
// Create a textbox with some text
TextBox textbox = worksheet.Shapes.AddTextBox(0, 0, 0, 0, 100, 700);
textbox.Text = "Aspose File Format APIs";
textbox.Font.Size = 44;
// Sets preset WordArt style to the text of the shape.
FontSetting fntSetting = textbox.GetRichFormattings()[0] as FontSetting;
fntSetting.SetWordArtStyle(PresetWordArtStyle.WordArtStyle3);
// Save the workbook in xlsx format
workbook.Save(outputDir + "outputSetPresetWordArtStyle.xlsx");