Dmitry Timoshkov wrote:

"Jeff L" <[EMAIL PROTECTED]> 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



Reply via email to