GDI32: Fix logical error of italic,bold determination

Huw D M Davies h.davies1 at physics.ox.ac.uk
Wed Mar 15 08:50:34 CST 2006


On Mon, Mar 13, 2006 at 04:10:04AM +0900, Byeong-Sik Jeon wrote:
> ChangeLog:
> Fix the logical error of the italic, bold determination.
> 
> Index: dlls/gdi/freetype.c
> ===================================================================
> RCS file: /home/wine/wine/dlls/gdi/freetype.c,v
> retrieving revision 1.114
> diff -u -u -r1.114 freetype.c
> --- dlls/gdi/freetype.c	9 Mar 2006 12:30:52 -0000	1.114
> +++ dlls/gdi/freetype.c	12 Mar 2006 10:01:22 -0000
> +    for(i = 0; !face && i < 4; ++i) {
>          best = NULL;
>          LIST_FOR_EACH(face_elem_ptr, &family->faces) {
>              face = LIST_ENTRY(face_elem_ptr, Face, entry);
> -            if((csi.fs.fsCsb[0] & (face->fs.fsCsb[0] | face->fs_links.fsCsb[0])) || !csi.fs.fsCsb[0]) {
> +            if((!(face->Italic ^ it) ^ ((i >> 1) & 1)) && (!(face->Bold ^ bd) ^ (i & 1)) &&
> +               ((csi.fs.fsCsb[0] & (face->fs.fsCsb[0] | face->fs_links.fsCsb[0])) || !csi.fs.fsCsb[0])) {


It doesn't seem right to compare these with 'i', the order of the faces is random.

The right way to do this is to rewrite all this font matching code so
that we loop through the families and faces once and score each one.
At the end we pick the one with the lowest score.

Huw.
-- 
Huw Davies
huw at codeweavers.com



More information about the wine-devel mailing list