[aXSL-commit] SF.net SVN: axsl: [585] trunk/axsl/axsl-font-r/src/java/org/axsl/fontR/Font.java
An API for XSL-FO.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2006-05-25 16:04:49
|
Revision: 585 Author: victormote Date: 2006-05-25 09:04:40 -0700 (Thu, 25 May 2006) ViewCVS: http://svn.sourceforge.net/axsl/?rev=585&view=rev Log Message: ----------- Add method for computing normal line-height. Modified Paths: -------------- trunk/axsl/axsl-font-r/src/java/org/axsl/fontR/Font.java Modified: trunk/axsl/axsl-font-r/src/java/org/axsl/fontR/Font.java =================================================================== --- trunk/axsl/axsl-font-r/src/java/org/axsl/fontR/Font.java 2006-05-24 20:50:19 UTC (rev 584) +++ trunk/axsl/axsl-font-r/src/java/org/axsl/fontR/Font.java 2006-05-25 16:04:40 UTC (rev 585) @@ -156,6 +156,11 @@ */ public static final byte FORMAT_OTF_CFF = 4; + /** Normal line-height computation constant indicating that the + * implementation is in complete control of the normal line-height + * computation. */ + public static final byte LH_ALGORITHM_DEFAULT = 0; + /** * Returns the Ascender value for this font, scaled to a specific point * size. @@ -366,4 +371,33 @@ */ public boolean isPDFStandardFont(); + /** + * <p>Returns a factor suitable for computing a "normal" line-height as + * defined in the CSS and XSL-FO standards. + * The line-height is the distance, including leading, between the baselines + * of stacked lines of text. + * The CSS and XSL-FO standards recommend that the "normal" value for + * line-height fall between 1.0 and 1.2. (see Section 7.15.4 of XSL-FO + * 1.0) + * This method attempts to find a suitable value based on the + * characteristics of the font itself.</p> + * + * <p>Design Note 1: This method returns a float factor instead of a + * computation of the actual line-height to facilitate the handling of + * inheritance where that is required. + * For example, for CSS and XSL-FO, the factor is what is inherited instead + * of the computed line-height.</p> + * + * @param algorithm The specifier of an algorithm that should be used to + * compute the factor. + * Valid values include {@link #LH_ALGORITHM_DEFAULT}, which puts the + * implementation in complete control of the computation. + * Other algorithms may be added in the future. + * @return The factor to be applied to the font-size to compute the "normal" + * line-height. + * For example, if the font-size is 12 points, and this method returns 1.2, + * the computed "normal" line-height is 14.4 points. + */ + public float normalLineHeightFactor(int algorithm) ; + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |