diff --git a/reactos/drivers/video/font/bmfd/font.c b/reactos/drivers/video/font/bmfd/font.c index 19646288a2d..0bb8a44e071 100644 --- a/reactos/drivers/video/font/bmfd/font.c +++ b/reactos/drivers/video/font/bmfd/font.c @@ -389,7 +389,7 @@ BmfdQueryFontTree( { PBMFD_FILE pfile = (PBMFD_FILE)iFile; PBMFD_FACE pface; - ULONG i, j, cjOffset, cjSize, cGlyphs, cRuns; + ULONG i, j, cjSize, cGlyphs, cRuns; CHAR ch, chFirst, ach[256]; WCHAR wc, awc[256]; PFD_GLYPHSET pGlyphSet; @@ -475,14 +475,13 @@ BmfdQueryFontTree( pwcrun[0].wcLow = awc[0]; pwcrun[0].cGlyphs = 1; pwcrun[0].phg = phglyphs; - phglyphs[0] = (HGLYPH)pface->pCharTable; + phglyphs[0] = 0; /* Walk through all supported chars */ for (i = 1, j = 0; i < cGlyphs; i++) { - /* Use pointer to glyph entry as hglyph */ - cjOffset = (ach[i] - chFirst) * pface->cjEntrySize; - phglyphs[i] = (HGLYPH)(pface->pCharTable + cjOffset); + /* Use offset to glyph entry as hglyph */ + phglyphs[i] = (ach[i] - chFirst) * pface->cjEntrySize; /* Check whether we can append the wchar to a run */ if (awc[i] == awc[i - 1] + 1) diff --git a/reactos/drivers/video/font/bmfd/glyph.c b/reactos/drivers/video/font/bmfd/glyph.c index b3a7a7bab6b..443955a6286 100644 --- a/reactos/drivers/video/font/bmfd/glyph.c +++ b/reactos/drivers/video/font/bmfd/glyph.c @@ -80,7 +80,7 @@ BmfdQueryGlyphAndBitmap( ULONG cjSize) { PBMFD_FACE pface = pfont->pface; - PGLYPHENTRY pge = (PGLYPHENTRY)hg; + PGLYPHENTRY pge = (PGLYPHENTRY)(pface->pCharTable + hg); ULONG xSrc, ySrc, cxSrc, cySrc; ULONG xDst, yDst, cxDst, cyDst; ULONG xScale, yScale;