FDK/Tools/Programs/public/lib/source/cffwrite/cffwrite_t2cstr.c
/* Add stem to list. Return stem id. */
Add stem to list. Return stem id.
Add stem to list . Return stem id .
static unsigned char addStem(cstrCtx h, int flags, float edge0, float edge1)
	{
	int found;
	size_t index;
	Stem new;
	Stem *stem;
#if PLAT_WIN || PLAT_LINUX
	volatile float delta;
#else
	float delta;
#endif
	delta = edge1 - edge0;
	if (delta < 0 && delta != ABF_EDGE_HINT_LO && delta != ABF_EDGE_HINT_HI)
		{
		addWarn(h, warn_hint0);
		new.edge0 = edge1;
		new.edge1 = edge0;
		}
	else 
		{
		new.edge0 = edge0;
		new.edge1 = edge1;
		}
	new.flags = (flags & ABF_VERT_STEM)? STEM_VERT: 0;
	if (flags & ABF_CNTR_STEM)
		new.flags |= STEM_CNTR;
	found = ctuLookup(&new, h->stems.array, h->stems.cnt, sizeof(Stem),
					  matchStems, &index, NULL);
	stem = &h->stems.array[index];
	if (!found)
		{
		if (!(h->g->flags & CFW_ENABLE_CMP_TEST) &&
			(h->flags & SEEN_CNTR) && !(flags & ABF_CNTR_STEM) && 
			h->stems.cnt != (int)index)
			{
			if (approxMatch(&new, stem))
				return stem->id;
			if (index > 0 && approxMatch(&new, stem - 1))
				return (stem - 1)->id;
			}
		if (h->stems.cnt == T2_MAX_STEMS)
			addWarn(h, warn_hint3);
		else
			{
			memmove(stem + 1, stem, (h->stems.cnt - index)*sizeof(Stem));
			new.id = h->stems.cnt++;
			*stem = new;
			}
		}
	return stem->id;
	}
static unsigned char addStem ( cstrCtx h , int flags , float edge0 , float edge1 ) { int found ; size_t index ; Stem new ; Stem * stem ; #if PLAT_WIN || PLAT_LINUX volatile float delta ; #else float delta ; #endif delta = edge1 - edge0 ; if ( delta < 0 && delta != ABF_EDGE_HINT_LO && delta != ABF_EDGE_HINT_HI ) { addWarn ( h , warn_hint0 ) ; new . edge0 = edge1 ; new . edge1 = edge0 ; } else { new . edge0 = edge0 ; new . edge1 = edge1 ; } new . flags = ( flags & ABF_VERT_STEM ) ? STEM_VERT : 0 ; if ( flags & ABF_CNTR_STEM ) new . flags |= STEM_CNTR ; found = ctuLookup ( & new , h -> stems . array , h -> stems . cnt , sizeof ( Stem ) , matchStems , & index , NULL ) ; stem = & h -> stems . array [ index ] ; if ( ! found ) { if ( ! ( h -> g -> flags & CFW_ENABLE_CMP_TEST ) && ( h -> flags & SEEN_CNTR ) && ! ( flags & ABF_CNTR_STEM ) && h -> stems . cnt != ( int ) index ) { if ( approxMatch ( & new , stem ) ) return stem -> id ; if ( index > 0 && approxMatch ( & new , stem - 1 ) ) return ( stem - 1 ) -> id ; } if ( h -> stems . cnt == T2_MAX_STEMS ) addWarn ( h , warn_hint3 ) ; else { memmove ( stem + 1 , stem , ( h -> stems . cnt - index ) * sizeof ( Stem ) ) ; new . id = h -> stems . cnt ++ ; * stem = new ; } } return stem -> id ; }
Add stem to list.
Add stem to list .
/* On the Pentium architecture in an optimized build, float variables
	   are kept in 80-bit registers which is more precision than is needed and
	   in fact causes the comparisons against the ABF_EDGE_HINT_LO and
	   ABF_EDGE_HINT_HI integers to fail. The "voilatile" qualifier forces
	   intermediate stores and loads which circumvents this problem. */ /* Check if stem already in list */ /* We are trying to match a stem against a stem list containing
			   global coloring data. The global coloring stems can have a
			   2-unit error on each edge so we have to perform approximate
			   match. This is the correct conversion behavior but can cause
			   rendering differences between the source font and the converted
			   font so we disable this if are trying to compare bitmaps. */ /* New stem */ /* Insert new stem in list */