ftsnames.h
上传用户:yisoukefu
上传日期:2020-08-09
资源大小:39506k
文件大小:10k
源码类别:

其他游戏

开发平台:

Visual C++

  1. /***************************************************************************/
  2. /*                                                                         */
  3. /*  ftsnames.h                                                             */
  4. /*                                                                         */
  5. /*    Simple interface to access SFNT name tables (which are used          */
  6. /*    to hold font names, copyright info, notices, etc.) (specification).  */
  7. /*                                                                         */
  8. /*    This is _not_ used to retrieve glyph names!                          */
  9. /*                                                                         */
  10. /*  Copyright 1996-2001, 2002, 2003, 2006 by                               */
  11. /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
  12. /*                                                                         */
  13. /*  This file is part of the FreeType project, and may only be used,       */
  14. /*  modified, and distributed under the terms of the FreeType project      */
  15. /*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
  16. /*  this file you indicate that you have read the license and              */
  17. /*  understand and accept it fully.                                        */
  18. /*                                                                         */
  19. /***************************************************************************/
  20. #ifndef __FT_SFNT_NAMES_H__
  21. #define __FT_SFNT_NAMES_H__
  22. #include <ft2build.h>
  23. #include FT_FREETYPE_H
  24. #ifdef FREETYPE_H
  25. #error "freetype.h of FreeType 1 has been loaded!"
  26. #error "Please fix the directory search order for header files"
  27. #error "so that freetype.h of FreeType 2 is found first."
  28. #endif
  29. FT_BEGIN_HEADER
  30.   /*************************************************************************/
  31.   /*                                                                       */
  32.   /* <Section>                                                             */
  33.   /*    sfnt_names                                                         */
  34.   /*                                                                       */
  35.   /* <Title>                                                               */
  36.   /*    SFNT Names                                                         */
  37.   /*                                                                       */
  38.   /* <Abstract>                                                            */
  39.   /*    Access the names embedded in TrueType and OpenType files.          */
  40.   /*                                                                       */
  41.   /* <Description>                                                         */
  42.   /*    The TrueType and OpenType specification allow the inclusion of     */
  43.   /*    a special `names table' in font files.  This table contains        */
  44.   /*    textual (and internationalized) information regarding the font,    */
  45.   /*    like family name, copyright, version, etc.                         */
  46.   /*                                                                       */
  47.   /*    The definitions below are used to access them if available.        */
  48.   /*                                                                       */
  49.   /*    Note that this has nothing to do with glyph names!                 */
  50.   /*                                                                       */
  51.   /*************************************************************************/
  52.   /*************************************************************************/
  53.   /*                                                                       */
  54.   /* <Struct>                                                              */
  55.   /*    FT_SfntName                                                        */
  56.   /*                                                                       */
  57.   /* <Description>                                                         */
  58.   /*    A structure used to model an SFNT `name' table entry.              */
  59.   /*                                                                       */
  60.   /* <Fields>                                                              */
  61.   /*    platform_id :: The platform ID for `string'.                       */
  62.   /*                                                                       */
  63.   /*    encoding_id :: The encoding ID for `string'.                       */
  64.   /*                                                                       */
  65.   /*    language_id :: The language ID for `string'.                       */
  66.   /*                                                                       */
  67.   /*    name_id     :: An identifier for `string'.                         */
  68.   /*                                                                       */
  69.   /*    string      :: The `name' string.  Note that its format differs    */
  70.   /*                   depending on the (platform,encoding) pair.  It can  */
  71.   /*                   be a Pascal String, a UTF-16 one, etc.              */
  72.   /*                                                                       */
  73.   /*                   Generally speaking, the string is not               */
  74.   /*                   zero-terminated.  Please refer to the TrueType      */
  75.   /*                   specification for details.                          */
  76.   /*                                                                       */
  77.   /*    string_len  :: The length of `string' in bytes.                    */
  78.   /*                                                                       */
  79.   /* <Note>                                                                */
  80.   /*    Possible values for `platform_id', `encoding_id', `language_id',   */
  81.   /*    and `name_id' are given in the file `ttnameid.h'.  For details     */
  82.   /*    please refer to the TrueType or OpenType specification.            */
  83.   /*                                                                       */
  84.   /*    See also @TT_PLATFORM_XXX, @TT_APPLE_ID_XXX, @TT_MAC_ID_XXX,       */
  85.   /*    @TT_ISO_ID_XXX, and @TT_MS_ID_XXX.                                 */
  86.   /*                                                                       */
  87.   typedef struct  FT_SfntName_
  88.   {
  89.     FT_UShort  platform_id;
  90.     FT_UShort  encoding_id;
  91.     FT_UShort  language_id;
  92.     FT_UShort  name_id;
  93.     FT_Byte*   string;      /* this string is *not* null-terminated! */
  94.     FT_UInt    string_len;  /* in bytes */
  95.   } FT_SfntName;
  96.   /*************************************************************************/
  97.   /*                                                                       */
  98.   /* <Function>                                                            */
  99.   /*    FT_Get_Sfnt_Name_Count                                             */
  100.   /*                                                                       */
  101.   /* <Description>                                                         */
  102.   /*    Retrieves the number of name strings in the SFNT `name' table.     */
  103.   /*                                                                       */
  104.   /* <Input>                                                               */
  105.   /*    face :: A handle to the source face.                               */
  106.   /*                                                                       */
  107.   /* <Return>                                                              */
  108.   /*    The number of strings in the `name' table.                         */
  109.   /*                                                                       */
  110.   FT_EXPORT( FT_UInt )
  111.   FT_Get_Sfnt_Name_Count( FT_Face  face );
  112.   /*************************************************************************/
  113.   /*                                                                       */
  114.   /* <Function>                                                            */
  115.   /*    FT_Get_Sfnt_Name                                                   */
  116.   /*                                                                       */
  117.   /* <Description>                                                         */
  118.   /*    Retrieves a string of the SFNT `name' table for a given index.     */
  119.   /*                                                                       */
  120.   /* <Input>                                                               */
  121.   /*    face  :: A handle to the source face.                              */
  122.   /*                                                                       */
  123.   /*    idx   :: The index of the `name' string.                           */
  124.   /*                                                                       */
  125.   /* <Output>                                                              */
  126.   /*    aname :: The indexed @FT_SfntName structure.                       */
  127.   /*                                                                       */
  128.   /* <Return>                                                              */
  129.   /*    FreeType error code.  0 means success.                             */
  130.   /*                                                                       */
  131.   /* <Note>                                                                */
  132.   /*    The `string' array returned in the `aname' structure is not        */
  133.   /*    null-terminated.                                                   */
  134.   /*                                                                       */
  135.   /*    Use @FT_Get_Sfnt_Name_Count to get the total number of available   */
  136.   /*    `name' table entries, then do a loop until you get the right       */
  137.   /*    platform, encoding, and name ID.                                   */
  138.   /*                                                                       */
  139.   FT_EXPORT( FT_Error )
  140.   FT_Get_Sfnt_Name( FT_Face       face,
  141.                     FT_UInt       idx,
  142.                     FT_SfntName  *aname );
  143.   /* */
  144. FT_END_HEADER
  145. #endif /* __FT_SFNT_NAMES_H__ */
  146. /* END */