(svn r23009) -Change: Improve appearance of antialiased text with shadow.

This commit is contained in:
peter1138
2011-10-07 07:48:59 +00:00
parent ca1df3ddab
commit 8a41530585
3 changed files with 21 additions and 2 deletions

View File

@@ -1045,7 +1045,7 @@ const Sprite *GetGlyph(FontSize size, WChar key)
sprite.y_offs = _ascender[size] - slot->bitmap_top;
/* Draw shadow for medium size */
if (size == FS_NORMAL) {
if (size == FS_NORMAL && !aa) {
for (y = 0; y < slot->bitmap.rows; y++) {
for (x = 0; x < slot->bitmap.width; x++) {
if (aa ? (slot->bitmap.buffer[x + y * slot->bitmap.pitch] > 0) : HasBit(slot->bitmap.buffer[(x / 8) + y * slot->bitmap.pitch], 7 - (x % 8))) {
@@ -1074,6 +1074,12 @@ const Sprite *GetGlyph(FontSize size, WChar key)
}
bool GetDrawGlyphShadow()
{
return GetFontFace(FS_NORMAL) != NULL && GetFontAAState(FS_NORMAL);
}
uint GetGlyphWidth(FontSize size, WChar key)
{
FT_Face face = GetFontFace(size);