Commit 05bb6f6c authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

gdi32: Let the WINE_GGO_GRAY16_BITMAP case load a bitmap.

parent 70c21293
...@@ -3533,7 +3533,7 @@ DWORD WineEngGetGlyphOutline(GdiFont *incoming_font, UINT glyph, UINT format, ...@@ -3533,7 +3533,7 @@ DWORD WineEngGetGlyphOutline(GdiFont *incoming_font, UINT glyph, UINT format,
if (!font->gm[glyph_index / GM_BLOCK_SIZE]) if (!font->gm[glyph_index / GM_BLOCK_SIZE])
font->gm[glyph_index / GM_BLOCK_SIZE] = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY, sizeof(GM) * GM_BLOCK_SIZE); font->gm[glyph_index / GM_BLOCK_SIZE] = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY, sizeof(GM) * GM_BLOCK_SIZE);
if(font->orientation || (format != GGO_METRICS && format != GGO_BITMAP) || font->aveWidth || lpmat) if(font->orientation || (format != GGO_METRICS && format != GGO_BITMAP && format != WINE_GGO_GRAY16_BITMAP) || font->aveWidth || lpmat)
load_flags |= FT_LOAD_NO_BITMAP; load_flags |= FT_LOAD_NO_BITMAP;
err = pFT_Load_Glyph(ft_face, glyph_index, load_flags); err = pFT_Load_Glyph(ft_face, glyph_index, load_flags);
...@@ -3650,7 +3650,7 @@ DWORD WineEngGetGlyphOutline(GdiFont *incoming_font, UINT glyph, UINT format, ...@@ -3650,7 +3650,7 @@ DWORD WineEngGetGlyphOutline(GdiFont *incoming_font, UINT glyph, UINT format,
lpgm->gmptGlyphOrigin.x = left >> 6; lpgm->gmptGlyphOrigin.x = left >> 6;
lpgm->gmptGlyphOrigin.y = top >> 6; lpgm->gmptGlyphOrigin.y = top >> 6;
if(format == GGO_METRICS || format == GGO_BITMAP) if(format == GGO_METRICS || format == GGO_BITMAP || format == WINE_GGO_GRAY16_BITMAP)
{ {
FONT_GM(font,glyph_index)->gm = *lpgm; FONT_GM(font,glyph_index)->gm = *lpgm;
FONT_GM(font,glyph_index)->adv = adv; FONT_GM(font,glyph_index)->adv = adv;
...@@ -3662,7 +3662,7 @@ DWORD WineEngGetGlyphOutline(GdiFont *incoming_font, UINT glyph, UINT format, ...@@ -3662,7 +3662,7 @@ DWORD WineEngGetGlyphOutline(GdiFont *incoming_font, UINT glyph, UINT format,
if(format == GGO_METRICS) if(format == GGO_METRICS)
return 1; /* FIXME */ return 1; /* FIXME */
if(ft_face->glyph->format != ft_glyph_format_outline && format != GGO_BITMAP) { if(ft_face->glyph->format != ft_glyph_format_outline && format != GGO_BITMAP && format != WINE_GGO_GRAY16_BITMAP) {
TRACE("loaded a bitmap\n"); TRACE("loaded a bitmap\n");
return GDI_ERROR; return GDI_ERROR;
} }
...@@ -3728,34 +3728,55 @@ DWORD WineEngGetGlyphOutline(GdiFont *incoming_font, UINT glyph, UINT format, ...@@ -3728,34 +3728,55 @@ DWORD WineEngGetGlyphOutline(GdiFont *incoming_font, UINT glyph, UINT format,
needed = pitch * height; needed = pitch * height;
if(!buf || !buflen) break; if(!buf || !buflen) break;
ft_bitmap.width = width;
ft_bitmap.rows = height;
ft_bitmap.pitch = pitch;
ft_bitmap.pixel_mode = ft_pixel_mode_grays;
ft_bitmap.buffer = buf;
if(needsTransform) {
pFT_Outline_Transform(&ft_face->glyph->outline, &transMat);
}
pFT_Outline_Translate(&ft_face->glyph->outline, -left, -bottom );
memset(ft_bitmap.buffer, 0, buflen);
pFT_Outline_Get_Bitmap(library, &ft_face->glyph->outline, &ft_bitmap);
if(format == GGO_GRAY2_BITMAP) switch(ft_face->glyph->format) {
mult = 4; case ft_glyph_format_bitmap:
else if(format == GGO_GRAY4_BITMAP) {
mult = 16; BYTE *src = ft_face->glyph->bitmap.buffer, *dst = buf;
else if(format == GGO_GRAY8_BITMAP) INT h = ft_face->glyph->bitmap.rows;
mult = 64; INT x;
else if(format == WINE_GGO_GRAY16_BITMAP) while(h--) {
break; for(x = 0; x < pitch; x++)
else { dst[x] = (src[x / 8] & (1 << ( (7 - (x % 8))))) ? 0xff : 0;
assert(0); src += ft_face->glyph->bitmap.pitch;
break; dst += pitch;
} }
return needed;
}
case ft_glyph_format_outline:
{
ft_bitmap.width = width;
ft_bitmap.rows = height;
ft_bitmap.pitch = pitch;
ft_bitmap.pixel_mode = ft_pixel_mode_grays;
ft_bitmap.buffer = buf;
if(needsTransform)
pFT_Outline_Transform(&ft_face->glyph->outline, &transMat);
pFT_Outline_Translate(&ft_face->glyph->outline, -left, -bottom );
memset(ft_bitmap.buffer, 0, buflen);
pFT_Outline_Get_Bitmap(library, &ft_face->glyph->outline, &ft_bitmap);
if(format == GGO_GRAY2_BITMAP)
mult = 4;
else if(format == GGO_GRAY4_BITMAP)
mult = 16;
else if(format == GGO_GRAY8_BITMAP)
mult = 64;
else if(format == WINE_GGO_GRAY16_BITMAP)
return needed;
else {
assert(0);
break;
}
}
default:
FIXME("loaded glyph format %x\n", ft_face->glyph->format);
return GDI_ERROR;
}
start = buf; start = buf;
for(row = 0; row < height; row++) { for(row = 0; row < height; row++) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment