[FOray-commit] SF.net SVN: foray: [8593] trunk/foray
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2007-02-02 23:13:26
|
Revision: 8593
http://svn.sourceforge.net/foray/?rev=8593&view=rev
Author: victormote
Date: 2007-02-02 15:13:26 -0800 (Fri, 02 Feb 2007)
Log Message:
-----------
Conform to axsl changes for converting an enumeration to a typesafe enum.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java
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/FOrayFontUse.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-font/src/java/org/foray/font/format/MetricsFileAFM.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/FontStyle.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/FontWeight.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
trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java
trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java 2007-02-02 21:15:51 UTC (rev 8592)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java 2007-02-02 23:13:26 UTC (rev 8593)
@@ -37,6 +37,7 @@
import org.axsl.foR.FONode;
import org.axsl.foR.FObj;
import org.axsl.foR.fo.RetrieveMarker;
+import org.axsl.fontR.Font;
import org.axsl.fontR.FontConsumer;
import org.axsl.text.TextServer;
@@ -322,7 +323,7 @@
* 700 (bold), 800, or 900 (boldest).
* @see FObj#traitFontWeight(FOContext)
*/
- public short traitFontWeight() {
+ public Font.Weight traitFontWeight() {
return traitGeneratedBy().traitFontWeight(this);
}
@@ -331,7 +332,7 @@
* {@link FoValue#ITALIC}, {@link FoValue#OBLIQUE}, or
* {@link FoValue#BACKSLANT}.
*/
- public short traitFontStyle() {
+ public Font.Style traitFontStyle() {
return traitGeneratedBy().traitFontStyle(this);
}
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 21:15:51 UTC (rev 8592)
+++ trunk/foray/foray-font/src/java/org/foray/font/FOrayFontConsumer.java 2007-02-02 23:13:26 UTC (rev 8593)
@@ -281,7 +281,7 @@
*/
public org.axsl.fontR.FontUse selectFontXSL(final int selectionStrategy,
final String [] familyList, final Font.Style style,
- final int weight, final int variant, final int stretch,
+ final Font.Weight 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(
@@ -467,7 +467,7 @@
* {@inheritDoc}
*/
public org.axsl.fontR.FontUse selectFontCSS(final String [] familyList,
- final Font.Style style, final int weight, final int variant,
+ final Font.Style style, final Font.Weight 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 21:15:51 UTC (rev 8592)
+++ trunk/foray/foray-font/src/java/org/foray/font/FOrayFontServer.java 2007-02-02 23:13:26 UTC (rev 8593)
@@ -576,7 +576,7 @@
*/
private void registerBase14Description(final String fontFamily,
final String fontName, final org.axsl.fontR.Font.Style style,
- final short weight) throws FontException {
+ final org.axsl.fontR.Font.Weight weight) throws FontException {
Encoding encoding = EncodingVector.getPredefinedEncoding(
"WinAnsiEncoding");
if (fontFamily.equals("Base14-Symbol")) {
@@ -652,7 +652,8 @@
if (awtFont.isItalic()) {
fontStyle = org.axsl.fontR.Font.Style.ITALIC;
}
- short fontWeight = org.axsl.fontR.Font.Weight.NORMAL;
+ org.axsl.fontR.Font.Weight fontWeight
+ = org.axsl.fontR.Font.Weight.NORMAL;
if (awtFont.isBold()) {
fontWeight = org.axsl.fontR.Font.Weight.BOLD;
}
@@ -1146,7 +1147,8 @@
public void registerFontDescription(final String fontFamily,
final String fontID, final Encoding encoding,
final org.axsl.fontR.Font.Style style,
- final short weight, final byte variant, final byte stretch,
+ final org.axsl.fontR.Font.Weight weight, final byte variant,
+ final byte stretch,
final float simulatedSmallCaps, final float simulatedOblique,
final float simulatedBackslant, final float[] simulatedStretch)
throws FontException {
Modified: trunk/foray/foray-font/src/java/org/foray/font/FOrayFontUse.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/FOrayFontUse.java 2007-02-02 21:15:51 UTC (rev 8592)
+++ trunk/foray/foray-font/src/java/org/foray/font/FOrayFontUse.java 2007-02-02 23:13:26 UTC (rev 8593)
@@ -58,10 +58,6 @@
*/
public class FOrayFontUse implements org.axsl.fontR.FontUse {
- /** Constant indicating the amount by which font weights should be adjusted
- * when they are incremented or decremented. */
- private static final int FONT_WEIGHT_INCREMENT = 100;
-
/** The parent ConsumerFont. */
private FOrayConsumerFont consumerFont;
@@ -141,29 +137,25 @@
/**
* {@inheritDoc}
*/
- public short nextBolderWeight() {
+ public Font.Weight nextBolderWeight() {
final RegisteredFontDesc desc =
this.registeredFontDesc.nextBolderFont();
if (desc != null) {
return desc.getFontWeight();
}
- return (short) Math.min(Font.Weight.RELATIVE_900,
- this.registeredFontDesc.getFontWeight()
- + FOrayFontUse.FONT_WEIGHT_INCREMENT);
+ return this.registeredFontDesc.getFontWeight().nextHeaviest();
}
/**
* {@inheritDoc}
*/
- public short nextLighterWeight() {
+ public Font.Weight nextLighterWeight() {
final RegisteredFontDesc desc =
this.registeredFontDesc.nextLighterFont();
if (desc != null) {
return desc.getFontWeight();
}
- return (short) Math.max(Font.Weight.RELATIVE_100,
- this.registeredFontDesc.getFontWeight()
- - FOrayFontUse.FONT_WEIGHT_INCREMENT);
+ return this.registeredFontDesc.getFontWeight().nextLightest();
}
/**
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 21:15:51 UTC (rev 8592)
+++ trunk/foray/foray-font/src/java/org/foray/font/FontSelector.java 2007-02-02 23:13:26 UTC (rev 8593)
@@ -65,8 +65,8 @@
* @throws FontException For invalid input.
*/
public abstract RegisteredFontDesc selectFont(String [] familyList,
- Font.Style style, int weight, int variant, int stretch, int size,
- int codePoint) throws FontException;
+ Font.Style style, Font.Weight weight, int variant, int stretch,
+ int size, int codePoint) throws FontException;
/**
* Returns the parent font consumer instance.
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 21:15:51 UTC (rev 8592)
+++ trunk/foray/foray-font/src/java/org/foray/font/FontSelectorCBC.java 2007-02-02 23:13:26 UTC (rev 8593)
@@ -57,7 +57,7 @@
* {@inheritDoc}
*/
public RegisteredFontDesc selectFont(final String [] familyList,
- final Font.Style style, final int weight, final int variant,
+ final Font.Style style, final Font.Weight weight, final int variant,
final int stretch, final int size, final int codePoint)
throws FontException {
FOrayFont fontSelected = null;
@@ -99,7 +99,7 @@
* or null if there is none.
*/
private RegisteredFontDesc selectFont(final String familyToTry,
- final Font.Style style, final int weight, final int variant,
+ final Font.Style style, final Font.Weight 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 21:15:51 UTC (rev 8592)
+++ trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontDesc.java 2007-02-02 23:13:26 UTC (rev 8593)
@@ -95,7 +95,7 @@
private Font.Style fontStyle;
/** The weight of this description. */
- private short fontWeight;
+ private Font.Weight fontWeight;
/** The variant value of this description. */
private byte fontVariant;
@@ -157,7 +157,7 @@
*/
public RegisteredFontDesc(final RegisteredFont rf,
final RegisteredFontFamily rff, final Encoding encoding,
- final Font.Style fontStyle, final short fontWeight,
+ final Font.Style fontStyle, final Font.Weight fontWeight,
final byte fontVariant, final byte fontStretch) {
this.registeredFont = rf;
this.registeredFontFamily = rff;
@@ -180,7 +180,7 @@
* Returns the font weight.
* @return The font weight.
*/
- public short getFontWeight() {
+ public Font.Weight getFontWeight() {
return this.fontWeight;
}
@@ -621,11 +621,11 @@
* @param desiredWeight The weight to match.
* @return True iff the style of this font description matches the criteria.
*/
- public boolean weightMatches(final int desiredWeight) {
+ public boolean weightMatches(final Font.Weight desiredWeight) {
if (desiredWeight == Font.Weight.ANY) {
return true;
}
- final int actualWeight = getFontWeight();
+ final Font.Weight actualWeight = getFontWeight();
if (actualWeight == desiredWeight) {
return true;
}
@@ -651,7 +651,7 @@
*/
public boolean matchPerfect(final RegisteredFontFamily family,
final boolean considerSimulated, final Font.Style style,
- final int weight, final int variant, final int stretch,
+ final Font.Weight weight, 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 21:15:51 UTC (rev 8592)
+++ trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontFamily.java 2007-02-02 23:13:26 UTC (rev 8593)
@@ -100,8 +100,8 @@
if (fontStyle == Font.Style.UNKNOWN) {
fontStyle = Font.Style.NORMAL;
}
- short fontWeight = FontUtility.foFontWeight(weight, false);
- if (fontWeight < 0) {
+ Font.Weight fontWeight = FontUtility.foFontWeight(weight, false);
+ if (fontWeight == Font.Weight.UNKNOWN) {
fontWeight = Font.Weight.NORMAL;
}
byte fontVariant = FontUtility.foFontVariant(variant, false);
@@ -148,7 +148,8 @@
* @throws FontException For error in registration.
*/
protected void registerFontDesc(final RegisteredFont registeredFont,
- final Encoding encoding, final Font.Style style, final short weight,
+ final Encoding encoding, final Font.Style style,
+ final Font.Weight weight,
final byte variant, final byte stretch,
final float simulatedSmallCaps, final float simulatedOblique,
final float simulatedBackslant, final float[] simulatedStretch)
@@ -170,8 +171,7 @@
+ "font-style "
+ FontUtility.fontStyleName(description.getFontStyle())
+ " font-weight "
- + FontUtility.fontWeightName(description
- .getFontWeight()));
+ + weight.toString());
}
}
this.fontDescriptions.add(description);
@@ -192,7 +192,7 @@
* or null if none match.
*/
protected RegisteredFontDesc findRegisteredFontDesc(final Font.Style style,
- final int weight, final int variant, final int stretch,
+ final Font.Weight weight, final int variant, final int stretch,
final boolean freeStandingFonts, final boolean systemFonts) {
/* First, look for a perfect match without considering simulated
* features. */
@@ -228,9 +228,12 @@
if (bestMatch == null) {
bestMatch = fd;
}
- final int bestDiff = Math.abs(bestMatch.getFontWeight()
- - weight);
- final int newDiff = Math.abs(fd.getFontWeight() - weight);
+ final int bestDiff = Math.abs(
+ bestMatch.getFontWeight().getNumericWeight()
+ - weight.getNumericWeight());
+ final int newDiff = Math.abs(
+ fd.getFontWeight().getNumericWeight()
+ - weight.getNumericWeight());
/* If the difference for this one is closer than the difference
* of the previous best match, then the new one is now the
* best match. */
@@ -274,7 +277,8 @@
continue;
}
// Ignore if the weight is not bolder.
- if (candidate.getFontWeight() <= baseline.getFontWeight()) {
+ if (candidate.getFontWeight().getNumericWeight()
+ <= baseline.getFontWeight().getNumericWeight()) {
continue;
}
// If no "best" yet, "candidate" now is.
@@ -283,7 +287,8 @@
continue;
}
// If "candidate" is lighter than "best", "candidate" is now "best".
- if (candidate.getFontWeight() < best.getFontWeight()) {
+ if (candidate.getFontWeight().getNumericWeight()
+ < best.getFontWeight().getNumericWeight()) {
best = candidate;
}
}
@@ -311,7 +316,8 @@
continue;
}
// Ignore if the weight is not lighter.
- if (candidate.getFontWeight() >= baseline.getFontWeight()) {
+ if (candidate.getFontWeight().getNumericWeight()
+ >= baseline.getFontWeight().getNumericWeight()) {
continue;
}
// If no "best" yet, "candidate" now is.
@@ -320,7 +326,8 @@
continue;
}
// If "candidate" is bolder than "best", "candidate" is now "best".
- if (candidate.getFontWeight() > best.getFontWeight()) {
+ if (candidate.getFontWeight().getNumericWeight()
+ > best.getFontWeight().getNumericWeight()) {
best = candidate;
}
}
Modified: trunk/foray/foray-font/src/java/org/foray/font/format/MetricsFileAFM.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/format/MetricsFileAFM.java 2007-02-02 21:15:51 UTC (rev 8592)
+++ trunk/foray/foray-font/src/java/org/foray/font/format/MetricsFileAFM.java 2007-02-02 23:13:26 UTC (rev 8593)
@@ -1014,13 +1014,13 @@
}
final String weightString = this.currentTokenizer.nextToken();
if (weightString.equals("Light")) {
- this.setWeight(Font.Weight.RELATIVE_300);
+ this.setWeight(Font.Weight.LIGHT.getNumericWeight());
} else if (weightString.equals("Medium")) {
- this.setWeight(Font.Weight.NORMAL);
+ this.setWeight(Font.Weight.NORMAL.getNumericWeight());
} else if (weightString.equals("Regular")) {
- this.setWeight(Font.Weight.NORMAL);
+ this.setWeight(Font.Weight.NORMAL.getNumericWeight());
} else if (weightString.equals("Bold")) {
- this.setWeight(Font.Weight.BOLD);
+ this.setWeight(Font.Weight.BOLD.getNumericWeight());
} else {
this.setWeight(0);
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-02-02 21:15:51 UTC (rev 8592)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-02-02 23:13:26 UTC (rev 8593)
@@ -1219,14 +1219,14 @@
/**
* {@inheritDoc}
*/
- public short traitFontStyle(final FOContext context) {
+ public Font.Style traitFontStyle(final FOContext context) {
return propertyList.getFontStyle(context);
}
/**
* {@inheritDoc}
*/
- public short traitFontWeight(final FOContext context) {
+ public Font.Weight traitFontWeight(final FOContext context) {
return propertyList.getFontWeight(context);
}
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 21:15:51 UTC (rev 8592)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2007-02-02 23:13:26 UTC (rev 8593)
@@ -243,7 +243,7 @@
convertFontSelectionStrategy(
traitFontSelectionStrategy(context)),
getFontFamily(context),
- convertFontStyle(getFontStyle(context)),
+ getFontStyle(context),
getFontWeight(context),
convertFontVariant(getFontVariant(context)),
convertFontStretch(getFontStretch(context)),
@@ -264,7 +264,7 @@
convertFontSelectionStrategy(
traitFontSelectionStrategy(context)),
getFontFamily(context),
- convertFontStyle(getFontStyle(context)),
+ getFontStyle(context),
getFontWeight(context),
convertFontVariant(getFontVariant(context)),
convertFontStretch(getFontStretch(context)),
@@ -1710,7 +1710,7 @@
return FontFamily.getValueNoInstance(context, fobj);
}
- public short getFontStyle(final FOContext context) {
+ public org.axsl.fontR.Font.Style getFontStyle(final FOContext context) {
FontStyle property = (FontStyle) getProperty(FoProperty.FONT_STYLE);
if (property != null) {
return property.getValue(context, fobj);
@@ -1724,7 +1724,7 @@
return FontStyle.getValueNoInstance(context, fobj);
}
- public short getFontWeight(final FOContext context) {
+ public org.axsl.fontR.Font.Weight getFontWeight(final FOContext context) {
FontWeight property = (FontWeight) getProperty(FoProperty.FONT_WEIGHT);
if (property != null) {
return property.getValue(context, fobj);
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/FontStyle.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/FontStyle.java 2007-02-02 21:15:51 UTC (rev 8592)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/FontStyle.java 2007-02-02 23:13:26 UTC (rev 8593)
@@ -73,28 +73,38 @@
throw unexpectedValue(value, propertyList);
}
- public short getValue(final FOContext context, final FObj fobj) {
+ public org.axsl.fontR.Font.Style getValue(final FOContext context,
+ final FObj fobj) {
if (value() instanceof PropertyKeyword) {
final short keyword = ((PropertyKeyword) value()).getValue();
switch (keyword) {
case FoValue.INHERIT: {
return getValueNoInstance(context, fobj);
}
- default: {
- return keyword;
+ case FoValue.NORMAL: {
+ return org.axsl.fontR.Font.Style.NORMAL;
}
+ case FoValue.ITALIC: {
+ return org.axsl.fontR.Font.Style.ITALIC;
}
+ case FoValue.OBLIQUE: {
+ return org.axsl.fontR.Font.Style.OBLIQUE;
+ }
+ case FoValue.BACKSLANT: {
+ return org.axsl.fontR.Font.Style.BACKSLANT;
+ }
+ }
}
- return FoValue.NORMAL;
+ return org.axsl.fontR.Font.Style.NORMAL;
}
- public static short getValueNoInstance(final FOContext context,
- final FObj fobj) {
+ public static org.axsl.fontR.Font.Style getValueNoInstance(
+ final FOContext context, final FObj fobj) {
final FObj parent = fobj.effectiveParent(context);
if (parent != null) {
return parent.traitFontStyle(context);
}
- return FoValue.NORMAL;
+ return org.axsl.fontR.Font.Style.NORMAL;
}
protected short[] getValidKeywords() {
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/FontWeight.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/FontWeight.java 2007-02-02 21:15:51 UTC (rev 8592)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/FontWeight.java 2007-02-02 23:13:26 UTC (rev 8593)
@@ -75,25 +75,14 @@
}
if (pv instanceof DtInteger) {
final int integer = ((DtInteger) pv).getValue();
- switch (integer) {
- case Font.Weight.RELATIVE_100:
- case Font.Weight.RELATIVE_200:
- case Font.Weight.RELATIVE_300:
- case Font.Weight.RELATIVE_400:
- case Font.Weight.RELATIVE_500:
- case Font.Weight.RELATIVE_600:
- case Font.Weight.RELATIVE_700:
- case Font.Weight.RELATIVE_800:
- case Font.Weight.RELATIVE_900: {
+ if (Font.Weight.isValidNumericWeight(integer)) {
return pv;
}
- }
- return pv;
}
throw unexpectedValue(value, propertyList);
}
- public short getValue(final FOContext context, final FObj fobj) {
+ public Font.Weight getValue(final FOContext context, final FObj fobj) {
if (value() instanceof PropertyKeyword) {
final short keyword = ((PropertyKeyword) value()).getValue();
switch (keyword) {
@@ -133,12 +122,13 @@
}
}
if (value() instanceof DtInteger) {
- return (short) ((DtInteger) value()).getValue();
+ final int integer = ((DtInteger) value()).getValue();
+ return Font.Weight.fromNumeric(integer);
}
return Font.Weight.NORMAL;
}
- public static short getValueNoInstance(final FOContext context,
+ public static Font.Weight getValueNoInstance(final FOContext context,
final FObj fobj) {
final FObj parent = fobj.effectiveParent(context);
if (parent != null) {
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 21:15:51 UTC (rev 8592)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java 2007-02-02 23:13:26 UTC (rev 8593)
@@ -920,7 +920,8 @@
if (gFont.isItalic()) {
fontStyle = org.axsl.fontR.Font.Style.ITALIC;
}
- int fontWeight = org.axsl.fontR.Font.Weight.NORMAL;
+ org.axsl.fontR.Font.Weight fontWeight
+ = org.axsl.fontR.Font.Weight.NORMAL;
if (gFont.isBold()) {
fontWeight = org.axsl.fontR.Font.Weight.BOLD;
}
@@ -994,7 +995,8 @@
org.axsl.fontR.FontUse font;
try {
font = this.fontConsumer.selectFontCSS(fontFamily,
- org.axsl.fontR.Font.Style.NORMAL, 0, 0, 0, 0, ch);
+ org.axsl.fontR.Font.Style.NORMAL,
+ org.axsl.fontR.Font.Weight.NORMAL, 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 21:15:51 UTC (rev 8592)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTextPainter.java 2007-02-02 23:13:26 UTC (rev 8593)
@@ -291,7 +291,8 @@
if (italic) {
style = Font.Style.ITALIC;
}
- int weight = org.axsl.fontR.Font.Weight.NORMAL;
+ org.axsl.fontR.Font.Weight weight
+ = org.axsl.fontR.Font.Weight.NORMAL;
if (bold) {
weight = org.axsl.fontR.Font.Weight.BOLD;
}
Modified: trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2007-02-02 21:15:51 UTC (rev 8592)
+++ trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2007-02-02 23:13:26 UTC (rev 8593)
@@ -468,11 +468,12 @@
final BookmarkTitleArea title = area.getBookmarkTitle();
final Color color = title.traitColor();
boolean italic = false;
- if (title.traitFontStyle() == FoValue.ITALIC) {
+ if (title.traitFontStyle() == Font.Style.ITALIC) {
italic = true;
}
boolean bold = false;
- if (title.traitFontWeight() >= Font.Weight.BOLD) {
+ if (title.traitFontWeight().getNumericWeight()
+ >= Font.Weight.BOLD.getNumericWeight()) {
bold = true;
}
PDFOutlineItem pdfOutline = null;
Modified: trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java 2007-02-02 21:15:51 UTC (rev 8592)
+++ trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java 2007-02-02 23:13:26 UTC (rev 8593)
@@ -677,7 +677,8 @@
}
public void outputFontTraits(final Area area, final StringBuffer buffer) {
- outputAttribute(buffer, "font-weight", area.traitFontWeight());
+ outputAttribute(buffer, "font-weight",
+ area.traitFontWeight().toString());
}
public void outputAttribute(final StringBuffer buffer,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|