gdi32: Make the family replacement point to the family object.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2020-10-30 14:39:07 +01:00
parent d27a9d77ee
commit 74ea8d8c42
3 changed files with 12 additions and 12 deletions

View File

@ -517,7 +517,7 @@ struct gdi_font_family *create_family( const WCHAR *name, const WCHAR *second_na
}
else family->second_name[0] = 0;
list_init( &family->faces );
family->replacement = &family->faces;
family->replacement = NULL;
list_add_tail( &font_list, &family->entry );
return family;
}
@ -527,6 +527,7 @@ void release_family( struct gdi_font_family *family )
if (--family->refcount) return;
assert( list_empty( &family->faces ));
list_remove( &family->entry );
if (family->replacement) release_family( family->replacement );
HeapFree( GetProcessHeap(), 0, family );
}
@ -564,7 +565,8 @@ static BOOL add_family_replacement( const WCHAR *new_name, const WCHAR *replace
}
if (!(new_family = create_family( new_name, NULL ))) return FALSE;
new_family->replacement = &family->faces;
new_family->replacement = family;
family->refcount++;
TRACE( "mapping %s to %s\n", debugstr_w(replace), debugstr_w(new_name) );
/* also add replacement for vertical font if necessary */

View File

@ -662,10 +662,8 @@ static BOOL is_subpixel_rendering_enabled( void )
static const struct list *get_face_list_from_family(const Family *family)
{
if (!list_empty(&family->faces))
return &family->faces;
else
return family->replacement;
if (family->replacement) return &family->replacement->faces;
return &family->faces;
}
static Face *find_face_from_filename(const WCHAR *file_name, const WCHAR *face_name)

View File

@ -307,12 +307,12 @@ struct glyph_metrics;
struct gdi_font_family
{
struct list entry;
unsigned int refcount;
WCHAR family_name[LF_FACESIZE];
WCHAR second_name[LF_FACESIZE];
struct list faces;
struct list *replacement;
struct list entry;
unsigned int refcount;
WCHAR family_name[LF_FACESIZE];
WCHAR second_name[LF_FACESIZE];
struct list faces;
struct gdi_font_family *replacement;
};
struct bitmap_font_size