GDI32: Fix logical error of italic,bold determination

Byeong-Sik Jeon wjsqudtlr at gmail.com
Thu Mar 16 12:08:48 CST 2006


2006-03-15 (수), 14:50 +0000, Huw D M Davies 쓰시길: 
> 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.

Hi. I'm late...

A   B    A xor B
0   0       0
0   1       1
1   0       1
1   1       0
===>   0 ^ A == A ^ 0 == A,   1 ^ A == A ^ 1 == !A

This code is just a compression of my old patch [3/5].
but, this dirty code did not satisfy me too.


I will rework this and others(FT_Bitmap_Convert, FT_Sfnt_Name).
Thanks your advice. :)





More information about the wine-devel mailing list