mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-01 15:55:45 +00:00
GRAPHICS: Make Mac font rendering more like the original
By applying italics before outline, not after, and slanting italics characters from the bottom up instead of top down, I now get pixel perfect rendering for my experimental About dialogs for Loom and Indiana Jones and the Last Crusade.
This commit is contained in:
parent
51267fe4f6
commit
53d149b45b
@ -628,12 +628,6 @@ MacFONTFont *MacFONTFont::scaleFont(const MacFONTFont *src, int newSize, int sla
|
||||
}
|
||||
}
|
||||
|
||||
if (slant & kMacFontOutline) {
|
||||
tmpSurf.fillRect(Common::Rect(tmpSurf.w, tmpSurf.h), 0);
|
||||
makeOutline(&srcSurf, &tmpSurf, glyph, data._fRectHeight);
|
||||
srcSurf.copyFrom(tmpSurf);
|
||||
}
|
||||
|
||||
if (slant & kMacFontItalic) {
|
||||
tmpSurf.fillRect(Common::Rect(tmpSurf.w, tmpSurf.h), 0);
|
||||
makeItalic(&srcSurf, &tmpSurf, glyph, data._fRectHeight);
|
||||
@ -643,6 +637,12 @@ MacFONTFont *MacFONTFont::scaleFont(const MacFONTFont *src, int newSize, int sla
|
||||
if (slant & kMacFontUnderline)
|
||||
makeUnderLine(&srcSurf, glyph, data._ascent);
|
||||
|
||||
if (slant & kMacFontOutline) {
|
||||
tmpSurf.fillRect(Common::Rect(tmpSurf.w, tmpSurf.h), 0);
|
||||
makeOutline(&srcSurf, &tmpSurf, glyph, data._fRectHeight);
|
||||
srcSurf.copyFrom(tmpSurf);
|
||||
}
|
||||
|
||||
if (slant & kMacFontShadow) {
|
||||
tmpSurf.fillRect(Common::Rect(tmpSurf.w, tmpSurf.h), 0);
|
||||
makeShadow(&srcSurf, &tmpSurf, glyph, data._fRectHeight);
|
||||
@ -772,8 +772,8 @@ static void makeOutline(Surface *src, Surface *dst, MacGlyph *glyph, int height)
|
||||
static void makeItalic(Surface *src, Surface *dst, MacGlyph *glyph, int height) {
|
||||
int dw = (height - 1) / SLANTDEEP;
|
||||
|
||||
for (uint16 y = 0; y < height; y++) {
|
||||
int dx = dw - y / SLANTDEEP;
|
||||
for (int16 y = height - 1; y >= 0; y--) {
|
||||
int dx = (height - 1 - y) / SLANTDEEP;
|
||||
byte *srcPtr = (byte *)src->getBasePtr(0, y);
|
||||
byte *dstPtr = (byte *)dst->getBasePtr(dx, y);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user