40 #include FT_INTERNAL_DEBUG_H 57 #define FT_COMPONENT trace_cf2interp 61 #define CF2_FIXME FT_TRACE4(( "cf2_interpT2CharString:" \ 62 " operator not implemented yet\n" )) 72 hintmask->error =
error;
79 return hintmask->isValid;
86 return hintmask->isNew;
94 hintmask->isNew =
val;
104 return hintmask->mask;
147 if ( cf2_hintmask_setCounts( hintmask, bitCount ) == 0 )
155 for ( i = 0; i < hintmask->
byteCount; i++ )
182 if ( cf2_hintmask_setCounts( hintmask, bitCount ) == 0 )
191 hintmask->
mask[
i] = 0xFF;
290 FT_Bool hasWidthArg = count & 1;
296 for ( i = hasWidthArg ? 1 : 0; i <
count; i += 2 )
314 if ( hasWidthArg && ! *haveWidth )
330 FT_Bool doConditionalLastRead )
341 isHFlex = readFromStack[9] ==
FALSE;
342 top = isHFlex ? 9 : 10;
344 for ( i = 0; i <
top; i++ )
346 vals[i + 2] = vals[
i];
347 if ( readFromStack[i] )
354 if ( doConditionalLastRead )
363 vals[12] = vals[10] + lastVal;
369 vals[13] = vals[11] + lastVal;
374 if ( readFromStack[10] )
379 if ( readFromStack[11] )
385 for ( j = 0; j < 2; j++ )
435 CF2_Fixed scaleY = font->innerTransform.d;
525 lastError =
FT_THROW( Out_Of_Memory );
551 if ( charstringIndex )
564 if ( instructionLimit == 0 )
566 lastError =
FT_THROW( Invalid_Glyph_Format );
580 FT_TRACE4((
" unknown op (%d)\n", op1 ));
590 " invalid horizontal hint mask\n" ));
607 " invalid vertical hint mask\n" ));
638 for ( index = 0; index <
count; index += 2 )
659 FT_TRACE4(( isX ?
" hlineto\n" :
" vlineto\n" ));
661 for ( index = 0; index <
count; index++ )
690 while ( index + 6 <= count )
731 lastError =
FT_THROW( Invalid_Glyph_Format );
738 charstringIndex + 1 );
752 lastError =
FT_THROW( Invalid_Glyph_Format );
765 lastError =
FT_THROW( Invalid_Glyph_Format );
770 charstringIndex += 1;
777 if ( charstringIndex < 1 )
780 lastError =
FT_THROW( Invalid_Glyph_Format );
926 static const FT_Bool readFromStack[12] =
950 static const FT_Bool readFromStack[12] =
974 static const FT_Bool readFromStack[12] =
998 static const FT_Bool readFromStack[12] =
1011 cf2_doFlex( opStack,
1034 FT_TRACE4((
" unknown op (12, %d)\n", op2 ));
1070 lastError =
FT_THROW( Invalid_Glyph_Format );
1126 FT_TRACE4((
"cf2_interpT2CharString: invalid hint mask\n" ));
1139 cf2_hintmask_read( &hintMask,
1170 cf2_hintmask_read( &counterMask,
1218 while ( index + 6 < count )
1227 while ( index < count )
1256 while ( index < count )
1261 if ( ( count - index ) & 1 )
1295 while ( index < count )
1300 if ( ( count - index ) & 1 )
1335 FT_TRACE4(( alternate ?
" hvcurveto\n" :
" vhcurveto\n" ));
1337 while ( index < count )
1350 if ( count - index == 5 )
1369 if ( count - index == 5 )
1422 else if ( op1 <= 250 )
1439 else if ( op1 <= 254 )
1482 " charstring ends without ENDCHAR\n" ));
cf2_stack_popFixed(CF2_Stack stack)
cf2_freeSeacComponent(CFF_Decoder *decoder, CF2_Buffer buf)
cf2_stack_popInt(CF2_Stack stack)
FT_BEGIN_HEADER struct CF2_BufferRec_ CF2_BufferRec
cf2_hintmask_setAll(CF2_HintMask hintmask, size_t bitCount)
cf2_stack_init(FT_Memory memory, FT_Error *e)
cf2_hintmap_init(CF2_HintMap hintmap, CF2_Font font, CF2_HintMap initialMap, CF2_ArrStack hintMoves, CF2_Fixed scale)
return FT_THROW(Missing_Property)
cf2_stack_pushFixed(CF2_Stack stack, CF2_Fixed val)
cf2_glyphpath_curveTo(CF2_GlyphPath glyphpath, CF2_Fixed x1, CF2_Fixed y1, CF2_Fixed x2, CF2_Fixed y2, CF2_Fixed x3, CF2_Fixed y3)
GLint GLint GLsizei width
CF2_HintMapRec initialHintMap
cf2_initLocalRegionBuffer(CFF_Decoder *decoder, CF2_UInt idx, CF2_Buffer buf)
cf2_glyphpath_moveTo(CF2_GlyphPath glyphpath, CF2_Fixed x, CF2_Fixed y)
cf2_interpT2CharString(CF2_Font font, CF2_Buffer buf, CF2_OutlineCallbacks callbacks, const FT_Vector *translation, FT_Bool doingSeac, CF2_Fixed curX, CF2_Fixed curY, CF2_Fixed *width)
cf2_buf_readByte(CF2_Buffer buf)
cf2_getSeacComponent(CFF_Decoder *decoder, CF2_UInt code, CF2_Buffer buf)
cf2_arrstack_setCount(CF2_ArrStack arrstack, size_t numElements)
cf2_stack_count(CF2_Stack stack)
cf2_hintmask_getMaskPtr(CF2_HintMask hintmask)
FT_BEGIN_HEADER typedef unsigned char FT_Bool
GLenum GLuint GLenum GLsizei const GLchar * buf
#define FT_ASSERT(condition)
#define FT_TRACE4(varformat)
#define CF2_SET_ERROR(error, e)
cf2_glyphpath_lineTo(CF2_GlyphPath glyphpath, CF2_Fixed x, CF2_Fixed y)
cf2_arrstack_finalize(CF2_ArrStack arrstack)
cf2_stack_getReal(CF2_Stack stack, CF2_UInt idx)
cf2_arrstack_init(CF2_ArrStack arrstack, FT_Memory memory, FT_Error *error, size_t sizeItem)
cf2_arrstack_push(CF2_ArrStack arrstack, const void *ptr)
cf2_stack_clear(CF2_Stack stack)
cf2_stack_pushInt(CF2_Stack stack, CF2_Int val)
cf2_hintmask_isValid(const CF2_HintMask hintmask)
cf2_getDefaultWidthX(CFF_Decoder *decoder)
FT_BEGIN_HEADER struct CF2_ArrStackRec_ CF2_ArrStackRec
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_ArrStackRec hintMoves
cf2_glyphpath_finalize(CF2_GlyphPath glyphpath)
cf2_stack_free(CF2_Stack stack)
cf2_hintmask_setNew(CF2_HintMask hintmask, FT_Bool val)
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
cf2_glyphpath_closeOpenPath(CF2_GlyphPath glyphpath)
cf2_getNominalWidthX(CFF_Decoder *decoder)
cf2_hintmask_init(CF2_HintMask hintmask, FT_Error *error)
GLdouble GLdouble GLdouble GLdouble top
cf2_arrstack_getPointer(const CF2_ArrStack arrstack, size_t idx)
FT_Byte mask[(CF2_MAX_HINTS+7)/8]
cf2_arrstack_size(const CF2_ArrStack arrstack)
cf2_arrstack_getBuffer(const CF2_ArrStack arrstack)
GLuint GLuint GLsizei count
cf2_buf_isEnd(CF2_Buffer buf)
cf2_initGlobalRegionBuffer(CFF_Decoder *decoder, CF2_UInt idx, CF2_Buffer buf)
cf2_hintmask_isNew(const CF2_HintMask hintmask)
FT_BEGIN_HEADER struct CF2_ArrStackRec_ * CF2_ArrStack
cf2_hintmap_build(CF2_HintMap hintmap, CF2_ArrStack hStemHintArray, CF2_ArrStack vStemHintArray, CF2_HintMask hintMask, CF2_Fixed hintOrigin, FT_Bool initialMap)
FT_BEGIN_HEADER struct CF2_BufferRec_ * CF2_Buffer
cf2_setError(FT_Error *error, FT_Error value)