FDK/Tools/Programs/public/lib/source/cffwrite/cffwrite_t2cstr.c
/* Save hint/cntrmask op in tmp stream. */
Save hint/cntrmask op in tmp stream.
Save hint / cntrmask op in tmp stream .
static void saveHintMaskOp(cstrCtx h, unsigned char *map, 
						   int idsize, char *idmask, int op)
	{
	cfwCtx g = h->g;
	int i;
	char hintop[MAX_MASK_BYTES + 2];	
	char *hintmask = &hintop[1];
	hintop[0] = op;
	if (g->flags & CFW_SUBRIZE)
		*hintmask++ = h->masksize;
	memset(hintmask, 0, h->masksize);
	for (i = 0; i < idsize*8; i++)
		if (TEST_ID_BIT(idmask, i))
			SET_HINT_BIT(hintmask, map[i]);
	if (op == t2_hintmask)
		{
		if (memcmp(h->lastmask, hintmask, h->masksize) == 0)
			{
			if (!(g->flags & CFW_ENABLE_CMP_TEST))
				{
				addWarn(h, warn_hint1);
				return;
				}
			}
		memcpy(h->lastmask, hintmask, h->masksize);
		}
	if (g->flags & CFW_SUBRIZE)
		{
		char	sizebyte = h->masksize + 2;
		if ((g->cb.stm.write(&g->cb.stm, g->stm.tmp, 1, (char *)hintop) == 0)
			|| (g->cb.stm.write(&g->cb.stm, g->stm.tmp, 1, &sizebyte) == 0)
			|| (g->cb.stm.write(&g->cb.stm, g->stm.tmp, h->masksize, hintmask) == 0))
			g->err.code = cfwErrTmpStream;
		}
	else
		{
		if (g->cb.stm.write(&g->cb.stm, g->stm.tmp, 
							1 + h->masksize, (char *)hintop) == 0)
			g->err.code = cfwErrTmpStream;
		}
	if (op == t2_hintmask)
		checkOverlap(h, hintmask);
	}
static void saveHintMaskOp ( cstrCtx h , unsigned char * map , int idsize , char * idmask , int op ) { cfwCtx g = h -> g ; int i ; char hintop [ MAX_MASK_BYTES + 2 ] ; char * hintmask = & hintop [ 1 ] ; hintop [ 0 ] = op ; if ( g -> flags & CFW_SUBRIZE ) * hintmask ++ = h -> masksize ; memset ( hintmask , 0 , h -> masksize ) ; for ( i = 0 ; i < idsize * 8 ; i ++ ) if ( TEST_ID_BIT ( idmask , i ) ) SET_HINT_BIT ( hintmask , map [ i ] ) ; if ( op == t2_hintmask ) { if ( memcmp ( h -> lastmask , hintmask , h -> masksize ) == 0 ) { if ( ! ( g -> flags & CFW_ENABLE_CMP_TEST ) ) { addWarn ( h , warn_hint1 ) ; return ; } } memcpy ( h -> lastmask , hintmask , h -> masksize ) ; } if ( g -> flags & CFW_SUBRIZE ) { char sizebyte = h -> masksize + 2 ; if ( ( g -> cb . stm . write ( & g -> cb . stm , g -> stm . tmp , 1 , ( char * ) hintop ) == 0 ) || ( g -> cb . stm . write ( & g -> cb . stm , g -> stm . tmp , 1 , & sizebyte ) == 0 ) || ( g -> cb . stm . write ( & g -> cb . stm , g -> stm . tmp , h -> masksize , hintmask ) == 0 ) ) g -> err . code = cfwErrTmpStream ; } else { if ( g -> cb . stm . write ( & g -> cb . stm , g -> stm . tmp , 1 + h -> masksize , ( char * ) hintop ) == 0 ) g -> err . code = cfwErrTmpStream ; } if ( op == t2_hintmask ) checkOverlap ( h , hintmask ) ; }
Save hint/cntrmask op in tmp stream.
Save hint / cntrmask op in tmp stream .
/* One extra length byte consumed by subroutinizer */ /* Add length byte for subroutinizer */ /* Construct hintmask from stem ids */ /* This hintmask is a duplicate of the initial mask or is a
				   duplicate of the last hintmask. Normally we can remove it
				   without causing rendering differences between the source
				   font and the converted font, but if all the hintmasks are
				   duplicates of the initial mask the rendering behavior can
				   change because this causes fixupmap code to be executed by
				   the render, hence the above test. */ /* Save mask */ /* Save mask op size in second byte for subroutinizer */ /* Counter masks (counter control list) aren't checked because it yields
	   too many warnings due to stem merging and integerization of list */