mirror of
https://github.com/reactos/reactos.git
synced 2025-06-15 07:08:29 +00:00
Bmfd: The cjGlyphMax field of the PFD_DEVICEMETRICS, the cjSize parameter of BmfdQueryFontData and it's return value all specify the size of the full GLYPHBITS structure, not only the glyph bitmap. Fixes problem of truncated Glyphs. Fix calculation of glyph handles. TODO: 90° rotation and integral scaling.
svn path=/trunk/; revision=39860
This commit is contained in:
parent
c712fa746c
commit
d7f6c74d76
4 changed files with 19 additions and 9 deletions
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
|
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
|
||||||
<module name="bmfd" type="kernelmodedriver" entrypoint="FonfdEnableDriver@12" installbase="system32" installname="bmfd.dll" crt="static">
|
<module name="bmfd" type="kernelmodedriver" entrypoint="BmfdEnableDriver@12" installbase="system32" installname="bmfd.dll" crt="static">
|
||||||
<library>win32k</library>
|
<library>win32k</library>
|
||||||
<library>libcntpr</library>
|
<library>libcntpr</library>
|
||||||
<file>enable.c</file>
|
<file>enable.c</file>
|
||||||
|
|
|
@ -30,7 +30,7 @@ DbgPrint(IN PCHAR Format, IN ...)
|
||||||
va_list args;
|
va_list args;
|
||||||
|
|
||||||
va_start(args, Format);
|
va_start(args, Format);
|
||||||
EngDebugPrint("Bmfd: ", (PCHAR)Format, args);
|
EngDebugPrint("Bmfd: ", Format, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -397,7 +397,7 @@ BmfdQueryFontTree(
|
||||||
HGLYPH * phglyphs;
|
HGLYPH * phglyphs;
|
||||||
|
|
||||||
DbgPrint("DrvQueryFontTree(iMode=%ld)\n", iMode);
|
DbgPrint("DrvQueryFontTree(iMode=%ld)\n", iMode);
|
||||||
DbgBreakPoint();
|
// DbgBreakPoint();
|
||||||
|
|
||||||
/* Check parameters, we only support QFT_GLYPHSET */
|
/* Check parameters, we only support QFT_GLYPHSET */
|
||||||
if (!iFace || iFace > pfont->cNumFaces || iMode != QFT_GLYPHSET)
|
if (!iFace || iFace > pfont->cNumFaces || iMode != QFT_GLYPHSET)
|
||||||
|
@ -482,7 +482,7 @@ BmfdQueryFontTree(
|
||||||
{
|
{
|
||||||
/* Use pointer to glyph entry as hglyph */
|
/* Use pointer to glyph entry as hglyph */
|
||||||
cjOffset = (ach[i] - chFirst) * pface->cjEntrySize;
|
cjOffset = (ach[i] - chFirst) * pface->cjEntrySize;
|
||||||
phglyphs[i] = (HGLYPH)pface->pCharTable + cjOffset;
|
phglyphs[i] = (HGLYPH)(pface->pCharTable + cjOffset);
|
||||||
|
|
||||||
/* Check whether we can append the wchar to a run */
|
/* Check whether we can append the wchar to a run */
|
||||||
if (awc[i] == awc[i - 1] + 1)
|
if (awc[i] == awc[i - 1] + 1)
|
||||||
|
|
|
@ -13,6 +13,8 @@ FillFDDM(
|
||||||
PFD_DEVICEMETRICS pfddm,
|
PFD_DEVICEMETRICS pfddm,
|
||||||
PFONTINFO16 pFontInfo)
|
PFONTINFO16 pFontInfo)
|
||||||
{
|
{
|
||||||
|
ULONG cjMaxWidth, cjMaxBitmapSize;
|
||||||
|
|
||||||
/* Fill FD_DEVICEMETRICS */
|
/* Fill FD_DEVICEMETRICS */
|
||||||
pfddm->flRealizedType = FDM_MASK;
|
pfddm->flRealizedType = FDM_MASK;
|
||||||
pfddm->pteBase.x = FLOATL_1;
|
pfddm->pteBase.x = FLOATL_1;
|
||||||
|
@ -30,13 +32,21 @@ FillFDDM(
|
||||||
pfddm->lD = GETVAL(pFontInfo->dfPixWidth);
|
pfddm->lD = GETVAL(pFontInfo->dfPixWidth);
|
||||||
pfddm->cxMax = GETVAL(pFontInfo->dfMaxWidth);
|
pfddm->cxMax = GETVAL(pFontInfo->dfMaxWidth);
|
||||||
pfddm->cyMax = GETVAL(pFontInfo->dfPixHeight);
|
pfddm->cyMax = GETVAL(pFontInfo->dfPixHeight);
|
||||||
pfddm->cjGlyphMax = pfddm->cyMax * ((pfddm->cxMax + 7) / 8);
|
|
||||||
pfddm->fxMaxAscender = GETVAL(pFontInfo->dfAscent) << 4;
|
pfddm->fxMaxAscender = GETVAL(pFontInfo->dfAscent) << 4;
|
||||||
pfddm->fxMaxDescender = (pfddm->cyMax << 4) - pfddm->fxMaxAscender;
|
pfddm->fxMaxDescender = (pfddm->cyMax << 4) - pfddm->fxMaxAscender;
|
||||||
pfddm->lMinA = 0;
|
pfddm->lMinA = 0;
|
||||||
pfddm->lMinC = 0;
|
pfddm->lMinC = 0;
|
||||||
pfddm->lMinD = 0;
|
pfddm->lMinD = 0;
|
||||||
|
|
||||||
|
/* Calculate Width in bytes */
|
||||||
|
cjMaxWidth = ((pfddm->cxMax + 7) >> 3);
|
||||||
|
|
||||||
|
/* Calculate size of the bitmap, rounded to DWORDs */
|
||||||
|
cjMaxBitmapSize = ((cjMaxWidth * pfddm->cyMax) + 3) & ~3;
|
||||||
|
|
||||||
|
/* cjGlyphMax is the full size of the GLYPHBITS structure */
|
||||||
|
pfddm->cjGlyphMax = FIELD_OFFSET(GLYPHBITS, aj) + cjMaxBitmapSize;
|
||||||
|
|
||||||
/* NOTE: fdxQuantized and NonLinear... stay unchanged */
|
/* NOTE: fdxQuantized and NonLinear... stay unchanged */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,7 +140,7 @@ BmfdQueryFontData(
|
||||||
// DbgBreakPoint();
|
// DbgBreakPoint();
|
||||||
|
|
||||||
/* Verify that the buffer is big enough */
|
/* Verify that the buffer is big enough */
|
||||||
if (cjSize < ulPixHeight * cjRow)
|
if (cjSize < FIELD_OFFSET(GLYPHBITS, aj) + ulPixHeight * cjRow)
|
||||||
{
|
{
|
||||||
DbgPrint("Buffer too small (%ld), %ld,%ld\n",
|
DbgPrint("Buffer too small (%ld), %ld,%ld\n",
|
||||||
cjSize, ulPixWidth, ulPixHeight);
|
cjSize, ulPixWidth, ulPixHeight);
|
||||||
|
@ -157,11 +167,11 @@ BmfdQueryFontData(
|
||||||
|
|
||||||
DbgPrint("iFace=%ld, ulGlyphOffset=%lx, ulPixHeight=%ld, cjRow=%ld\n",
|
DbgPrint("iFace=%ld, ulGlyphOffset=%lx, ulPixHeight=%ld, cjRow=%ld\n",
|
||||||
pfo->iFace, ulGlyphOffset, ulPixHeight, cjRow);
|
pfo->iFace, ulGlyphOffset, ulPixHeight, cjRow);
|
||||||
DbgBreakPoint();
|
// DbgBreakPoint();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return the size of the bitmap buffer */
|
/* Return the size of the GLYPHBITS structure */
|
||||||
return ulPixHeight * cjRow;
|
return FIELD_OFFSET(GLYPHBITS, aj) + ulPixHeight * cjRow;
|
||||||
}
|
}
|
||||||
|
|
||||||
case QFD_MAXEXTENTS: /* 3 */
|
case QFD_MAXEXTENTS: /* 3 */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue