[FOray-commit] SF.net SVN: foray: [8544] trunk/foray
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2007-01-30 02:10:17
|
Revision: 8544
http://svn.sourceforge.net/foray/?rev=8544&view=rev
Author: victormote
Date: 2007-01-29 18:10:17 -0800 (Mon, 29 Jan 2007)
Log Message:
-----------
Conform to aXSL changes regarding the creation of a new Baseline enum.
Modified Paths:
--------------
trunk/foray/foray-font/src/java/org/foray/font/FOrayFont.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java
Modified: trunk/foray/foray-font/src/java/org/foray/font/FOrayFont.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/FOrayFont.java 2007-01-29 01:02:13 UTC (rev 8543)
+++ trunk/foray/foray-font/src/java/org/foray/font/FOrayFont.java 2007-01-30 02:10:17 UTC (rev 8544)
@@ -31,7 +31,7 @@
import org.foray.font.format.Kerning;
import org.foray.font.format.Panose;
-import org.axsl.common.Constants;
+import org.axsl.common.Baseline;
import org.apache.commons.logging.Log;
@@ -421,36 +421,36 @@
public int estimateBaseline(final int writingMode, final int baselineType,
final int fontSize) {
switch (baselineType) {
- case Constants.BASELINE_ALPHABETIC: {
+ case Baseline.ALPHABETIC: {
return fontSize + this.getDescender(fontSize);
}
- case Constants.BASELINE_IDEOGRAPHIC: {
+ case Baseline.IDEOGRAPHIC: {
return fontSize;
}
- case Constants.BASELINE_HANGING: {
+ case Baseline.HANGING: {
return Math.round(fontSize
* FOrayFont.DEFAULT_HANGING_BASELINE_POSITION);
}
- case Constants.BASELINE_MATHEMATICAL: {
+ case Baseline.MATHEMATICAL: {
/* For now, this is the same as Alphabetic. */
return fontSize + this.getDescender(fontSize);
}
- case Constants.BASELINE_CENTRAL: {
+ case Baseline.CENTRAL: {
return fontSize / 2;
}
- case Constants.BASELINE_MIDDLE: {
+ case Baseline.MIDDLE: {
/* First get the Alphabetic baseline. */
int baseline = baselineOffset(writingMode,
- Constants.BASELINE_ALPHABETIC, fontSize);
+ Baseline.ALPHABETIC, fontSize);
baseline -= this.getXHeight(fontSize) / 2;
return baseline;
}
- case Constants.BASELINE_TEXT_BEFORE_EDGE: {
+ case Baseline.TEXT_BEFORE_EDGE: {
/* TODO: This needs to comply with the Note under "text-before-edge"
* at Section 7.13 of XSL-FO 1.0. */
return 0;
}
- case Constants.BASELINE_TEXT_AFTER_EDGE: {
+ case Baseline.TEXT_AFTER_EDGE: {
/* TODO: This needs to comply with the Note under "text-after-edge"
* at Section 7.13 of XSL-FO 1.0. */
return fontSize;
@@ -466,7 +466,7 @@
*/
public int baseline(final String script) {
/* TODO: Fix this. */
- return Constants.BASELINE_ALPHABETIC;
+ return Baseline.ALPHABETIC;
}
/**
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-01-29 01:02:13 UTC (rev 8543)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-01-30 02:10:17 UTC (rev 8544)
@@ -1716,10 +1716,10 @@
if (writingMode.getAbsoluteAxis(Constants.AXIS_IP)
== Constants.AXIS_HORIZONTAL) {
/* The writing mode is horizontal. */
- return Constants.BASELINE_ALPHABETIC;
+ return FoValue.ALPHABETIC;
} else {
/* The writing mode is vertical. */
- return Constants.BASELINE_CENTRAL;
+ return FoValue.CENTRAL;
}
} else {
return this.getBaselineFromScript(context);
@@ -1739,34 +1739,34 @@
return this.effectiveParent(context).traitDominantBaseline(context);
}
case FoValue.IDEOGRAPHIC: {
- return Constants.BASELINE_IDEOGRAPHIC;
+ return FoValue.IDEOGRAPHIC;
}
case FoValue.ALPHABETIC: {
- return Constants.BASELINE_ALPHABETIC;
+ return FoValue.ALPHABETIC;
}
case FoValue.HANGING: {
- return Constants.BASELINE_HANGING;
+ return FoValue.HANGING;
}
case FoValue.MATHEMATICAL: {
- return Constants.BASELINE_MATHEMATICAL;
+ return FoValue.MATHEMATICAL;
}
case FoValue.CENTRAL: {
- return Constants.BASELINE_CENTRAL;
+ return FoValue.CENTRAL;
}
case FoValue.MIDDLE: {
- return Constants.BASELINE_MIDDLE;
+ return FoValue.MIDDLE;
}
case FoValue.TEXT_AFTER_EDGE: {
- return Constants.BASELINE_TEXT_AFTER_EDGE;
+ return FoValue.TEXT_AFTER_EDGE;
}
case FoValue.TEXT_BEFORE_EDGE: {
- return Constants.BASELINE_TEXT_BEFORE_EDGE;
+ return FoValue.TEXT_BEFORE_EDGE;
}
default: {
/* This should never happen as inheritance and defaults have been
* handled upstream, but if it does, just return a reasonable
* value. */
- return Constants.BASELINE_ALPHABETIC;
+ return FoValue.ALPHABETIC;
}
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|