resend add missing glyph code to GetGlyphIndices

Jeff Latimer lats at yless4u.com.au
Mon Aug 14 03:49:00 CDT 2006


Dmitry Timoshkov wrote:

> "Jeff L" <lats at yless4u.com.au> wrote:
>
>> +DWORD WineEngGetGlyphIndices(HDC hdc, GdiFont font, LPCWSTR lpstr, 
>> INT count,
>>  LPWORD pgi, DWORD flags)
>> {
>>     INT i;
>> -
>> +    TEXTMETRICW textm;
>>     for(i = 0; i < count; i++)
>> +    {
>>         pgi[i] = get_glyph_index(font, lpstr[i]);
>> -
>> +        if  (pgi[i] == 0)
>> +        {
>> +            if  (flags & GGI_MARK_NONEXISTING_GLYPHS)
>> +                pgi[i] = 0x001f;                  /* Indicate non 
>> existance */
>> +            else
>> +            {
>> +                GetTextMetricsW(hdc, &textm);
>> +                pgi[i] = textm.tmDefaultChar;
>> +            }
>> +        }
>> +    }
>>     return count;
>> }
>
>
> I'd suggest to move GetTextMetricsW outside of the loop to not kill
> the performance.

I put it inside the loop as I assumed that  a non existent  glyph would 
be relatively rare and the  call would not happen much.  This seemed 
preferable to doing the call every time the function was called.

>
>
> Please set tab width to 8 instead of 4 and do not mix tabs and spaces.
>
These slip through occasionally when using MS Studio as an editor for 
developing tests.  A bad habit but in general productive.

Jeff




More information about the wine-devel mailing list