/*
 * This file is part of Mapyrus, software for plotting maps.
 * Copyright (C) 2003 - 2010 Simon Chenery.
 *
 * Mapyrus is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * Mapyrus is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with Mapyrus; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 */

/*
 * @(#) $Id$
 */
package org.mapyrus.font;

/**
 * Holds height and width of a string as double precision values.
 * Provides get and set methods for these values.
 */
public class StringDimension
{
	private double m_height;
	private double m_width;
	
	/**
	 * Create new dimension, with zero height and width.
	 */
	public StringDimension()
	{
		m_height = m_width = 0.0; 
	}

	/**
	 * Set dimension.
	 * @param width width to set.
	 * @param height height to set.
	 */
	public void setSize(double width, double height)
	{
		m_height = height;
		m_width = width;
	}

	/**
	 * Get string height.
	 * @return string height.
	 */
	public double getHeight()
	{
		return(m_height);
	}

	/**
	 * Get string width.
	 * @return string width.
	 */
	public double getWidth()
	{
		return(m_width);
	}

	/**
	 * Get dimension as a string.
	 * @return dimension string.
	 */
	public String toString()
	{
		return(m_width + " x " + m_height);
	}
}

@@ -892,26 +892,43 @@
 s height
- and width
+, width, ascent and descent
  of a st
@@ -1097,16 +1097,68 @@
 width;%0A%09
+private double m_ascent;%0A%09private double m_descent;%0A
 %0A%09/**%0A%09 
@@ -1265,16 +1265,39 @@
 _width =
+ m_ascent = m_descent =
  0.0; %0A%09
@@ -1440,16 +1440,47 @@
 e height
+, double ascent, double descent
 )%0A%09%7B%0A%09%09m
@@ -1516,16 +1516,60 @@
  width;%0A
+%09%09m_ascent = ascent;%0A%09%09m_descent = descent;%0A
 %09%7D%0A%0A%09/**
@@ -1784,24 +1784,256 @@
 width);%0A%09%7D%0A%0A
+%09/**%0A%09 * Get string ascent.%0A%09 * @return string ascent.%0A%09 */%0A%09public double getAscent()%0A%09%7B%0A%09%09return(m_ascent);%0A%09%7D%0A%0A%09/**%0A%09 * Get string descent.%0A%09 * @return string descent.%0A%09 */%0A%09public double getDescent()%0A%09%7B%0A%09%09return(m_descent);%0A%09%7D%0A%0A
 %09/**%0A%09 * Get

Add ascent and descent values.