Önceden Ayarlanmış Kelime Sanatı Stilini Şeklin Metni Olarak Ayarla

Olası Kullanım Senaryoları

Aspose.Cells kullanarak metin şeklinde önceden belirlenmiş WordArt stilini belirleyebilirsiniz. Bu amaçla lütfen FontSetting.SetWordArtStyle() veya FontSettingCollection.SetWordArtStyle() metodlarını kullanın.

Metin şeklinin metnine önceden ayarlanmış WordArt stili ayarlayın

Aşağıdaki örnek kod, bir metin kutusu ve ardından FontSetting.SetWordArtStyle() metodu kullanılarak metninin önceden belirlenmiş WordArt stilini ayarlar. Bu, Microsoft Excel’de çıktı exel dosyası nasıl görünüyor.

todo:image_alt_text

Örnek Kod

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java
// The path to the documents directory.
String dataDir = Utils.getSharedDataDir(SetPresetWordArtStyle.class) + "articles/";
//Create workbook object
Workbook wb = new Workbook();
//Access first worksheet
Worksheet ws = wb.getWorksheets().get(0);
//Create a textbox with some text
int idx = ws.getTextBoxes().add(0, 0, 100, 700);
TextBox tb = ws.getTextBoxes().get(idx);
tb.setText("Aspose File Format APIs");
tb.getFont().setSize(44);
//Sets preset WordArt style to the text of the shape.
ArrayList<FontSetting> aList = tb.getCharacters();
FontSetting fntSetting = aList.get(0);
fntSetting.setWordArtStyle(PresetWordArtStyle.WORD_ART_STYLE_3);
//Save the workbook in xlsx format
wb.save(dataDir + "SetPresetWordArtStyle_out.xlsx");