natFont.cc (getMaxAscent): adjusted return value.

2003-06-09  Scott Gilbertson  <scottg@mantatest.com>

	* gnu/gcj/xlib/natFont.cc (getMaxAscent): adjusted return value.
	(getMaxDescent): adjusted return value.
	(getAscent): modified to use metrics for 'O'.
	(getDescent): modified to use metrics for 'y'.

From-SVN: r67692
This commit is contained in:
Scott Gilbertson 2003-06-10 01:50:12 +00:00 committed by Tom Tromey
parent 4665e56c27
commit 0940ed88c4
2 changed files with 21 additions and 4 deletions

View File

@ -1,3 +1,10 @@
2003-06-09 Scott Gilbertson <scottg@mantatest.com>
* gnu/gcj/xlib/natFont.cc (getMaxAscent): adjusted return value.
(getMaxDescent): adjusted return value.
(getAscent): modified to use metrics for 'O'.
(getDescent): modified to use metrics for 'y'.
2003-06-08 Anthony Green <green@redhat.com>
* java/net/URLStreamHandler.java (sameFile): Fix port value

View File

@ -44,25 +44,35 @@ jint gnu::gcj::xlib::Font::getXIDFromStruct(gnu::gcj::RawData* structure)
jint gnu::gcj::xlib::Font::getMaxAscent()
{
XFontStruct* fontStruct = (XFontStruct*) structure;
return fontStruct->max_bounds.ascent;
return fontStruct->max_bounds.ascent+1; // +1 to include the baseline
}
jint gnu::gcj::xlib::Font::getMaxDescent()
{
XFontStruct* fontStruct = (XFontStruct*) structure;
return fontStruct->max_bounds.descent;
return fontStruct->max_bounds.descent-1; // -1 to exclude the baseline
}
jint gnu::gcj::xlib::Font::getAscent()
{
XFontStruct* fontStruct = (XFontStruct*) structure;
return fontStruct->ascent;
jint returnValue = fontStruct->ascent;
if (fontStruct->min_byte1==0 && fontStruct->min_char_or_byte2<=(unsigned)'O')
returnValue = fontStruct
->per_char[(unsigned)'O'-fontStruct->min_char_or_byte2]
->ascent;
return returnValue+1; // +1 to include the baseline
}
jint gnu::gcj::xlib::Font::getDescent()
{
XFontStruct* fontStruct = (XFontStruct*) structure;
return fontStruct->ascent;
jint returnValue = fontStruct->descent;
if (fontStruct->min_byte1==0 && fontStruct->min_char_or_byte2<=(unsigned)'y')
returnValue = fontStruct
->per_char[(unsigned)'y'-fontStruct->min_char_or_byte2]
->descent;
return returnValue-1; // -1 to exclude the baseline
}
jint gnu::gcj::xlib::Font::getStringWidth(java::lang::String* text)