Revision: 7666
Author: victormote
Date: 2006-06-16 19:11:41 -0700 (Fri, 16 Jun 2006)
ViewCVS: http://svn.sourceforge.net/foray/?rev=7666&view=rev
Log Message:
-----------
Use new axsl Font methods to let the Font do the computation of these metrics.
Modified Paths:
--------------
trunk/foray/foray-render/src/java/org/foray/render/PrintRenderer.java
Modified: trunk/foray/foray-render/src/java/org/foray/render/PrintRenderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/PrintRenderer.java 2006-06-17 02:10:44 UTC (rev 7665)
+++ trunk/foray/foray-render/src/java/org/foray/render/PrintRenderer.java 2006-06-17 02:11:41 UTC (rev 7666)
@@ -31,6 +31,7 @@
import org.axsl.areaR.LeaderArea;
import org.axsl.areaR.TextArea;
import org.axsl.common.Constants;
+import org.axsl.fontR.Font;
import org.axsl.fontR.FontConsumer;
import org.apache.commons.logging.Log;
@@ -119,7 +120,9 @@
* @return The Y position that should be used for the underline stroke.
*/
protected int getUnderlineYPosition(GeneralInlineArea area) {
- return area.baselineY() - (area.traitFontSize() / 10);
+ Font font = area.getPrimaryFont().getFont();
+ int underlinePosition = font.underlinePosition(area.traitFontSize());
+ return area.baselineY() + underlinePosition;
}
/**
@@ -128,8 +131,9 @@
* @return The Y position that should be used for the overline stroke.
*/
protected int getOverlineYPosition(GeneralInlineArea area) {
- return area.baselineY() + area.getFontAscender()
- + (area.traitFontSize() / 10);
+ Font font = area.getPrimaryFont().getFont();
+ int overlinePosition = font.overlinePosition(area.traitFontSize());
+ return area.baselineY() + overlinePosition;
}
/**
@@ -138,7 +142,9 @@
* @return The Y position that should be used for the through stroke.
*/
protected int getThroughYPosition(GeneralInlineArea area) {
- return area.baselineY() + (area.getFontAscender() * 3 / 8);
+ Font font = area.getPrimaryFont().getFont();
+ int strikeoutPosition = font.strikeoutPosition(area.traitFontSize());
+ return area.baselineY() + strikeoutPosition;
}
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|