Node.js kullanarak C++ ile Şekil veya Metin Kutusunda Yazı Seçeneklerinin Far Doğu ve Latin İsimlerini Belirtin

Olası Kullanım Senaryoları

Bazen Far Doğu dili fontlarında metin göstermek istersiniz; örneğin Japonca, Çince, Tayca vb. Aspose.Cells for Node.js via C++, Far Doğu dilinin font adını belirtmek için TextOptions.getFarEastName() özelliğini sağlar. Ayrıca, Latin font adını TextOptions.getLatinName() özelliği kullanarak belirtebilirsiniz.

Şekil Metin Seçenekleri’nde Uzak Doğu ve Latin Yazı Tipi Adını Belirtin

Aşağıdaki örnek kod, bir metin kutusu oluşturur ve içine bazı Japonca metinler ekler. Daha sonra, metnin Latin ve Doğu (Far East) yazı tipi adlarını belirler ve çalışma kitabını çıktı Excel dosyası olarak kaydeder. Aşağıdaki ekran görüntüsü, Microsoft Excel’de çıktı metin kutusunun Latin ve Doğu yazı tipi adlarını gösterir.

todo:image_alt_text

Örnek Kod

const path = require("path");
const AsposeCells = require("aspose.cells.node");

// The path to the documents directory.
const dataDir = path.join(__dirname, "data");
const filePath = path.join(dataDir, "sample.xlsx");
// Create empty workbook.
const wb = new AsposeCells.Workbook();

// Access first worksheet.
const ws = wb.getWorksheets().get(0);

// Add textbox inside the worksheet.
const idx = ws.getTextBoxes().add(5, 5, 50, 200);
const tb = ws.getTextBoxes().get(idx);

// Set the text of the textbox.
tb.setText("こんにちは世界");

// Specify the Far East and Latin name of the font.
tb.getTextOptions().setLatinName("Comic Sans MS");
tb.getTextOptions().setFarEastName("KaiTi");

// Save the output Excel file.
wb.save("outputSpecifyFarEastAndLatinNameOfFontInTextOptionsOfShape.xlsx", AsposeCells.SaveFormat.Xlsx);