[aXSL-commit] SF.net SVN: axsl: [584] trunk/axsl/axsl-font-r/src/java/org/axsl/fontR
An API for XSL-FO.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2006-05-24 20:50:29
|
Revision: 584 Author: victormote Date: 2006-05-24 13:50:19 -0700 (Wed, 24 May 2006) ViewCVS: http://svn.sourceforge.net/axsl/?rev=584&view=rev Log Message: ----------- 1. Add factory method to FontServer that creates implementation-specific FontConsumer instances. 2. Add method to FontConsumer allowing it to set valid font sources. Modified Paths: -------------- trunk/axsl/axsl-font-r/src/java/org/axsl/fontR/FontConsumer.java trunk/axsl/axsl-font-r/src/java/org/axsl/fontR/FontServer.java Modified: trunk/axsl/axsl-font-r/src/java/org/axsl/fontR/FontConsumer.java =================================================================== --- trunk/axsl/axsl-font-r/src/java/org/axsl/fontR/FontConsumer.java 2006-05-24 19:16:14 UTC (rev 583) +++ trunk/axsl/axsl-font-r/src/java/org/axsl/fontR/FontConsumer.java 2006-05-24 20:50:19 UTC (rev 584) @@ -41,6 +41,18 @@ public interface FontConsumer { /** + * Free standing fonts are those fonts which are available to the + * application through means other than the operating system. + */ + public static final byte FONT_SOURCE_FREE_STANDING = 0; + + /** + * System fonts are those fonts which are available to the application + * through the operating system. + */ + public static final byte FONT_SOURCE_SYSTEM = 1; + + /** * Accepts the client's description of the desired font, and returns the * best-fitting Font found, using the algorithm specified by the XSL-FO * 1.1 Standard. @@ -171,4 +183,24 @@ */ public void optimizeFonts(); + /** + * Sets the font sources that can be selected for this FontConsumer. + * Please note that implementations are not required to support either + * free-standing or system fonts, although they should presumably support + * at least one. + * This method is provided for implementations that want to use this + * information during font selection, but implementations are not required + * to do anything with the values set here. + * @param fontSources The array of valid font sources that can be used by + * this consumer. + * Valid array values are {@link #FONT_SOURCE_FREE_STANDING} and + * {@link #FONT_SOURCE_SYSTEM}. + * The order of the array signifies the order of preference for selection + * purposes. + * For example, if both system fonts and free-standing fonts can be used, + * but free-standing fonts are preferred, the array should contain + * { FONT_SOURCE_FREE_STANDING, FONT_SOURCE_SYSTEM }; + */ + public void setFontSources(int[] fontSources); + } Modified: trunk/axsl/axsl-font-r/src/java/org/axsl/fontR/FontServer.java =================================================================== --- trunk/axsl/axsl-font-r/src/java/org/axsl/fontR/FontServer.java 2006-05-24 19:16:14 UTC (rev 583) +++ trunk/axsl/axsl-font-r/src/java/org/axsl/fontR/FontServer.java 2006-05-24 20:50:19 UTC (rev 584) @@ -271,4 +271,10 @@ float simulatedBackslant, float[] simulatedStretch) throws FontException ; + /** + * Creates an implementation-specific {@link FontConsumer} instance. + * @return an implementation-specific {@link FontConsumer} instance. + */ + public FontConsumer makeFontConsumer() ; + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |