[2/5] gdi32: Implement CreateScalableFontResource, based on a patch by Jeremy White.

Alexandre Julliard julliard at winehq.org
Tue Nov 16 07:15:06 CST 2010


Dmitry Timoshkov <dmitry at codeweavers.com> writes:

> +    /* empty type info */
> +    memset(&rc_type, 0, sizeof(rc_type));
> +    if (!WriteFile(hfile, &rc_type, sizeof(rc_type), &dummy, NULL)) return FALSE;
> +
> +    if (!WriteFile(hfile, "\7FONTDIR", 8, &dummy, NULL)) return FALSE;
> +    str_len = strlen(resident_name);
> +    if (!WriteFile(hfile, &str_len, 1, &dummy, NULL)) return FALSE;
> +    if (!WriteFile(hfile, resident_name, str_len, &dummy, NULL)) return FALSE;
> +    if (!WriteFile(hfile, filler, 5, &dummy, NULL)) return FALSE;
> +
> +    str_len = strlen(non_resident_name);
> +    if (!WriteFile(hfile, &str_len, 1, &dummy, NULL)) return FALSE;
> +    if (!WriteFile(hfile, non_resident_name, str_len, &dummy, NULL)) return FALSE;
> +    /* terminator */
> +    if (!WriteFile(hfile, filler, 1, &dummy, NULL)) return FALSE;
> +
> +    /* empty ne_modtab and ne_imptab */
> +    if (!WriteFile(hfile, filler, 2, &dummy, NULL)) return FALSE;
> +
> +    if (!write_pad(hfile)) return FALSE;
> +
> +    if (!WriteFile(hfile, fd, fd->dfSize, &dummy, NULL)) return FALSE;
> +
> +    if (!write_pad(hfile)) return FALSE;
> +
> +    if (!WriteFile(hfile, ttf_file_nameA, strlen(ttf_file_nameA), &dummy, NULL)) return FALSE;
> +
> +    if (!write_pad(hfile)) return FALSE;

That's ugly and inefficient. The data should be built into a memory
buffer.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list