diff options
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | include/freetype/freetype.h | 35 | ||||
-rw-r--r-- | include/freetype/internal/ftobjs.h | 4 | ||||
-rw-r--r-- | src/base/ftinit.c | 6 | ||||
-rw-r--r-- | src/base/ftobjs.c | 31 |
5 files changed, 83 insertions, 1 deletions
@@ -1,5 +1,9 @@ 2002-03-06 David Turner <david@freetype.org> + * include/freetype/freetype.h, include/freetype/internal/ftobjs.h, + src/base/ftobjs.c, src/base/ftinit.c: adding the new FT_Library_Version + API to return the library's current version in dynamic links. + * src/README: updating for 2.0.9 release * src/pshinter/pshalgo2.c: changed 'print_zone' to 'psh2_print_zone' @@ -12,6 +16,10 @@ * src/autohint/ahhint.c, src/cache/ftcimage.c: removed compiler warnings (with Visual C++) + * src/type1/t1objs.c (T1_Face_Init), src/cid/cidobjs.c (CID_Face_Init): + fixed another bug related to the ascender/descender/text height of + Postscript fonts. Damn, this should have been fixed on 2002-03-04 ! + 2002-03-06 Werner Lemberg <wl@gnu.org> * src/pshinter/pshglob.h (PSH_DimensionRec): s/std/stdw/. diff --git a/include/freetype/freetype.h b/include/freetype/freetype.h index 230494ed4..6fa61da06 100644 --- a/include/freetype/freetype.h +++ b/include/freetype/freetype.h @@ -106,6 +106,7 @@ FT_BEGIN_HEADER /* */ /* FT_Init_FreeType */ /* FT_Done_FreeType */ + /* FT_Library_Version */ /* */ /* FT_New_Face */ /* FT_Done_Face */ @@ -1340,6 +1341,40 @@ FT_BEGIN_HEADER /*************************************************************************/ /* */ /* <Function> */ + /* FT_Library_Version */ + /* */ + /* <Description> */ + /* Return the version of the FreeType library being used. This */ + /* is useful when dynamically linking to the library, since one */ + /* cannot use the macros FT_FREETYPE_MAJOR, FT_FREETYPE_MINOR and */ + /* FT_FREETYPE_PATCH. */ + /* */ + /* <Input> */ + /* library :: source library handle. */ + /* */ + /* <Output> */ + /* amajor :: major version number */ + /* aminor :: minor version number */ + /* apatch :: patch version number */ + /* */ + /* <Note> */ + /* the reason why this function takes a 'library' argument is */ + /* because certain programs implement library initialisation in */ + /* a custom way that doesn't use FT_Init_FreeType. */ + /* */ + /* in certain such cases, the library version cannot be known until */ + /* the library object has been created.. */ + /* */ + FT_EXPORT( void ) + FT_Library_Version( FT_Library library, + FT_Int *amajor, + FT_Int *aminor, + FT_Int *apatch ); + + + /*************************************************************************/ + /* */ + /* <Function> */ /* FT_Done_FreeType */ /* */ /* <Description> */ diff --git a/include/freetype/internal/ftobjs.h b/include/freetype/internal/ftobjs.h index 31b79c0d1..cf107363a 100644 --- a/include/freetype/internal/ftobjs.h +++ b/include/freetype/internal/ftobjs.h @@ -609,6 +609,10 @@ FT_BEGIN_HEADER FT_Generic generic; + FT_Int version_major; + FT_Int version_minor; + FT_Int version_patch; + FT_UInt num_modules; FT_Module modules[FT_MAX_MODULES]; /* module objects */ diff --git a/src/base/ftinit.c b/src/base/ftinit.c index e2f809d23..b1e22d5f5 100644 --- a/src/base/ftinit.c +++ b/src/base/ftinit.c @@ -125,7 +125,13 @@ error = FT_New_Library( memory, alibrary ); if ( !error ) + { + (*alibrary)->version_major = FREETYPE_MAJOR; + (*alibrary)->version_minor = FREETYPE_MINOR; + (*alibrary)->version_patch = FREETYPE_PATCH; + FT_Add_Default_Modules( *alibrary ); + } return error; } diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c index c4de8f379..40b696bab 100644 --- a/src/base/ftobjs.c +++ b/src/base/ftobjs.c @@ -2671,7 +2671,7 @@ if ( ALLOC( library, sizeof ( *library ) ) ) return error; - library->memory = memory; + library->memory = memory; /* allocate the render pool */ library->raster_pool_size = FT_RENDER_POOL_SIZE; @@ -2689,6 +2689,35 @@ } + /* documentation is in freetype.h */ + FT_EXPORT_DEF( void ) + FT_Library_Version( FT_Library library, + FT_Int *amajor, + FT_Int *aminor, + FT_Int *apatch ) + { + FT_Int major = 0; + FT_Int minor = 0; + FT_Int patch = 0; + + if ( library ) + { + major = library->version_major; + minor = library->version_minor; + patch = library->version_patch; + } + + if ( *amajor ) + *amajor = major; + + if ( *aminor ) + *aminor = minor; + + if ( *apatch ) + *apatch = patch; + } + + /* documentation is in ftmodule.h */ FT_EXPORT_DEF( FT_Error ) |