Esempio n. 1
0
int hasFreeTypeByteCode(void) {
    static int complained = 0;

    if ( !hasFreeType())
return( false );

#if FREETYPE_MAJOR==2 && (FREETYPE_MINOR<3 || (FREETYPE_MINOR==3 && FREETYPE_PATCH<5))
/* The internal data structures of the bytecode interpreter changed in 2.3.5 */
/*  so we we were compliled before 2.3.5 and face a 2.3.5+ library then */
/*  we can't use the interpretter. Similarly if we were compiled after 2.3.5 */
/*  and face a less recent library we can't either */
/* Here we are compiled with an old library, so if the dynamic one is new we fail */
    if ( FreeTypeAtLeast(2,3,5)) {
	if ( !complained ) {
	    LogError(_("This version of FontForge expects freetype 2.3.4 or less."));
	    complained = true;
	}
return( false );
    }
#else
    if ( !FreeTypeAtLeast(2,3,5)) {
	if ( !complained ) {
	    LogError(_("This version of FontForge expects freetype 2.3.5 or more."));
	    complained = true;
	}
return( false );
    }
#endif

# ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
return( true );
# else
return( false );
# endif
}
Esempio n. 2
0
int hasFreeTypeByteCode(void) {
    static int complained = 0;

    if ( !hasFreeType())
return( false );

#if FREETYPE_MAJOR==2 && (FREETYPE_MINOR<3 || (FREETYPE_MINOR==3 && FREETYPE_PATCH<5))
/* The internal data structures of the bytecode interpreter changed in 2.3.5 */
/*  so we we were compliled before 2.3.5 and face a 2.3.5+ library then */
/*  we can't use the interpretter. Similarly if we were compiled after 2.3.5 */
/*  and face a less recent library we can't either */
/* Here we are compiled with an old library, so if the dynamic one is new we fail */
    if ( FreeTypeAtLeast(2,3,5)) {
	if ( !complained ) {
	    LogError(_("This version of FontForge expects freetype 2.3.4 or less."));
	    complained = true;
	}
return( false );
    }
#else
    if ( !FreeTypeAtLeast(2,3,5)) {
	if ( !complained ) {
	    LogError(_("This version of FontForge expects freetype 2.3.5 or more."));
	    complained = true;
	}
return( false );
    }
#endif

#if defined(_STATIC_LIBFREETYPE) || defined(NODYNAMIC)
    /* In a static library, we can assume our headers are accurate */
# ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
return( true );
# else
return( false );
# endif
#elif FREETYPE_HAS_DEBUGGER
    /* Have we already checked for these data? */
    if ( _FT_Set_Debug_Hook!=NULL && _TT_RunIns!=NULL )
return( true );
    else
return( false );
#else
    {
    static int found = -1;
    if ( found==-1 )
	found = dlsym(libfreetype,"TT_RunIns")!=NULL;
return( found );
    }
#endif
}
Esempio n. 3
0
int hasFreeTypeByteCode(void) {
    static int complained = 0;

    if ( !hasFreeType())
        return( false );

    if ( !FreeTypeAtLeast(2,3,7)) {
        if ( !complained ) {
            LogError(_("This version of FontForge expects freetype 2.3.7 or more."));
            complained = true;
        }
        return( false );
    }

# ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
    return( true );
# else
    return( false );
# endif
}