summaryrefslogtreecommitdiff
path: root/indra/llrender/llfontgl.cpp
diff options
context:
space:
mode:
authorRichard Linden <none@none>2012-01-18 16:30:53 -0800
committerRichard Linden <none@none>2012-01-18 16:30:53 -0800
commit3a597af700e55e2017c85220b2b97cc9f3aef9aa (patch)
tree27fad847f98fbe41732584ec84fd7458a4e0f02f /indra/llrender/llfontgl.cpp
parente41ad89f7b68b5f9edaf1fd66decadb8e08d1dce (diff)
EXP-1513 FIX Underscore ( _ ) fails to show in first chat entry in Local Chat
fixed font metrics rounding error and made corrective adjustments in layout
Diffstat (limited to 'indra/llrender/llfontgl.cpp')
-rw-r--r--indra/llrender/llfontgl.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp
index 82e8227ffe..12f86cf599 100644
--- a/indra/llrender/llfontgl.cpp
+++ b/indra/llrender/llfontgl.cpp
@@ -218,13 +218,13 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
switch (valign)
{
case TOP:
- cur_y -= mFontFreetype->getAscenderHeight();
+ cur_y -= getAscenderHeight();
break;
case BOTTOM:
- cur_y += mFontFreetype->getDescenderHeight();
+ cur_y += getDescenderHeight();
break;
case VCENTER:
- cur_y -= (mFontFreetype->getAscenderHeight() - mFontFreetype->getDescenderHeight()) / 2.f;
+ cur_y -= (getAscenderHeight() - getDescenderHeight()) / 2.f;
break;
case BASELINE:
// Baseline, do nothing.
@@ -390,12 +390,12 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
//FIXME: add underline as glyph?
if (style_to_add & UNDERLINE)
{
- F32 descender = mFontFreetype->getDescenderHeight();
+ F32 descender = (F32)llfloor(mFontFreetype->getDescenderHeight());
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
gGL.begin(LLRender::LINES);
- gGL.vertex2f(start_x, cur_y - (descender));
- gGL.vertex2f(cur_x, cur_y - (descender));
+ gGL.vertex2f(start_x, cur_y - descender);
+ gGL.vertex2f(cur_x, cur_y - descender);
gGL.end();
}
@@ -446,17 +446,17 @@ S32 LLFontGL::renderUTF8(const std::string &text, S32 begin_offset, S32 x, S32 y
// font metrics - override for LLFontFreetype that returns units of virtual pixels
F32 LLFontGL::getLineHeight() const
{
- return (F32)llround(mFontFreetype->getLineHeight() / sScaleY);
+ return (F32)llceil(mFontFreetype->getLineHeight() / sScaleY);
}
F32 LLFontGL::getAscenderHeight() const
{
- return (F32)llround(mFontFreetype->getAscenderHeight() / sScaleY);
+ return (F32)llceil(mFontFreetype->getAscenderHeight() / sScaleY);
}
F32 LLFontGL::getDescenderHeight() const
{
- return (F32)llround(mFontFreetype->getDescenderHeight() / sScaleY);
+ return (F32)llceil(mFontFreetype->getDescenderHeight() / sScaleY);
}
S32 LLFontGL::getWidth(const std::string& utf8text) const