Hi,
I’d like to get the font leading (Leading - Wikipedia) for a run’s font. I’d like to use this value to calculate the height in points of a line taking into account of the line spacing property.
Cheers,
Simon
Hi,
I’d like to get the font leading (Leading - Wikipedia) for a run’s font. I’d like to use this value to calculate the height in points of a line taking into account of the line spacing property.
Cheers,
Simon
Thanks for your inquiry. You can use Run.Font.Position property to get or set the position of text (in points) relative to the base line. A positive number raises the text, and a negative number lowers it.
Tahir,
That’s not what I want. I’d like the font leading in points such that I can calculate the line spacing accurately, during my conversion to HTML.
Cheers,
Simon
Thanks for sharing the detail. We have logged this feature request as WORDSNET-16734 in our issue tracking system. You will be notified via this forum thread once this feature is available.
We apologize for your inconvenience.
The issues you have found earlier (filed as WORDSNET-16734) have been fixed in this Aspose.Words for .NET 19.5 update and this Aspose.Words for Java 19.5 update.
Regarding WORDSNET-16734, it is to inform you that we have added a feature to get font leading (line spacing). The line spacing of a font is the vertical distance between the base lines of two consecutive lines of text. Thus, the line spacing includes the blank space between lines along with the height of the character itself. The following property was introduced in the Font class to obtain this value:
/// <summary>
/// Returns line spacing of this font (in points).
/// </summary>
public double LineSpacing { get; }
Sample Usage is as follows:
DocumentBuilder builder = new DocumentBuilder(new Document());
builder.getFont().setName("Calibri");
builder.writeln("qText");
// Obtain line spacing.
Font font = builder.getDocument().getFirstSection().getBody().getFirstParagraph().getRuns().get(0).getFont();
System.out.println(("lineSpacing = " + font.getLineSpacing()));
Hope, this helps.