40#include FT_INTERNAL_DEBUG_H
55#define FT_COMPONENT trace_cf2hints
136 else if (
width < 0 )
192 hint->index = indexStemHint;
195 if (
hint->flags != 0 && stemHint->
used )
286 hintmap->hinted =
font->hinted;
287 hintmap->scale =
scale;
288 hintmap->font =
font;
289 hintmap->initialHintMap = initialMap;
291 hintmap->hintMoves = hintMoves;
305#ifdef FT_DEBUG_LEVEL_TRACE
309 FT_TRACE6((
" index csCoord dsCoord scale flags\n" ));
311 for (
i = 0;
i < hintmap->
count;
i++ )
316 FT_TRACE6((
" %3d %7.2f %7.2f %5d %s%s%s%s\n",
318 hint->csCoord / 65536.0,
319 hint->dsCoord / (
hint->scale * 1.0 ),
351 while ( i < hintmap->
count - 1 &&
356 while (
i > 0 && csCoord < hintmap->edge[
i].csCoord )
361 if (
i == 0 && csCoord < hintmap->edge[0].csCoord )
414 for (
i = 0;
i < hintmap->
count;
i++ )
420 j = isPair ?
i + 1 :
i;
465 if (
j >= hintmap->
count - 1 ||
473 if (
j >= hintmap->
count - 1 ||
476 moveUp + upMinCounter ) )
482 moveDown - downMinCounter ) )
485 move = ( -moveDown < moveUp ) ? moveDown : moveUp;
496 moveDown - downMinCounter ) )
500 saveEdge = (
FT_Bool)( moveUp < -moveDown );
516 j < hintmap->
count - 1 &&
524 savedMove.
moveUp = moveUp - move;
610 CF2_Hint firstHintEdge = bottomHintEdge;
611 CF2_Hint secondHintEdge = topHintEdge;
623 firstHintEdge = topHintEdge;
639 for ( ; indexInsert < hintmap->
count; indexInsert++ )
645 FT_TRACE7((
" Got hint at %.2f (%.2f)\n",
646 firstHintEdge->
csCoord / 65536.0,
647 firstHintEdge->
dsCoord / 65536.0 ));
649 FT_TRACE7((
" Got hint at %.2f (%.2f)\n",
650 secondHintEdge->
csCoord / 65536.0,
651 secondHintEdge->
dsCoord / 65536.0 ));
664 if ( indexInsert < hintmap->
count )
693 firstHintEdge->
csCoord ) / 2 );
729 if ( indexInsert > 0 )
736 if ( indexInsert < hintmap->
count )
761 FT_TRACE4((
"cf2_hintmap_insertHint: too many hintmaps\n" ));
766 hintmap->
edge[iDst--] = hintmap->
edge[iSrc--];
769 hintmap->
edge[indexInsert] = *firstHintEdge;
772 FT_TRACE7((
" Inserting hint %.2f (%.2f)\n",
773 firstHintEdge->
csCoord / 65536.0,
774 firstHintEdge->
dsCoord / 65536.0 ));
779 hintmap->
edge[indexInsert + 1] = *secondHintEdge;
782 FT_TRACE7((
" Inserting hint %.2f (%.2f)\n",
783 secondHintEdge->
csCoord / 65536.0,
784 secondHintEdge->
dsCoord / 65536.0 ));
850 hintmap->hinted =
FALSE;
858 hintmap->lastIndex = 0;
861 tempHintMask = *hintMask;
868 if ( bitCount > hintMask->bitCount )
872 if (
font->blues.doEmBoxHints )
881 &
font->blues.emBoxBottomEdge,
886 &
font->blues.emBoxTopEdge );
891 for (
i = 0, maskByte = 0x80;
i < bitCount;
i++ )
893 if ( maskByte & *maskPtr )
923 *maskPtr &= ~maskByte;
927 if ( (
i & 7 ) == 7 )
965 if ( hintmap->count == 0 ||
966 hintmap->edge[0].csCoord > 0 ||
967 hintmap->edge[hintmap->count - 1].csCoord < 0 )
980 edge.
scale = hintmap->scale;
992 for (
i = 0, maskByte = 0x80;
i < bitCount;
i++ )
994 if ( maskByte & *maskPtr )
1017 if ( (
i & 7 ) == 7 )
1028 FT_TRACE6(( initialMap ?
"flags: [p]air [g]host [t]op "
1029 "[b]ottom [L]ocked [S]ynthetic\n"
1053 for (
i = 0;
i < hintmap->count;
i++ )
1061 hintmap->edge[
i].index );
1065 stemhint->
maxDS = hintmap->edge[
i].dsCoord;
1067 stemhint->
minDS = hintmap->edge[
i].dsCoord;
1075 hintmap->isValid =
TRUE;
1097 glyphpath->font =
font;
1107 &glyphpath->initialHintMap,
1108 &glyphpath->hintMoves,
1112 &glyphpath->initialHintMap,
1113 &glyphpath->hintMoves,
1117 &glyphpath->initialHintMap,
1118 &glyphpath->hintMoves,
1121 glyphpath->scaleX =
font->innerTransform.a;
1122 glyphpath->scaleC =
font->innerTransform.c;
1123 glyphpath->scaleY =
font->innerTransform.d;
1125 glyphpath->fractionalTranslation = *fractionalTranslation;
1128 glyphpath->hShift = hShift;
1131 glyphpath->hStemHintArray = hStemHintArray;
1132 glyphpath->vStemHintArray = vStemHintArray;
1133 glyphpath->hintMask = hintMask;
1134 glyphpath->hintOriginY = hintOriginY;
1135 glyphpath->blues = blues;
1136 glyphpath->darken =
font->darkened;
1137 glyphpath->xOffset =
font->darkenX;
1138 glyphpath->yOffset =
font->darkenY;
1139 glyphpath->miterLimit = 2 *
FT_MAX(
1146 glyphpath->moveIsPending =
TRUE;
1147 glyphpath->pathIsOpen =
FALSE;
1148 glyphpath->pathIsClosing =
FALSE;
1149 glyphpath->elemIsQueued =
FALSE;
1228#define cf2_perp( a, b ) \
1229 ( FT_MulFix( a.x, b.y ) - FT_MulFix( a.y, b.x ) )
1232#define CF2_CS_SCALE( x ) \
1233 ( ( (x) + 0x10 ) >> 5 )
1248 if ( denominator == 0 )
1268 if (
u1->x ==
u2->x &&
1271 intersection->
x =
u1->x;
1272 if (
u1->y ==
u2->y &&
1275 intersection->
y =
u1->y;
1277 if (
v1->x ==
v2->x &&
1280 intersection->
x =
v1->x;
1281 if (
v1->y ==
v2->y &&
1284 intersection->
y =
v1->y;
1353 if ( prevP1->
x != nextP0->
x || prevP1->
y != nextP0->
y )
1363 if ( useIntersection )
1367 *prevP1 = intersection;
1434 if ( !useIntersection ||
close )
1474 if ( useIntersection )
1477 *nextP0 = intersection;
1552 if ( !glyphpath->
darken )
1690 glyphpath->currentCS.x = glyphpath->start.x =
x;
1691 glyphpath->currentCS.y = glyphpath->start.y =
y;
1693 glyphpath->moveIsPending =
TRUE;
1699 glyphpath->hStemHintArray,
1700 glyphpath->vStemHintArray,
1701 glyphpath->hintMask,
1702 glyphpath->hintOriginY,
1706 glyphpath->firstHintMap = glyphpath->hintMap;
1728 !glyphpath->pathIsClosing;
1747 if ( glyphpath->currentCS.x ==
x &&
1748 glyphpath->currentCS.y ==
y &&
1760 glyphpath->currentCS.x,
1761 glyphpath->currentCS.y,
1773 if ( glyphpath->moveIsPending )
1778 glyphpath->moveIsPending =
FALSE;
1779 glyphpath->pathIsOpen =
TRUE;
1781 glyphpath->offsetStart1 = P1;
1784 if ( glyphpath->elemIsQueued )
1787 glyphpath->hintMap.count == 0 );
1790 &glyphpath->hintMap,
1797 glyphpath->elemIsQueued =
TRUE;
1799 glyphpath->prevElemP0 = P0;
1800 glyphpath->prevElemP1 = P1;
1805 glyphpath->hStemHintArray,
1806 glyphpath->vStemHintArray,
1807 glyphpath->hintMask,
1808 glyphpath->hintOriginY,
1811 glyphpath->currentCS.x =
x;
1812 glyphpath->currentCS.y =
y;
1825 CF2_Fixed xOffset1, yOffset1, xOffset3, yOffset3;
1831 glyphpath->currentCS.x,
1832 glyphpath->currentCS.y,
1846 glyphpath->callbacks->windingMomentum =
1847 ADD_INT32( glyphpath->callbacks->windingMomentum,
1851 P0.
x =
ADD_INT32( glyphpath->currentCS.x, xOffset1 );
1852 P0.
y =
ADD_INT32( glyphpath->currentCS.y, yOffset1 );
1861 if ( glyphpath->moveIsPending )
1866 glyphpath->moveIsPending =
FALSE;
1867 glyphpath->pathIsOpen =
TRUE;
1869 glyphpath->offsetStart1 = P1;
1872 if ( glyphpath->elemIsQueued )
1875 glyphpath->hintMap.count == 0 );
1878 &glyphpath->hintMap,
1885 glyphpath->elemIsQueued =
TRUE;
1887 glyphpath->prevElemP0 = P0;
1888 glyphpath->prevElemP1 = P1;
1889 glyphpath->prevElemP2 = P2;
1890 glyphpath->prevElemP3 = P3;
1895 glyphpath->hStemHintArray,
1896 glyphpath->vStemHintArray,
1897 glyphpath->hintMask,
1898 glyphpath->hintOriginY,
1901 glyphpath->currentCS.x = x3;
1902 glyphpath->currentCS.y = y3;
1909 if ( glyphpath->pathIsOpen )
1916 glyphpath->pathIsClosing =
TRUE;
1920 glyphpath->start.y );
1923 if ( glyphpath->elemIsQueued )
1925 &glyphpath->hintMap,
1926 &glyphpath->offsetStart0,
1927 glyphpath->offsetStart1,
1931 glyphpath->moveIsPending =
TRUE;
1932 glyphpath->pathIsOpen =
FALSE;
1933 glyphpath->pathIsClosing =
FALSE;
1934 glyphpath->elemIsQueued =
FALSE;
FT_DivFix(FT_Long a, FT_Long b)
FT_MulFix(FT_Long a, FT_Long b)
#define FT_ASSERT(condition)
#define FT_TRACE7(varformat)
#define FT_TRACE6(varformat)
#define FT_TRACE4(varformat)
FT_BEGIN_HEADER typedef unsigned char FT_Bool
GLint GLint GLint GLint GLint x
GLint GLint GLint GLint GLint GLint y
GLuint GLuint GLsizei count
GLint GLint GLsizei width
GLenum GLenum GLenum GLenum GLenum scale
GLenum const GLfloat * params
GLfloat GLfloat GLfloat v2
GLubyte GLubyte GLubyte GLubyte w
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
static const WCHAR invalid[]
cf2_arrstack_getPointer(const CF2_ArrStack arrstack, size_t idx)
cf2_arrstack_push(CF2_ArrStack arrstack, const void *ptr)
cf2_arrstack_finalize(CF2_ArrStack arrstack)
cf2_arrstack_init(CF2_ArrStack arrstack, FT_Memory memory, FT_Error *error, size_t sizeItem)
cf2_arrstack_clear(CF2_ArrStack arrstack)
cf2_arrstack_size(const CF2_ArrStack arrstack)
FT_BEGIN_HEADER struct CF2_ArrStackRec_ * CF2_ArrStack
cf2_blues_capture(const CF2_Blues blues, CF2_Hint bottomHintEdge, CF2_Hint topHintEdge)
#define cf2_intToFixed(i)
#define cf2_doubleToFixed(f)
#define cf2_fixedFraction(x)
static FT_Bool cf2_hint_isLocked(const CF2_Hint hint)
cf2_hint_isBottom(const CF2_Hint hint)
cf2_glyphpath_moveTo(CF2_GlyphPath glyphpath, CF2_Fixed x, CF2_Fixed y)
static void cf2_glyphpath_pushMove(CF2_GlyphPath glyphpath, FT_Vector start)
cf2_hint_isTop(const CF2_Hint hint)
cf2_glyphpath_finalize(CF2_GlyphPath glyphpath)
static FT_Bool cf2_hint_isSynthetic(const CF2_Hint hint)
cf2_hintmap_build(CF2_HintMap hintmap, CF2_ArrStack hStemHintArray, CF2_ArrStack vStemHintArray, CF2_HintMask hintMask, CF2_Fixed hintOrigin, FT_Bool initialMap)
cf2_glyphpath_curveTo(CF2_GlyphPath glyphpath, CF2_Fixed x1, CF2_Fixed y1, CF2_Fixed x2, CF2_Fixed y2, CF2_Fixed x3, CF2_Fixed y3)
static CF2_Fixed cf2_hintmap_map(CF2_HintMap hintmap, CF2_Fixed csCoord)
static void cf2_hintmap_adjustHints(CF2_HintMap hintmap)
cf2_glyphpath_closeOpenPath(CF2_GlyphPath glyphpath)
struct CF2_HintMoveRec_ CF2_HintMoveRec
struct CF2_HintMoveRec_ * CF2_HintMove
static void cf2_glyphpath_hintPoint(CF2_GlyphPath glyphpath, CF2_HintMap hintmap, FT_Vector *ppt, CF2_Fixed x, CF2_Fixed y)
cf2_glyphpath_lineTo(CF2_GlyphPath glyphpath, CF2_Fixed x, CF2_Fixed y)
static void cf2_hint_init(CF2_Hint hint, const CF2_ArrStack stemHintArray, size_t indexStemHint, const CF2_Font font, CF2_Fixed hintOrigin, CF2_Fixed scale, FT_Bool bottom)
static FT_Bool cf2_glyphpath_computeIntersection(CF2_GlyphPath glyphpath, const FT_Vector *u1, const FT_Vector *u2, const FT_Vector *v1, const FT_Vector *v2, FT_Vector *intersection)
static void cf2_hintmap_dump(CF2_HintMap hintmap)
cf2_hint_lock(CF2_Hint hint)
static FT_Bool cf2_hintmap_isValid(const CF2_HintMap hintmap)
static FT_Bool cf2_hint_isPairTop(const CF2_Hint hint)
cf2_hint_isValid(const CF2_Hint hint)
static void cf2_hint_initZero(CF2_Hint hint)
cf2_hintmap_init(CF2_HintMap hintmap, CF2_Font font, CF2_HintMap initialMap, CF2_ArrStack hintMoves, CF2_Fixed scale)
static void cf2_glyphpath_computeOffset(CF2_GlyphPath glyphpath, CF2_Fixed x1, CF2_Fixed y1, CF2_Fixed x2, CF2_Fixed y2, CF2_Fixed *x, CF2_Fixed *y)
static void cf2_hintmap_insertHint(CF2_HintMap hintmap, CF2_Hint bottomHintEdge, CF2_Hint topHintEdge)
static FT_Bool cf2_hint_isPair(const CF2_Hint hint)
static CF2_Int cf2_getWindingMomentum(CF2_Fixed x1, CF2_Fixed y1, CF2_Fixed x2, CF2_Fixed y2)
static void cf2_glyphpath_pushPrevElem(CF2_GlyphPath glyphpath, CF2_HintMap hintmap, FT_Vector *nextP0, FT_Vector nextP1, FT_Bool close)
cf2_glyphpath_init(CF2_GlyphPath glyphpath, CF2_Font font, CF2_OutlineCallbacks callbacks, CF2_Fixed scaleY, CF2_ArrStack hStemHintArray, CF2_ArrStack vStemHintArray, CF2_HintMask hintMask, CF2_Fixed hintOriginY, const CF2_Blues blues, const FT_Vector *fractionalTranslation)
cf2_hintmask_isNew(const CF2_HintMask hintmask)
cf2_hintmask_getMaskPtr(CF2_HintMask hintmask)
cf2_hintmask_setAll(CF2_HintMask hintmask, size_t bitCount)
cf2_hintmask_isValid(const CF2_HintMask hintmask)
cf2_hintmask_init(CF2_HintMask hintmask, FT_Error *error)
cf2_hintmask_setNew(CF2_HintMask hintmask, FT_Bool val)
struct CF2_StemHintRec_ * CF2_StemHint
CF2_Matrix outerTransform
CF2_HintMapRec firstHintMap
CF2_OutlineCallbacks callbacks
FT_Vector fractionalTranslation
struct CF2_HintMapRec_ * initialHintMap
CF2_HintRec edge[CF2_MAX_HINT_EDGES]
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG x2
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG y1
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG _In_ LONG y2
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList