40#include FT_INTERNAL_DEBUG_H
55#define FT_COMPONENT cf2hints
136 else if (
width < 0 )
192 hint->index = indexStemHint;
195 if (
hint->flags != 0 && stemHint->
used )
283 hintmap->hinted =
font->hinted;
284 hintmap->scale =
scale;
285 hintmap->font =
font;
286 hintmap->initialHintMap = initialMap;
288 hintmap->hintMoves = hintMoves;
302#ifdef FT_DEBUG_LEVEL_TRACE
306 FT_TRACE6((
" index csCoord dsCoord scale flags\n" ));
308 for (
i = 0;
i < hintmap->
count;
i++ )
313 FT_TRACE6((
" %3d %7.2f %7.2f %5d %s%s%s%s\n",
315 hint->csCoord / 65536.0,
316 hint->dsCoord / (
hint->scale * 1.0 ),
348 while ( i < hintmap->
count - 1 &&
353 while (
i > 0 && csCoord < hintmap->edge[
i].csCoord )
358 if (
i == 0 && csCoord < hintmap->edge[0].csCoord )
411 for (
i = 0;
i < hintmap->
count;
i++ )
417 j = isPair ?
i + 1 :
i;
462 if (
j >= hintmap->
count - 1 ||
470 if (
j >= hintmap->
count - 1 ||
473 moveUp + upMinCounter ) )
479 moveDown - downMinCounter ) )
482 move = ( -moveDown < moveUp ) ? moveDown : moveUp;
493 moveDown - downMinCounter ) )
497 saveEdge =
FT_BOOL( moveUp < -moveDown );
513 j < hintmap->
count - 1 &&
521 savedMove.
moveUp = moveUp - move;
607 CF2_Hint firstHintEdge = bottomHintEdge;
608 CF2_Hint secondHintEdge = topHintEdge;
620 firstHintEdge = topHintEdge;
636 for ( ; indexInsert < hintmap->
count; indexInsert++ )
642 FT_TRACE7((
" Got hint at %.2f (%.2f)\n",
643 firstHintEdge->
csCoord / 65536.0,
644 firstHintEdge->
dsCoord / 65536.0 ));
646 FT_TRACE7((
" Got hint at %.2f (%.2f)\n",
647 secondHintEdge->
csCoord / 65536.0,
648 secondHintEdge->
dsCoord / 65536.0 ));
661 if ( indexInsert < hintmap->
count )
690 firstHintEdge->
csCoord ) / 2 );
726 if ( indexInsert > 0 )
733 if ( indexInsert < hintmap->
count )
758 FT_TRACE4((
"cf2_hintmap_insertHint: too many hintmaps\n" ));
763 hintmap->
edge[iDst--] = hintmap->
edge[iSrc--];
766 hintmap->
edge[indexInsert] = *firstHintEdge;
769 FT_TRACE7((
" Inserting hint %.2f (%.2f)\n",
770 firstHintEdge->
csCoord / 65536.0,
771 firstHintEdge->
dsCoord / 65536.0 ));
776 hintmap->
edge[indexInsert + 1] = *secondHintEdge;
779 FT_TRACE7((
" Inserting hint %.2f (%.2f)\n",
780 secondHintEdge->
csCoord / 65536.0,
781 secondHintEdge->
dsCoord / 65536.0 ));
847 hintmap->hinted =
FALSE;
855 hintmap->lastIndex = 0;
858 tempHintMask = *hintMask;
865 if ( bitCount > hintMask->bitCount )
869 if (
font->blues.doEmBoxHints )
878 &
font->blues.emBoxBottomEdge,
883 &
font->blues.emBoxTopEdge );
888 for (
i = 0, maskByte = 0x80;
i < bitCount;
i++ )
890 if ( maskByte & *maskPtr )
920 *maskPtr &= ~maskByte;
924 if ( (
i & 7 ) == 7 )
962 if ( hintmap->count == 0 ||
963 hintmap->edge[0].csCoord > 0 ||
964 hintmap->edge[hintmap->count - 1].csCoord < 0 )
977 edge.
scale = hintmap->scale;
989 for (
i = 0, maskByte = 0x80;
i < bitCount;
i++ )
991 if ( maskByte & *maskPtr )
1014 if ( (
i & 7 ) == 7 )
1025 FT_TRACE6((
"%s\n", initialMap ?
"flags: [p]air [g]host [t]op"
1026 " [b]ottom [L]ocked [S]ynthetic\n"
1050 for (
i = 0;
i < hintmap->count;
i++ )
1058 hintmap->edge[
i].index );
1062 stemhint->
maxDS = hintmap->edge[
i].dsCoord;
1064 stemhint->
minDS = hintmap->edge[
i].dsCoord;
1072 hintmap->isValid =
TRUE;
1094 glyphpath->font =
font;
1104 &glyphpath->initialHintMap,
1105 &glyphpath->hintMoves,
1109 &glyphpath->initialHintMap,
1110 &glyphpath->hintMoves,
1114 &glyphpath->initialHintMap,
1115 &glyphpath->hintMoves,
1118 glyphpath->scaleX =
font->innerTransform.a;
1119 glyphpath->scaleC =
font->innerTransform.c;
1120 glyphpath->scaleY =
font->innerTransform.d;
1122 glyphpath->fractionalTranslation = *fractionalTranslation;
1125 glyphpath->hShift = hShift;
1128 glyphpath->hStemHintArray = hStemHintArray;
1129 glyphpath->vStemHintArray = vStemHintArray;
1130 glyphpath->hintMask = hintMask;
1131 glyphpath->hintOriginY = hintOriginY;
1132 glyphpath->blues = blues;
1133 glyphpath->darken =
font->darkened;
1134 glyphpath->xOffset =
font->darkenX;
1135 glyphpath->yOffset =
font->darkenY;
1136 glyphpath->miterLimit = 2 *
FT_MAX(
1143 glyphpath->moveIsPending =
TRUE;
1144 glyphpath->pathIsOpen =
FALSE;
1145 glyphpath->pathIsClosing =
FALSE;
1146 glyphpath->elemIsQueued =
FALSE;
1225#define cf2_perp( a, b ) \
1226 ( FT_MulFix( a.x, b.y ) - FT_MulFix( a.y, b.x ) )
1229#define CF2_CS_SCALE( x ) \
1230 ( ( (x) + 0x10 ) >> 5 )
1245 if ( denominator == 0 )
1265 if (
u1->x ==
u2->x &&
1268 intersection->
x =
u1->x;
1269 if (
u1->y ==
u2->y &&
1272 intersection->
y =
u1->y;
1274 if (
v1->x ==
v2->x &&
1277 intersection->
x =
v1->x;
1278 if (
v1->y ==
v2->y &&
1281 intersection->
y =
v1->y;
1350 if ( prevP1->
x != nextP0->
x || prevP1->
y != nextP0->
y )
1360 if ( useIntersection )
1364 *prevP1 = intersection;
1431 if ( !useIntersection ||
close )
1471 if ( useIntersection )
1474 *nextP0 = intersection;
1549 if ( !glyphpath->
darken )
1687 glyphpath->currentCS.x = glyphpath->start.x =
x;
1688 glyphpath->currentCS.y = glyphpath->start.y =
y;
1690 glyphpath->moveIsPending =
TRUE;
1696 glyphpath->hStemHintArray,
1697 glyphpath->vStemHintArray,
1698 glyphpath->hintMask,
1699 glyphpath->hintOriginY,
1703 glyphpath->firstHintMap = glyphpath->hintMap;
1725 !glyphpath->pathIsClosing;
1744 if ( glyphpath->currentCS.x ==
x &&
1745 glyphpath->currentCS.y ==
y &&
1757 glyphpath->currentCS.x,
1758 glyphpath->currentCS.y,
1770 if ( glyphpath->moveIsPending )
1775 glyphpath->moveIsPending =
FALSE;
1776 glyphpath->pathIsOpen =
TRUE;
1778 glyphpath->offsetStart1 = P1;
1781 if ( glyphpath->elemIsQueued )
1784 glyphpath->hintMap.count == 0 );
1787 &glyphpath->hintMap,
1794 glyphpath->elemIsQueued =
TRUE;
1796 glyphpath->prevElemP0 = P0;
1797 glyphpath->prevElemP1 = P1;
1802 glyphpath->hStemHintArray,
1803 glyphpath->vStemHintArray,
1804 glyphpath->hintMask,
1805 glyphpath->hintOriginY,
1808 glyphpath->currentCS.x =
x;
1809 glyphpath->currentCS.y =
y;
1822 CF2_Fixed xOffset1, yOffset1, xOffset3, yOffset3;
1828 glyphpath->currentCS.x,
1829 glyphpath->currentCS.y,
1843 glyphpath->callbacks->windingMomentum =
1844 ADD_INT32( glyphpath->callbacks->windingMomentum,
1848 P0.
x =
ADD_INT32( glyphpath->currentCS.x, xOffset1 );
1849 P0.
y =
ADD_INT32( glyphpath->currentCS.y, yOffset1 );
1858 if ( glyphpath->moveIsPending )
1863 glyphpath->moveIsPending =
FALSE;
1864 glyphpath->pathIsOpen =
TRUE;
1866 glyphpath->offsetStart1 = P1;
1869 if ( glyphpath->elemIsQueued )
1872 glyphpath->hintMap.count == 0 );
1875 &glyphpath->hintMap,
1882 glyphpath->elemIsQueued =
TRUE;
1884 glyphpath->prevElemP0 = P0;
1885 glyphpath->prevElemP1 = P1;
1886 glyphpath->prevElemP2 = P2;
1887 glyphpath->prevElemP3 = P3;
1892 glyphpath->hStemHintArray,
1893 glyphpath->vStemHintArray,
1894 glyphpath->hintMask,
1895 glyphpath->hintOriginY,
1898 glyphpath->currentCS.x = x3;
1899 glyphpath->currentCS.y = y3;
1906 if ( glyphpath->pathIsOpen )
1913 glyphpath->pathIsClosing =
TRUE;
1917 glyphpath->start.y );
1920 if ( glyphpath->elemIsQueued )
1922 &glyphpath->hintMap,
1923 &glyphpath->offsetStart0,
1924 glyphpath->offsetStart1,
1928 glyphpath->moveIsPending =
TRUE;
1929 glyphpath->pathIsOpen =
FALSE;
1930 glyphpath->pathIsClosing =
FALSE;
1931 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
GLuint GLuint GLsizei count
GLint GLint GLint GLint GLint GLint y
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