mirror of https://github.com/OpenTTD/OpenTTD.git
Fix: [Win32] Font glyphs of certain widths broke
Font glyphs between 33 and 39 pixels wide, in the Win32 font system, used wrong alignment and caused glyphs to appear broken. When in the 33 to 39 pixel range, glyphs without AA were rounded down to 32 pixel pitch, instead of up to 64 pixel pitch.
This commit is contained in:
parent
4ffe7131cb
commit
5905fdb26e
|
@ -497,7 +497,7 @@ void Win32FontCache::ClearFontCache()
|
|||
* For anti-aliased rendering, GDI uses the strange value range of 0 to 64,
|
||||
* inclusively. To map this to 0 to 255, we shift left by two and then
|
||||
* subtract one. */
|
||||
uint pitch = Align(aa ? gm.gmBlackBoxX : std::max(gm.gmBlackBoxX / 8u, 1u), 4);
|
||||
uint pitch = Align(aa ? gm.gmBlackBoxX : std::max((gm.gmBlackBoxX + 7u) / 8u, 1u), 4);
|
||||
|
||||
/* Draw shadow for medium size. */
|
||||
if (this->fs == FS_NORMAL && !aa) {
|
||||
|
|
Loading…
Reference in New Issue