Hi, I want to paste the source code here, for people in the future.

  /*************************************************************************/
  /*                                                                       */
  /* <Function>                                                            */
  /*    FT_New_Memory_Face                                                 */
  /*                                                                       */
  /* <Description>                                                         */
  /*    Call @FT_Open_Face to open a font that has been loaded into        */
  /*    memory.                                                            */
  /*                                                                       */
  /* <InOut>                                                               */
  /*    library    :: A handle to the library resource.                    */
  /*                                                                       */
  /* <Input>                                                               */
  /*    file_base  :: A pointer to the beginning of the font data.         */
  /*                                                                       */
  /*    file_size  :: The size of the memory chunk used by the font data.  */
  /*                                                                       */
  /*    face_index :: See @FT_Open_Face for a detailed description of this */
  /*                  parameter.                                           */
  /*                                                                       */
  /* <Output>                                                              */
  /*    aface      :: A handle to a new face object.  If `face_index' is   */
  /*                  greater than or equal to zero, it must be non-NULL.  */
  /*                                                                       */
  /* <Return>                                                              */
  /*    FreeType error code.  0~means success.                             */
  /*                                                                       */
  /* <Note>                                                                */
  /*    You must not deallocate the memory before calling @FT_Done_Face.   */
  /*                                                                       */
  FT_EXPORT( FT_Error )
  FT_New_Memory_Face( FT_Library      library,
                      const FT_Byte*  file_base,
                      FT_Long         file_size,
                      FT_Long         face_index,
                      FT_Face        *aface );


-----Original Message-----
From: Freetype-devel 
[mailto:freetype-devel-bounces+548708880=qq....@nongnu.org] On Behalf Of 
duhuanpeng
Sent: Monday, March 12, 2018 11:25 PM
To: freetype-devel@nongnu.org
Subject: [ft-devel] How to port freetype2 to a system without file system

Hello,

I have ported freetype2 to our system. Our system don't supports file system, 
so I write some functions to emulate file operations.
> fopen,  fread, etc.
But now I maintain a "FILE" array, it eats a lot memory.

Is there any better way to port freetype2? 
Our fonts are store in flash, it appears like a normal array.
like:
  extern char font1[];
  extern char font2[];


(actually, I store multi font files in a single romfs image block.)

Regards,
duhuanpeng





_______________________________________________
Freetype-devel mailing list
Freetype-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/freetype-devel





_______________________________________________
Freetype-devel mailing list
Freetype-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/freetype-devel

Reply via email to