mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 16:31:05 +02:00
fontrenderer: bring RenderString() and getRenderWidth() in line
both functions had slightly different ideas on how wide a string
would render, leading to occational off-by-ones and eventually
stripped characters
git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@1264 e54a6e83-5905-42d5-8d5c-058d10e6a962
Origin commit data
------------------
Branch: ni/coolstream
Commit: f0d56fe6e7
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2011-03-06 (Sun, 06 Mar 2011)
------------------
This commit was generated by Migit
This commit is contained in:
@@ -500,18 +500,18 @@ void Font::RenderString(int x, int y, const int width, const char *text, const u
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//kerning
|
||||||
|
if (use_kerning)
|
||||||
|
{
|
||||||
|
FT_Get_Kerning(face, lastindex, index, 0, &kerning);
|
||||||
|
//x+=(kerning.x+32)>>6; // kerning!
|
||||||
|
x += (kerning.x) >> 6; // kerning!
|
||||||
|
}
|
||||||
|
|
||||||
// width clip
|
// width clip
|
||||||
if (x + glyph->xadvance + spread_by > left + width)
|
if (x + glyph->xadvance + spread_by > left + width)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
//kerning
|
|
||||||
if(use_kerning)
|
|
||||||
{
|
|
||||||
FT_Get_Kerning(face,lastindex,index,0,&kerning);
|
|
||||||
//x+=(kerning.x+32)>>6; // kerning!
|
|
||||||
x+=(kerning.x)>>6; // kerning!
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifndef USE_NEVIS_GXA
|
#ifndef USE_NEVIS_GXA
|
||||||
int stride = frameBuffer->getStride();
|
int stride = frameBuffer->getStride();
|
||||||
int ap=(x + glyph->left) * sizeof(fb_pixel_t) + stride * (y - glyph->top);
|
int ap=(x + glyph->left) * sizeof(fb_pixel_t) + stride * (y - glyph->top);
|
||||||
@@ -638,10 +638,10 @@ int Font::getRenderWidth(const char *text, const bool utf8_encoded)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//kerning
|
//kerning
|
||||||
if(use_kerning)
|
if (use_kerning)
|
||||||
{
|
{
|
||||||
FT_Get_Kerning(face,lastindex,index,0,&kerning);
|
FT_Get_Kerning(face, lastindex, index, 0, &kerning);
|
||||||
x+=(kerning.x+32)>>6; // kerning!
|
x += (kerning.x) >> 6; // kerning!
|
||||||
}
|
}
|
||||||
|
|
||||||
x+=glyph->xadvance+1;
|
x+=glyph->xadvance+1;
|
||||||
|
Reference in New Issue
Block a user