(resend/renumber)[6/14]dwrite: code to add fonts to a fontfamily

Aric Stewart aric at codeweavers.com
Thu Sep 4 09:03:55 CDT 2014


On Thu Sep  4 09:01:41 2014, Alexandre Julliard wrote:
> Aric Stewart <aric at codeweavers.com> writes:
>
>> @@ -968,6 +968,28 @@ static const IDWriteFontFamilyVtbl fontfamilyvtbl = {
>>       dwritefontfamily_GetMatchingFonts
>>   };
>>
>> +static HRESULT fontfamily_AddFont(struct dwrite_fontfamily *family, IDWriteFont *font)
>> +{
>> +    struct dwrite_font *font_data = impl_from_IDWriteFont(font);
>> +
>> +    if (family->font_count + 1 >= family->alloc)
>> +    {
>> +        struct dwrite_font_data **new_list;
>> +        UINT32 new_alloc;
>> +        new_alloc = family->alloc * 2;
>> +        new_list = heap_realloc(family->fonts, sizeof(*family->fonts) * new_alloc);
>> +        if (!new_list)
>> +            return E_OUTOFMEMORY;
>> +        family->fonts = new_list;
>> +        family->alloc = new_alloc;
>> +    }
>> +
>> +    family->fonts[family->font_count] = font_data->data;
>> +    InterlockedIncrement(&font_data->data->ref);
>> +    family->font_count++;
>> +    return S_OK;
>> +}
>
> Please don't add dead code.
>

Ok, I will merge this (and some later ones) with the later patches that 
use the functions.

-aric



More information about the wine-devel mailing list