[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ft-devel] FT_Init_FreeType allocating memory before I get a chance
From: |
Werner LEMBERG |
Subject: |
Re: [ft-devel] FT_Init_FreeType allocating memory before I get a chance to set the allocators. |
Date: |
Wed, 24 Jun 2009 10:01:52 +0200 (CEST) |
> 1) We have our own struct that contains both the ft library and an
> FT_Memory object.
>
> 2) We initialize the fields in the FT_Memory object so that our
> callbacks are called.
>
> 3) We call FT_New_Library and tell it to use our memory object.
> This is the first FT2 API call.
>
> // Initialize freetype2
> lib->ft_memory.alloc = sf_FTalloc;
> lib->ft_memory.free = sf_FTfree;
> lib->ft_memory.realloc = sf_FTrealloc;
> lib->ft_memory.user = lib;
> ft_err = FT_New_Library( &lib->ft_memory, &lib->ft_lib );
I wonder whether this code from FT_Init_FreeType
(*alibrary)->version_major = FREETYPE_MAJOR;
(*alibrary)->version_minor = FREETYPE_MINOR;
(*alibrary)->version_patch = FREETYPE_PATCH;
should be moved to FT_New_Library to make FT_Library_Version more
generic.
I suppose that you don't call FT_Init_FreeType at all if using
FT_New_Library, right? Do you use FT_Add_Default_Modules to register
all modules or do you specify them directly with FT_Add_Modules?
Werner
- [ft-devel] FT_Init_FreeType allocating memory before I get a chance to set the allocators., Tom van Dijck, 2009/06/21
- Re: [ft-devel] FT_Init_FreeType allocating memory before I get a chance to set the allocators., Werner LEMBERG, 2009/06/21
- Message not available
- Re: [ft-devel] FT_Init_FreeType allocating memory before I get a chance to set the allocators., Werner LEMBERG, 2009/06/21
- Re: [ft-devel] FT_Init_FreeType allocating memory before I get a chance to set the allocators., Mickey Gabel, 2009/06/22
- Re: [ft-devel] FT_Init_FreeType allocating memory before I get a chance to set the allocators., Graham Asher, 2009/06/22
- Re: [ft-devel] FT_Init_FreeType allocating memory before I get a chance to set the allocators., Tom van Dijck, 2009/06/22
- Re: [ft-devel] FT_Init_FreeType allocating memory before I get a chance to set the allocators., Mickey Gabel, 2009/06/22
- Re: [ft-devel] FT_Init_FreeType allocating memory before I get a chance to set the allocators., Leon Woestenberg, 2009/06/23
- Re: [ft-devel] FT_Init_FreeType allocating memory before I get a chance to set the allocators.,
Werner LEMBERG <=
- Re: [ft-devel] FT_Init_FreeType allocating memory before I get a chance to set the allocators., Mickey Gabel, 2009/06/24
- Re: [ft-devel] FT_Init_FreeType allocating memory before I get a chance to set the allocators., Werner LEMBERG, 2009/06/25
- Re: [ft-devel] FT_Init_FreeType allocating memory before I get a chance to set the allocators., David Turner, 2009/06/22