freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Devel] "FT_Get_First_Char" and "FT_Get_Next_Char" in the CVS


From: David Turner
Subject: [Devel] "FT_Get_First_Char" and "FT_Get_Next_Char" in the CVS
Date: Thu, 28 Feb 2002 23:23:44 +0100

Hello,

  just to inform you that new functions named FT_Get_First_Char and
  FT_Get_Next_Char are available in both the STABLE and HEAD branches
  of the FT2 sources.

  These new APIs allow you to quickly parse the content of any active
  charmap of a given FT_Face. They will be part of the upcoming
  FreeType 2.0.9 which should be released either tomorrow or on
  next Monday..

  Enjoy, and please test :o)


Regards,

- David Turner

Here are the new lines that were added to FT_FREETYPE_H:


  /*************************************************************************/
  /*                                                                       */
  /* <Function>                                                            */
  /*    FT_Get_First_Char                                                  */
  /*                                                                       */
  /* <Description>                                                         */
  /*    This function is used to return the first character code in the    */
  /*    current charmap of a given face. It will also return the           */
  /*    corresponding glyph index.                                         */
  /*                                                                       */
  /* <Input>                                                               */
  /*    face     :: A handle to the source face object.                    */
  /*                                                                       */
  /* <Output>                                                              */
  /*    agindex  :: glyph index of first character code. 0 if charmap      */
  /*                is empty..                                             */
  /*                                                                       */
  /* <Return>                                                              */
  /*    the charmap's first character code.                                */
  /*                                                                       */
  /* <Note>                                                                */
  /*    you should use this function with @FT_Get_Next_Char to be able     */
  /*    to parse all character codes available in a given charmap.         */
  /*    the code should look like:                                         */
  /*                                                                       */
  /*    {                                                                  */
  /*      FT_ULong  charcode;                                              */
  /*      FT_UInt   gindex;                                                */
  /*                                                                       */
  /*      charcode = FT_Get_First_Char( face, &gindex );                   */
  /*      while ( gindex != 0 )                                            */
  /*      {                                                                */
  /*        .. do something with (charcode,gindex) pair                    */
  /*                                                                       */
  /*        charcode = FT_Get_Next_Char( face, charcode, &gindex );        */
  /*      }                                                                */
  /*    }                                                                  */
  /*                                                                       */
  /*    note that '*agindex' will be set to 0 if the charmap is empty.     */
  /*    the result itself can be 0 in two cases: if the charmap is empty   */
  /*    or when the value 0 is the first valid character code.             */
  /*                                                                       */
  FT_EXPORT( FT_ULong )
  FT_Get_First_Char( FT_Face   face,
                     FT_UInt  *agindex );


  /*************************************************************************/
  /*                                                                       */
  /* <Function>                                                            */
  /*    FT_Get_Next_Char                                                   */
  /*                                                                       */
  /* <Description>                                                         */
  /*    This function is used to return the next character code in the     */
  /*    current charmap of a given face following the value 'char_code',   */
  /*    as well as the corresponding glyph index                           */
  /*                                                                       */
  /* <Input>                                                               */
  /*    face      :: A handle to the source face object.                   */
  /*    char_code :: starting character code                               */
  /*                                                                       */
  /* <Output>                                                              */
  /*    agindex  :: glyph index of first character code. 0 if charmap      */
  /*                is empty..                                             */
  /*                                                                       */
  /* <Return>                                                              */
  /*    the charmap's next character code.                                 */
  /*                                                                       */
  /* <Note>                                                                */
  /*    you should use this function with @FT_Get_First_Char to be able    */
  /*    to parse all character codes available in a given charmap. see     */
  /*    the note for this function for a simple code example..             */
  /*                                                                       */
  /*    note that '*agindex' will be set to 0 when there are no more       */
  /*    codes in the charmap..                                             */
  /*                                                                       */
  FT_EXPORT( FT_ULong )
  FT_Get_Next_Char( FT_Face    face,
                    FT_ULong   char_code,
                    FT_UInt   *agindex );



reply via email to

[Prev in Thread] Current Thread [Next in Thread]