001: /**
002: * ===========================================
003: * JFreeReport : a free Java reporting library
004: * ===========================================
005: *
006: * Project Info: http://reporting.pentaho.org/
007: *
008: * (C) Copyright 2001-2007, by Object Refinery Ltd, Pentaho Corporation and Contributors.
009: *
010: * This library is free software; you can redistribute it and/or modify it under the terms
011: * of the GNU Lesser General Public License as published by the Free Software Foundation;
012: * either version 2.1 of the License, or (at your option) any later version.
013: *
014: * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
015: * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
016: * See the GNU Lesser General Public License for more details.
017: *
018: * You should have received a copy of the GNU Lesser General Public License along with this
019: * library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
020: * Boston, MA 02111-1307, USA.
021: *
022: * [Java is a trademark or registered trademark of Sun Microsystems, Inc.
023: * in the United States and other countries.]
024: *
025: * ------------
026: * LegacyFontMetrics.java
027: * ------------
028: * (C) Copyright 2001-2007, by Object Refinery Ltd, Pentaho Corporation and Contributors.
029: */package org.jfree.report.layout.text;
030:
031: import org.jfree.fonts.registry.BaselineInfo;
032: import org.jfree.fonts.registry.FontMetrics;
033: import org.jfree.fonts.tools.StrictGeomUtility;
034:
035: /**
036: * Creation-Date: 15.04.2007, 14:40:35
037: *
038: * @author Thomas Morgner
039: */
040: public class LegacyFontMetrics implements FontMetrics {
041: private FontMetrics parent;
042: private long fontHeight;
043:
044: public LegacyFontMetrics(final FontMetrics parent,
045: final double fontHeight) {
046: this .parent = parent;
047: this .fontHeight = StrictGeomUtility.toInternalValue(fontHeight);
048: }
049:
050: public long getAscent() {
051: return parent.getAscent();
052: }
053:
054: public long getDescent() {
055: return parent.getDescent();
056: }
057:
058: public long getLeading() {
059: return parent.getLeading();
060: }
061:
062: public long getXHeight() {
063: return parent.getXHeight();
064: }
065:
066: public long getOverlinePosition() {
067: return parent.getOverlinePosition();
068: }
069:
070: public long getUnderlinePosition() {
071: return parent.getUnderlinePosition();
072: }
073:
074: public long getStrikeThroughPosition() {
075: return parent.getStrikeThroughPosition();
076: }
077:
078: public long getMaxAscent() {
079: return parent.getMaxAscent();
080: }
081:
082: public long getMaxDescent() {
083: return parent.getMaxDescent();
084: }
085:
086: public long getMaxHeight() {
087: return fontHeight;
088: }
089:
090: public long getMaxCharAdvance() {
091: return parent.getMaxCharAdvance();
092: }
093:
094: public long getCharWidth(final int codePoint) {
095: return parent.getCharWidth(codePoint);
096: }
097:
098: public long getKerning(final int previous, final int codePoint) {
099: return parent.getKerning(previous, codePoint);
100: }
101:
102: public BaselineInfo getBaselines(final int codePoint,
103: final BaselineInfo info) {
104: return parent.getBaselines(codePoint, info);
105: }
106:
107: public long getItalicAngle() {
108: return parent.getItalicAngle();
109: }
110: }
|