Hi Support Team.
We are unable to set font size in case of Arabic text. Sample code is mentioned below. below image will show arabic text i an setting 32 font size but still it is in default.
we are using below aspose.
<dependency>
<groupId>com.aspose</groupId>
<artifactId>aspose-words</artifactId>
<version>23.9</version>
<classifier>jdk17</classifier>
</dependency>
image.png (6.5 KB)
Table headingTable = builder.startTable();
/* if (parentLocale.equalsIgnoreCase("ar")) {
builder.getCurrentParagraph().getParagraphFormat().setBidi(true);
}
*/ //builder.getCurrentParagraph().getParagraphFormat().setAlignment(ParagraphAlignment.LEFT);
builder.insertCell();
headingTable.autoFit(AutoFitBehavior.AUTO_FIT_TO_WINDOW);
builder.getCellFormat().getBorders().setLineStyle(LineStyle.NONE);
builder.getCellFormat().getShading().setBackgroundPatternColor(new Color(Integer.parseInt(colorArr[0]), Integer.parseInt(colorArr[1]), Integer.parseInt(colorArr[2])));
builder.getCellFormat().setWrapText(true);
builder.getFont().setName(headingFontName);
builder.getFont().setSize(Integer.parseInt(headingFontSize));
builder.setBold(true);
// builder.getFont().setBidi(bidi);
builder.getFont().setColor(Color.blue);
if (bidi)
{
builder.write("تدوين");
}
else
{
builder.write("TADWEEN");
}
ExportAuditDocController.setBidi(builder.getCurrentParagraph(), bidi, headingFontName, Double.parseDouble(headingFontSize));
builder.endRow();
builder.getRowFormat().clearFormatting();
builder.getFont().clearFormatting();
builder.getCellFormat().clearFormatting();
builder.writeln();
builder.insertCell();
headingTable.autoFit(AutoFitBehavior.AUTO_FIT_TO_WINDOW);
builder.getCellFormat().getBorders().setLineStyle(LineStyle.NONE);
builder.getCellFormat().getShading().setBackgroundPatternColor(new Color(Integer.parseInt(colorArr[0]), Integer.parseInt(colorArr[1]), Integer.parseInt(colorArr[2])));
builder.getCellFormat().setWrapText(true);
builder.getFont().setName(headingFontName);
builder.getFont().setSize(Integer.parseInt(headingFontSize));
builder.getBold();
builder.getFont().setBidi(bidi);
builder.write(parentDocTitle);
builder.getCurrentParagraph().getParagraphFormat().setBidi(bidi);
builder.endRow();
builder.getRowFormat().clearFormatting();
builder.getCellFormat().clearFormatting();
builder.insertCell();
builder.getCellFormat().getBorders().setLineStyle(LineStyle.NONE);
builder.getCellFormat().getShading().setBackgroundPatternColor(new Color(Integer.parseInt(colorArr[0]), Integer.parseInt(colorArr[1]), Integer.parseInt(colorArr[2])));
builder.getCellFormat().setWrapText(true);
builder.getFont().setName(fontName);
builder.getFont().setSize(Integer.parseInt(fontSize));
builder.getFont().setBidi(bidi);
builder.write(date);
builder.getCurrentParagraph().getParagraphFormat().setBidi(bidi);
builder.writeln();
builder.endRow();
builder.getCellFormat().clearFormatting();
headingTable.autoFit(AutoFitBehavior.AUTO_FIT_TO_WINDOW);
builder.endTable();