X-Git-Url: https://git.ucc.asn.au/?p=tpg%2Facess2.git;a=blobdiff_plain;f=Usermode%2FApplications%2Faxwin4_src%2FServer%2Fdraw_text.cpp;h=7e9e7b8ede2bce15707e6bd9b02d7e98e9d92d2f;hp=4fc35a5d1cd2e4c610a9a9096a5153586b546002;hb=7f2068235fabc311332962711cd3220ce8ee2638;hpb=fb6b8936f33aae9477e3cb3b191fee5247d2248a diff --git a/Usermode/Applications/axwin4_src/Server/draw_text.cpp b/Usermode/Applications/axwin4_src/Server/draw_text.cpp index 4fc35a5d..7e9e7b8e 100644 --- a/Usermode/Applications/axwin4_src/Server/draw_text.cpp +++ b/Usermode/Applications/axwin4_src/Server/draw_text.cpp @@ -64,6 +64,19 @@ void CFontFallback::renderAtRes(CSurface& dest, const CRect& rect, uint32_t cp, } else if( Size < FONT_HEIGHT ) { // Down-scaled blit + // NOTE: uses the same code as the upscale blit (probably not correct, need to replace) + for( unsigned int row = 0; row < out_h; row ++ ) + { + unsigned int yf16 = row * FONT_HEIGHT * 0x10000 / out_h; + for( unsigned int col = 0; col < out_w; col ++ ) + { + unsigned int xf16 = col * FONT_WIDTH * 0x10000 / out_w; + uint8_t alpha = getValueAtPt(char_ptr, xf16, yf16); + //_SysDebug("row %i (%05x), col %i (%05x): alpha = %02x", row, yf16, col, xf16, alpha); + char_data[col] = ((uint32_t)alpha << 24) | (FGC & 0xFFFFFF); + } + dest.BlendScanline(rect.m_y + row, rect.m_x, out_w, char_data); + } } else { // up-scaled blit