Skip to content

Commit

Permalink
Improved appearance of fallback fonts with the software renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
yvt committed Feb 14, 2014
1 parent cee2547 commit 5643f09
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Sources/Client/Fonts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ namespace spades {
20,
4,
true);
font->SetGlyphYRange(3.f, 17.f);
font->SetGlyphYRange(2.f, 15.f);
SPLog("Font 'CMUSansCondensed' Loaded");
return font;
}
Expand Down
18 changes: 10 additions & 8 deletions Sources/Client/IFont.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,14 +249,16 @@ namespace spades {

// margin to make the border completely transparent
// (considering the OpenGL's linear interpolation)
inRect.min.x -= 0.5f;
inRect.min.y -= 0.5f;
outRect.min.x -= 0.5f;
outRect.min.y -= 0.5f;
inRect.max.x += 0.5f;
inRect.max.y += 0.5f;
outRect.max.x += 0.5f;
outRect.max.y += 0.5f;
if(!roundSize){
inRect.min.x -= 0.5f;
inRect.min.y -= 0.5f;
outRect.min.x -= 0.5f;
outRect.min.y -= 0.5f;
inRect.max.x += 0.5f;
inRect.max.y += 0.5f;
outRect.max.x += 0.5f;
outRect.max.y += 0.5f;
}

outRect.min *= scale;
outRect.max *= scale;
Expand Down

0 comments on commit 5643f09

Please sign in to comment.