diff options
author | richard <none@none> | 2009-12-07 13:00:40 -0800 |
---|---|---|
committer | richard <none@none> | 2009-12-07 13:00:40 -0800 |
commit | 1d2a8e0f83ab85d0a907b66b55af12ea41891f65 (patch) | |
tree | f007d95865a38f433e62e17b68547c7d15ca2b19 /indra | |
parent | 329d5553027c5a1aacae6b01dc57db8f94510b6d (diff) |
ext-3112 - bad font width information with sansserif
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llrender/llfontgl.cpp | 4 | ||||
-rw-r--r-- | indra/llui/lltextbase.cpp | 10 |
2 files changed, 4 insertions, 10 deletions
diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp index 9ba0cfc6b8..a28ffbfdc0 100644 --- a/indra/llrender/llfontgl.cpp +++ b/indra/llrender/llfontgl.cpp @@ -446,7 +446,9 @@ F32 LLFontGL::getWidthF32(const llwchar* wchars, S32 begin_offset, S32 max_chars // for the last character we want to measure the greater of its width and xadvance values // so keep track of the difference between these values for the each character we measure // so we can fix things up at the end - width_padding = llmax(0.f, (F32)fgi->mWidth - advance); + width_padding = llmax( 0.f, // always use positive padding amount + width_padding - advance, // previous padding left over after advance of current character + (F32)(fgi->mWidth + fgi->mXBearing) - advance); // difference between width of this character and advance to next character cur_x += advance; llwchar next_char = wchars[i+1]; diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 82a3c5cf47..741ab1737d 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -543,17 +543,9 @@ void LLTextBase::drawText() line_end = next_start; } - // A patch for EXT-1944 "Implement ellipses in message well" - // introduced a regression where text in SansSerif ending in the - // letter "r" is clipped. This may be due to an off-by-one in - // font width information out of FreeType with our fractional font - // sizes. For now, just make an extra pixel of space to resolve - // EXT-2971 "Letter R doesn't show when it's the last letter in a - // text block". See James/Richard for details. - const S32 FIX_CLIPPING_HACK = 1; LLRect text_rect(line.mRect.mLeft + mTextRect.mLeft - scrolled_view_rect.mLeft, line.mRect.mTop - scrolled_view_rect.mBottom + mTextRect.mBottom, - llmin(mDocumentView->getRect().getWidth(), line.mRect.mRight) - scrolled_view_rect.mLeft + FIX_CLIPPING_HACK, + llmin(mDocumentView->getRect().getWidth(), line.mRect.mRight) - scrolled_view_rect.mLeft, line.mRect.mBottom - scrolled_view_rect.mBottom + mTextRect.mBottom); // draw a single line of text |