forked from Mirrors/wine-wine
gdi32: Remove the loop over bitmap sizes. FreeType lists different sizes as separate faces.
Windows format bitmap fonts have been enumerated as separate faces since FreeType 2.1.5, since we require 2.1.9 for bitmap support we can safely drop this loop.oldstable
parent
8d50bb6711
commit
2489c3285c
|
@ -1683,11 +1683,8 @@ static inline void free_face( Face *face )
|
|||
|
||||
static void AddFaceToList(FT_Face ft_face, const char *file, void *font_data_ptr, DWORD font_data_size, FT_Long face_index, DWORD flags, BOOL vertical)
|
||||
{
|
||||
int bitmap_num = 0;
|
||||
Family *family;
|
||||
WCHAR *StyleW;
|
||||
|
||||
do {
|
||||
Face *face;
|
||||
struct list *face_elem_ptr;
|
||||
FONTSIGNATURE fs;
|
||||
|
@ -1695,7 +1692,7 @@ static void AddFaceToList(FT_Face ft_face, const char *file, void *font_data_ptr
|
|||
FT_Fixed version;
|
||||
|
||||
if(!FT_IS_SCALABLE(ft_face))
|
||||
size = (My_FT_Bitmap_Size *)ft_face->available_sizes + bitmap_num;
|
||||
size = (My_FT_Bitmap_Size *)ft_face->available_sizes;
|
||||
|
||||
family = get_family( ft_face, vertical );
|
||||
|
||||
|
@ -1704,18 +1701,23 @@ static void AddFaceToList(FT_Face ft_face, const char *file, void *font_data_ptr
|
|||
get_fontsig( ft_face, &fs );
|
||||
|
||||
version = get_font_version( ft_face );
|
||||
LIST_FOR_EACH(face_elem_ptr, &family->faces) {
|
||||
LIST_FOR_EACH(face_elem_ptr, &family->faces)
|
||||
{
|
||||
face = LIST_ENTRY(face_elem_ptr, Face, entry);
|
||||
if(!strcmpiW(face->StyleName, StyleW) &&
|
||||
(FT_IS_SCALABLE(ft_face) || ((size->y_ppem == face->size.y_ppem) && !memcmp(&fs, &face->fs, sizeof(fs)) ))) {
|
||||
(FT_IS_SCALABLE(ft_face) || ((size->y_ppem == face->size.y_ppem) && !memcmp(&fs, &face->fs, sizeof(fs)) )))
|
||||
{
|
||||
TRACE("Already loaded font %s %s original version is %lx, this version is %lx\n",
|
||||
debugstr_w(family->FamilyName), debugstr_w(StyleW),
|
||||
face->font_version, version);
|
||||
if(version <= face->font_version) {
|
||||
if(version <= face->font_version)
|
||||
{
|
||||
TRACE("Original font is newer so skipping this one\n");
|
||||
HeapFree(GetProcessHeap(), 0, StyleW);
|
||||
return;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
TRACE("Replacing original with this one\n");
|
||||
list_remove(&face->entry);
|
||||
free_face( face );
|
||||
|
@ -1723,6 +1725,7 @@ static void AddFaceToList(FT_Face ft_face, const char *file, void *font_data_ptr
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
face = HeapAlloc(GetProcessHeap(), 0, sizeof(*face));
|
||||
face->cached_enum_data = NULL;
|
||||
face->StyleName = StyleW;
|
||||
|
@ -1747,10 +1750,13 @@ static void AddFaceToList(FT_Face ft_face, const char *file, void *font_data_ptr
|
|||
face->external = (flags & ADDFONT_EXTERNAL_FONT) ? TRUE : FALSE;
|
||||
face->fs = fs;
|
||||
|
||||
if(FT_IS_SCALABLE(ft_face)) {
|
||||
if(FT_IS_SCALABLE(ft_face))
|
||||
{
|
||||
memset(&face->size, 0, sizeof(face->size));
|
||||
face->scalable = TRUE;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
TRACE("Adding bitmap size h %d w %d size %ld x_ppem %ld y_ppem %ld\n",
|
||||
size->height, size->width, size->size >> 6,
|
||||
size->x_ppem >> 6, size->y_ppem >> 6);
|
||||
|
@ -1773,8 +1779,6 @@ static void AddFaceToList(FT_Face ft_face, const char *file, void *font_data_ptr
|
|||
|
||||
AddFaceToFamily(face, family);
|
||||
|
||||
} while(!FT_IS_SCALABLE(ft_face) && ++bitmap_num < ft_face->num_fixed_sizes);
|
||||
|
||||
TRACE("Added font %s %s\n", debugstr_w(family->FamilyName),
|
||||
debugstr_w(StyleW));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue