}\r
\r
uint16_t SkScalerContext_Windows::generateCharToGlyph(SkUnichar uni) {\r
-\r
- //uint16_t index = 0;\r
- //GetGlyphIndicesW(ddc, &(uint16_t&)uni, 1, &index, 0);\r
- //return index;\r
-\r
- // let's just use the uni as index on Windows\r
- return SkToU16(uni);\r
+ uint16_t index = 0;\r
+ // TODO(ctguil): Support values larger than 16bits.\r
+ WCHAR c = SkToU16(uni);\r
+ GetGlyphIndicesW(ddc, &c, 1, &index, 0);\r
+ return index;\r
}\r
\r
void SkScalerContext_Windows::generateAdvance(SkGlyph* glyph) {\r
glyph->fRsbDelta = 0;\r
glyph->fLsbDelta = 0;\r
\r
- UINT glyphIndexFlag = 0; //glyph->fIsCodePoint ? 0 : GGO_GLYPH_INDEX;\r
- // UINT glyphIndexFlag = GGO_GLYPH_INDEX;\r
// Note: need to use GGO_GRAY8_BITMAP instead of GGO_METRICS because GGO_METRICS returns a smaller\r
// BlackBlox; we need the bigger one in case we need the image. fAdvance is the same.\r
- uint32_t ret = GetGlyphOutlineW(ddc, glyph->getGlyphID(0), GGO_GRAY8_BITMAP | glyphIndexFlag, &gm, 0, NULL, &mat22);\r
+ uint32_t ret = GetGlyphOutlineW(ddc, glyph->getGlyphID(0), GGO_GRAY8_BITMAP | GGO_GLYPH_INDEX, &gm, 0, NULL, &mat22);\r
\r
if (GDI_ERROR != ret) {\r
if (ret == 0) {\r
#endif\r
\r
uint32_t bytecount = 0;\r
- UINT glyphIndexFlag = 0; //glyph.fIsCodePoint ? 0 : GGO_GLYPH_INDEX;\r
- // UINT glyphIndexFlag = GGO_GLYPH_INDEX;\r
- uint32_t total_size = GetGlyphOutlineW(ddc, glyph.fID, GGO_GRAY8_BITMAP | glyphIndexFlag, &gm, 0, NULL, &mat22);\r
+ uint32_t total_size = GetGlyphOutlineW(ddc, glyph.fID, GGO_GRAY8_BITMAP | GGO_GLYPH_INDEX, &gm, 0, NULL, &mat22);\r
if (GDI_ERROR != total_size && total_size > 0) {\r
uint8_t *pBuff = new uint8_t[total_size];\r
if (NULL != pBuff) {\r
- total_size = GetGlyphOutlineW(ddc, glyph.fID, GGO_GRAY8_BITMAP | glyphIndexFlag, &gm, total_size, pBuff, &mat22);\r
+ total_size = GetGlyphOutlineW(ddc, glyph.fID, GGO_GRAY8_BITMAP | GGO_GLYPH_INDEX, &gm, total_size, pBuff, &mat22);\r
\r
SkASSERT(total_size != GDI_ERROR);\r
\r
#endif\r
\r
GLYPHMETRICS gm;\r
- UINT glyphIndexFlag = 0; //glyph.fIsCodePoint ? 0 : GGO_GLYPH_INDEX;\r
- uint32_t total_size = GetGlyphOutlineW(ddc, glyph.fID, GGO_NATIVE | glyphIndexFlag, &gm, BUFFERSIZE, glyphbuf, &mat22);\r
+ uint32_t total_size = GetGlyphOutlineW(ddc, glyph.fID, GGO_NATIVE | GGO_GLYPH_INDEX, &gm, BUFFERSIZE, glyphbuf, &mat22);\r
\r
if (GDI_ERROR != total_size) {\r
\r