[FOray-commit] SF.net SVN: foray: [8592] trunk/foray
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2007-02-02 21:15:51
|
Revision: 8592
http://svn.sourceforge.net/foray/?rev=8592&view=rev
Author: victormote
Date: 2007-02-02 13:15:51 -0800 (Fri, 02 Feb 2007)
Log Message:
-----------
Conform to axsl changes for converting an enumeration to a typesafe enum.
Modified Paths:
--------------
trunk/foray/foray-font/src/java/org/foray/font/FOrayFontConsumer.java
trunk/foray/foray-font/src/java/org/foray/font/FOrayFontServer.java
trunk/foray/foray-font/src/java/org/foray/font/FontSelector.java
trunk/foray/foray-font/src/java/org/foray/font/FontSelectorCBC.java
trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontDesc.java
trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontFamily.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTextPainter.java
Modified: trunk/foray/foray-font/src/java/org/foray/font/FOrayFontConsumer.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/FOrayFontConsumer.java 2007-02-02 20:04:13 UTC (rev 8591)
+++ trunk/foray/foray-font/src/java/org/foray/font/FOrayFontConsumer.java 2007-02-02 21:15:51 UTC (rev 8592)
@@ -280,9 +280,9 @@
* {@inheritDoc}
*/
public org.axsl.fontR.FontUse selectFontXSL(final int selectionStrategy,
- final String [] familyList, final int style, final int weight,
- final int variant, final int stretch, final int size,
- final int codePoint) throws FontException {
+ final String [] familyList, final Font.Style style,
+ final int weight, final int variant, final int stretch,
+ final int size, final int codePoint) throws FontException {
final FontSelector selector = getFontSelector(selectionStrategy);
final RegisteredFontDesc fontDescSelected = selector.selectFont(
familyList, style, weight, variant, stretch, size, codePoint);
@@ -467,7 +467,7 @@
* {@inheritDoc}
*/
public org.axsl.fontR.FontUse selectFontCSS(final String [] familyList,
- final int style, final int weight, final int variant,
+ final Font.Style style, final int weight, final int variant,
final int stretch, final int size, final int codePoint)
throws FontException {
return selectFontXSL(Font.SelectionStrategy.CHARACTER_BY_CHARACTER,
Modified: trunk/foray/foray-font/src/java/org/foray/font/FOrayFontServer.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/FOrayFontServer.java 2007-02-02 20:04:13 UTC (rev 8591)
+++ trunk/foray/foray-font/src/java/org/foray/font/FOrayFontServer.java 2007-02-02 21:15:51 UTC (rev 8592)
@@ -575,8 +575,8 @@
* @throws FontException For errors during registration.
*/
private void registerBase14Description(final String fontFamily,
- final String fontName, final byte style, final short weight)
- throws FontException {
+ final String fontName, final org.axsl.fontR.Font.Style style,
+ final short weight) throws FontException {
Encoding encoding = EncodingVector.getPredefinedEncoding(
"WinAnsiEncoding");
if (fontFamily.equals("Base14-Symbol")) {
@@ -647,7 +647,8 @@
this.logger.error(e.getMessage());
continue;
}
- byte fontStyle = org.axsl.fontR.Font.Style.NORMAL;
+ org.axsl.fontR.Font.Style fontStyle
+ = org.axsl.fontR.Font.Style.NORMAL;
if (awtFont.isItalic()) {
fontStyle = org.axsl.fontR.Font.Style.ITALIC;
}
@@ -1143,7 +1144,8 @@
* {@inheritDoc}
*/
public void registerFontDescription(final String fontFamily,
- final String fontID, final Encoding encoding, final byte style,
+ final String fontID, final Encoding encoding,
+ final org.axsl.fontR.Font.Style style,
final short weight, final byte variant, final byte stretch,
final float simulatedSmallCaps, final float simulatedOblique,
final float simulatedBackslant, final float[] simulatedStretch)
Modified: trunk/foray/foray-font/src/java/org/foray/font/FontSelector.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/FontSelector.java 2007-02-02 20:04:13 UTC (rev 8591)
+++ trunk/foray/foray-font/src/java/org/foray/font/FontSelector.java 2007-02-02 21:15:51 UTC (rev 8592)
@@ -28,6 +28,7 @@
package org.foray.font;
+import org.axsl.fontR.Font;
import org.axsl.fontR.FontException;
/**
@@ -64,7 +65,7 @@
* @throws FontException For invalid input.
*/
public abstract RegisteredFontDesc selectFont(String [] familyList,
- int style, int weight, int variant, int stretch, int size,
+ Font.Style style, int weight, int variant, int stretch, int size,
int codePoint) throws FontException;
/**
Modified: trunk/foray/foray-font/src/java/org/foray/font/FontSelectorCBC.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/FontSelectorCBC.java 2007-02-02 20:04:13 UTC (rev 8591)
+++ trunk/foray/foray-font/src/java/org/foray/font/FontSelectorCBC.java 2007-02-02 21:15:51 UTC (rev 8592)
@@ -28,6 +28,7 @@
package org.foray.font;
+import org.axsl.fontR.Font;
import org.axsl.fontR.FontException;
/**
@@ -56,7 +57,7 @@
* {@inheritDoc}
*/
public RegisteredFontDesc selectFont(final String [] familyList,
- final int style, final int weight, final int variant,
+ final Font.Style style, final int weight, final int variant,
final int stretch, final int size, final int codePoint)
throws FontException {
FOrayFont fontSelected = null;
@@ -98,7 +99,7 @@
* or null if there is none.
*/
private RegisteredFontDesc selectFont(final String familyToTry,
- final int style, final int weight, final int variant,
+ final Font.Style style, final int weight, final int variant,
final int stretch, final int size) {
if (familyToTry == null) {
return null;
Modified: trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontDesc.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontDesc.java 2007-02-02 20:04:13 UTC (rev 8591)
+++ trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontDesc.java 2007-02-02 21:15:51 UTC (rev 8592)
@@ -92,7 +92,7 @@
private Encoding encoding;
/** The style of this description. */
- private byte fontStyle;
+ private Font.Style fontStyle;
/** The weight of this description. */
private short fontWeight;
@@ -157,7 +157,7 @@
*/
public RegisteredFontDesc(final RegisteredFont rf,
final RegisteredFontFamily rff, final Encoding encoding,
- final byte fontStyle, final short fontWeight,
+ final Font.Style fontStyle, final short fontWeight,
final byte fontVariant, final byte fontStretch) {
this.registeredFont = rf;
this.registeredFontFamily = rff;
@@ -172,9 +172,10 @@
* Returns the font style.
* @return The font style.
*/
- public byte getFontStyle() {
+ public Font.Style getFontStyle() {
return this.fontStyle;
}
+
/**
* Returns the font weight.
* @return The font weight.
@@ -530,7 +531,7 @@
* considered in the test.
* @return True iff the style of this font description matches the criteria.
*/
- public boolean styleMatches(final int inputDesiredStyle,
+ public boolean styleMatches(final Font.Style inputDesiredStyle,
final boolean considerSimulated) {
if (inputDesiredStyle == Font.Style.ANY) {
return true;
@@ -540,16 +541,16 @@
/* If it can simulate oblique, it can be used for either
* oblique or italic or normal. */
switch (inputDesiredStyle) {
- case Font.Style.NORMAL:
- case Font.Style.ITALIC:
- case Font.Style.OBLIQUE: {
+ case NORMAL:
+ case ITALIC:
+ case OBLIQUE: {
return true;
}
}
}
}
- int actualStyle = getFontStyle();
+ Font.Style actualStyle = getFontStyle();
/* Check the easy case first. */
if (actualStyle == inputDesiredStyle) {
return true;
@@ -559,7 +560,7 @@
if (actualStyle == Font.Style.OBLIQUE) {
actualStyle = Font.Style.ITALIC;
}
- int desiredStyle = inputDesiredStyle;
+ Font.Style desiredStyle = inputDesiredStyle;
if (inputDesiredStyle == Font.Style.OBLIQUE) {
desiredStyle = Font.Style.ITALIC;
}
@@ -649,8 +650,8 @@
* selection criteria.
*/
public boolean matchPerfect(final RegisteredFontFamily family,
- final boolean considerSimulated, final int style, final int weight,
- final int variant, final int stretch,
+ final boolean considerSimulated, final Font.Style style,
+ final int weight, final int variant, final int stretch,
final boolean freeStandingFonts, final boolean systemFonts) {
if (! generalTypeMatches(freeStandingFonts, systemFonts)) {
return false;
@@ -682,9 +683,9 @@
* selection criteria.
*/
public boolean matchIgnoreWeight(final RegisteredFontFamily family,
- final boolean considerSimulated, final int style, final int variant,
- final int stretch, final boolean freeStandingFonts,
- final boolean systemFonts) {
+ final boolean considerSimulated, final Font.Style style,
+ final int variant, final int stretch,
+ final boolean freeStandingFonts, final boolean systemFonts) {
if (! generalTypeMatches(freeStandingFonts, systemFonts)) {
return false;
}
Modified: trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontFamily.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontFamily.java 2007-02-02 20:04:13 UTC (rev 8591)
+++ trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontFamily.java 2007-02-02 21:15:51 UTC (rev 8592)
@@ -96,8 +96,8 @@
final String simulatedSmallCaps, final String simulatedOblique,
final String simulatedBackslant, final String[] simulatedStretch)
throws FontException {
- byte fontStyle = FontUtility.foFontStyle(style, false);
- if (fontStyle < 0) {
+ Font.Style fontStyle = FontUtility.foFontStyle(style, false);
+ if (fontStyle == Font.Style.UNKNOWN) {
fontStyle = Font.Style.NORMAL;
}
short fontWeight = FontUtility.foFontWeight(weight, false);
@@ -148,7 +148,7 @@
* @throws FontException For error in registration.
*/
protected void registerFontDesc(final RegisteredFont registeredFont,
- final Encoding encoding, final byte style, final short weight,
+ final Encoding encoding, final Font.Style style, final short weight,
final byte variant, final byte stretch,
final float simulatedSmallCaps, final float simulatedOblique,
final float simulatedBackslant, final float[] simulatedStretch)
@@ -191,7 +191,7 @@
* @return The first matching RegisteredFontDesc found for this font-family,
* or null if none match.
*/
- protected RegisteredFontDesc findRegisteredFontDesc(final int style,
+ protected RegisteredFontDesc findRegisteredFontDesc(final Font.Style style,
final int weight, final int variant, final int stretch,
final boolean freeStandingFonts, final boolean systemFonts) {
/* First, look for a perfect match without considering simulated
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2007-02-02 20:04:13 UTC (rev 8591)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2007-02-02 21:15:51 UTC (rev 8592)
@@ -3296,7 +3296,8 @@
return org.axsl.fontR.Font.Variant.NORMAL;
}
- public static byte convertFontStyle(final short parsedFontStyle) {
+ public static org.axsl.fontR.Font.Style convertFontStyle(
+ final short parsedFontStyle) {
switch (parsedFontStyle) {
case FoValue.NORMAL: {
return org.axsl.fontR.Font.Style.NORMAL;
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java 2007-02-02 20:04:13 UTC (rev 8591)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java 2007-02-02 21:15:51 UTC (rev 8592)
@@ -916,7 +916,7 @@
fontFamily = "sans-serif";
}
final float fontSize = gFont.getSize();
- int fontStyle = org.axsl.fontR.Font.Style.NORMAL;
+ org.axsl.fontR.Font.Style fontStyle = org.axsl.fontR.Font.Style.NORMAL;
if (gFont.isItalic()) {
fontStyle = org.axsl.fontR.Font.Style.ITALIC;
}
@@ -993,8 +993,8 @@
TextAttribute.FAMILY);
org.axsl.fontR.FontUse font;
try {
- font = this.fontConsumer.selectFontCSS(
- fontFamily, 0, 0, 0, 0, 0, ch);
+ font = this.fontConsumer.selectFontCSS(fontFamily,
+ org.axsl.fontR.Font.Style.NORMAL, 0, 0, 0, 0, ch);
} catch (final FontException e) {
/* We can't find a font for this character, so skip it. */
continue;
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTextPainter.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTextPainter.java 2007-02-02 20:04:13 UTC (rev 8591)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTextPainter.java 2007-02-02 21:15:51 UTC (rev 8592)
@@ -287,7 +287,7 @@
final Float size, final boolean italic, final boolean bold)
throws FontException {
org.axsl.fontR.FontUse font = null;
- int style = Font.Style.NORMAL;
+ Font.Style style = Font.Style.NORMAL;
if (italic) {
style = Font.Style.ITALIC;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|