MathewWi / freetype-gl

Automatically exported from code.google.com/p/freetype-gl
Other
0 stars 0 forks source link

(Enhancement) Loading font directly from Memory #33

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

To integrate freetype-gl in my software, i need to create font directly from 
memory.
So, i customize the library by adding to fields in texture_font_t :   

    const void * memfont;
    unsigned int memfontSize;

and change the texture_font_new prototype by : 

texture_font_t * texture_font_new( texture_atlas_t * atlas,
                    const char * filename,
                    const void * memfont,
                    unsigned int memfontSize,
                    const float size );

passing 0 to filename or (memfont and memfont size)

So, i had to customize 
   . some asserts => assert (filename) changed with (assert (filename || memfonSize)
   . and the texture_font_load_face core function. (see attachement)

Original issue reported on code.google.com by franck.c...@gmail.com on 25 Jul 2012 at 10:51

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks and sorry for the long delay in my answer.

 It was a feature wanted by a a lot of users, I'll look into your code and integrate it.
Maybe it would be best to have two distinct function for texture font creation 
(one from file and and one from memory).

Original comment by Nicolas.Rougier@gmail.com on 14 Nov 2012 at 8:31

GoogleCodeExporter commented 9 years ago
I second this request.  I had to manually implement it the same way as the op.

Original comment by shinhals...@gmail.com on 22 May 2013 at 2:39

GoogleCodeExporter commented 9 years ago
For the same reason this also makes font-manager unusable without modification.

Original comment by shinhals...@gmail.com on 22 May 2013 at 2:46

GoogleCodeExporter commented 9 years ago
Second the request. Also second Nicolas on two separate functions. Also might 
as well make the third function for FILE * handle.

Original comment by mystkee...@gmail.com on 25 Aug 2013 at 1:19

GoogleCodeExporter commented 9 years ago
Just make it take FT_Face.

Original comment by behdad.e...@gmail.com on 8 Oct 2013 at 2:20