设置上标.jpg (46.2 KB)
如图所示,Aspose.slides for java 如何设置字体上标
我们的 @mudassir.fayyaz 最棒!
下面是例子:
String sig = “BC”;
IParagraphCollection paragraphCollection = iDataPointCollection.get_Item(j).getLabel().getTextFrameForOverriding().getParagraphs();
paragraphCollection.clear();
IParagraph paragraph = new Paragraph();
paragraphCollection.add(paragraph);
paragraph.setText(“Hello”);
IPortion portion = new Portion();
portion.setText(sig);
portion.getPortionFormat().setEscapement(60f);
portion.getPortionFormat().setFontHeight(14);
portion.getPortionFormat().getFillFormat().setFillType(FillType.Solid);
portion.getPortionFormat().getFillFormat().getSolidFillColor().setColor(ColorUtil.StringToColor(“FF0000”));
(
public static Color StringToColor(String str) {
str = DataHelper.getStringByNumberSuf(str.replaceAll("#", “”).toUpperCase(), 6);
int r = Integer.parseInt(str.substring(0, 2), 16);
int g = Integer.parseInt(str.substring(2, 4), 16);
int b = Integer.parseInt(str.substring(4, 6), 16);
return new Color(r, g, b);
}
)
最终效果见附件中的图片superScript.jpg (17.5 KB)