We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

The font size of the text box is incorrect

Using the following method, you get only the initial font size, but you do not get the final font size that has been adjusted using the overflow indentation property of the text box.How do I get the final font size?

IPortionFormat.getEffective().getFontHeight()

@DRzeng88

When you will do this, you will reset the font values to the one that is used by the theme. Please try following to get actual.

IPortionFormat.getFontHeight()

Thank you for your method, but I tried your method and found that I still can’t get the indented font height, as shown in the picture belowSnipaste_2021-07-14_11-05-09.png (268.9 KB)

The following is the source file I used for debuggingindentedFontHeight.zip (34.4 KB)

@DRzeng88

I have been able to reproduce the issue on my end a ticket with ID SLIDESJAVA-38574 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.

Thank you, look forward to an early resolution

@DRzeng88,
Please use the following code snippet:

Presentation pres = new Presentation("indentedFontHeight.pptx");
ISlide slide = pres.getSlides().get_Item(0);
IAutoShape ashp = (IAutoShape)slide.getShapes().get_Item(0);

for (IParagraph paragraph : ashp.getTextFrame().getParagraphs())
{
    for(IPortion port : paragraph.getPortions())
    {
        System.out.println("Portion: "+ port.getText()+" has font height: "+ port.getPortionFormat().getFontHeight());

        IPortionFormatEffectiveData effectiveportionformat=port.getPortionFormat().getEffective();
        System.out.println("Portion: "+ port.getText()+" has font height: "+ effectiveportionformat.getFontHeight());
    }
}

Output:

Portion: Try to get the final font that has been adjusted using the overflow indentation has font height: 36.0
Portion: Try to get the final font that has been adjusted using the overflow indentation has font height: 18.0

Documents: Shape Effective Properties
API Reference: IPortionFormatEffectiveData interface