[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
Hmm... actually, I have a question about this patch, because as I recall,
the case it's supposed to solve shouldn't happen.
The patch adds the following lines to the merge_fonts() routine for the
colour vtable:
+
+ /* We adapt the second font to the first one so swap fonts if needed.
*/
+ if (is_mono_font(font1)) {
+ FONT *tmp;
+
+ if (is_mono_font(font2))
+ return NULL;
+
+ /* swap */
+ tmp = font1;
+ font1 = font2;
+ font2 = tmp;
+ }
+
However,
FONT *merge_fonts(FONT *f1, FONT *f2)
{
FONT *f = NULL;
if (f1->vtable->merge_fonts)
f = f1->vtable->merge_fonts(f1, f2);
if (!f && f2->vtable->merge_fonts)
f = f2->vtable->merge_fonts(f2, f1);
return f;
}
So if font1 is not a colourfont, the function should never be called at all
and the condition `if (is_mono_font(font1))' should always be false.
What am I missing?
Evert