⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 truetype.h

📁 Qt/Embedded是一个多平台的C++图形用户界面应用程序框架
💻 H
📖 第 1 页 / 共 5 页
字号:
  /*************************************************************/  /*                                                           */  /* <Struct> TT_SBit_Strike                                   */  /*                                                           */  /* <Description>                                             */  /*    A structure used describe a given bitmap strike in the */  /*    "EBLC" or "bloc" tables.                               */  /*                                                           */  /* <Fields>                                                  */  /*                                                           */  /*   num_index_ranges  :: number of index ranges             */  /*   index_ranges      :: array of glyph index ranges        */  /*                                                           */  /*   color_ref   :: unused. color reference ??               */  /*   hori        :: line metrics for horizontal layouts.     */  /*   vert        :: line metrics for vertical layouts.       */  /*                                                           */  /*   start_glyph :: lowest glyph index for this strike.      */  /*   end_glyph   :: higher glyph index for this strike.      */  /*                                                           */  /*   x_ppem      :: horizontal pixels per EM                 */  /*   y_ppem      :: vertical pixels per EM                   */  /*   bit_depth   :: bit depth. valid values are 1, 2, 4 & 8  */  /*   flags       :: vertical or horizontal ?                 */  /*                                                           */  typedef struct TT_SBit_Strike_  {    TT_Int                 num_ranges;    TT_SBit_Range*         sbit_ranges;    TT_ULong               ranges_offset;    TT_ULong               color_ref;    TT_SBit_Line_Metrics   hori;    TT_SBit_Line_Metrics   vert;    TT_UShort              start_glyph;    TT_UShort              end_glyph;    TT_Byte                x_ppem;    TT_Byte                y_ppem;    TT_Byte                bit_depth;    TT_Char                flags;  } TT_SBit_Strike;    /*************************************************************/  /*                                                           */  /* <Struct> TT_SBit_Component                                */  /*                                                           */  /* <Description>                                             */  /*    A simple structure to describe a compound sbit element */  /*                                                           */  /* <Fields>                                                  */  /*    glyph_code  :: element's glyph index                   */  /*    x_offset    :: element's left bearing                  */  /*    y_offset    :: element's top bearing                   */  /*                                                           */  typedef struct TT_SBit_Component_  {    TT_UShort  glyph_code;    TT_Char    x_offset;    TT_Char    y_offset;  } TT_SBit_Component;  /*************************************************************/  /*                                                           */  /* <Struct> TT_SBit_Scale                                    */  /*                                                           */  /* <Description>                                             */  /*    A structure used describe a given bitmap scaling       */  /*    table, asdefined for the "EBSC" table.                 */  /*                                                           */  /* <Fields>                                                  */  /*                                                           */  /*    hori   :: horizontal line metrics                      */  /*    vert   :: vertical line metrics                        */  /*                                                           */  /*    x_ppem :: horizontal pixels per EM                     */  /*    y_ppem :: vertical pixels per EM                       */  /*                                                           */  /*    x_ppem_substitute  :: substitution x_ppem              */  /*    y_ppem_substitute  :: substitution y_ppem              */  /*                                                           */  typedef struct TT_SBit_Scale_  {    TT_SBit_Line_Metrics  hori;    TT_SBit_Line_Metrics  vert;    TT_Byte               x_ppem;    TT_Byte               y_ppem;    TT_Byte               x_ppem_substitute;    TT_Byte               y_ppem_substitute;  } TT_SBit_Scale;#endif /* _TRUETYPE_ */  /*************************************************************/  /*                                                           */  /* <Struct> TT_SBit_Image                                    */  /*                                                           */  /* <Description>                                             */  /*    A structure used to describe a given embedded bitmap   */  /*    image.                                                 */  /*                                                           */  /* <Fields>                                                  */  /*    map        :: bitmap descriptor                        */  /*    bit_depth  :: pixel bit depth                          */  /*    metrics    :: glyph metrics for the bitmap             */  /*                                                           */  typedef struct TT_SBit_Image_  {    TT_Raster_Map         map;    int                   bit_depth;    TT_Big_Glyph_Metrics  metrics;  } TT_SBit_Image;  /*************************************************************/  /*                                                           */  /* <Struct> TT_EBLC                                          */  /*                                                           */  /* <Description>                                             */  /*    A structure used to describe the "EBLC" table from     */  /*    a TrueTYpe font.                                       */  /*                                                           */  /* <Fields>                                                  */  /*                                                           */  /*    version     :: version number of the EBLC table        */  /*                                                           */  /*    num_strikes :: the number of strikes, i.e. bitmap      */  /*                   sizes, present in this font             */  /*                                                           */  /*    strikes     :: array of strikes                        */  /*                                                           */  typedef struct TT_EBLC_  {    TT_ULong         version;    TT_ULong         num_strikes;    TT_SBit_Strike*  strikes;  } TT_EBLC;  /*************************************************************/  /*                                                           */  /* <Function>                                                */  /*    TT_Init_SBit_Extension                                 */  /*                                                           */  /* <Description>                                             */  /*    Initialise the embedded bitmaps extension for the      */  /*    FreeType engine.                                       */  /*                                                           */  /* <Input>                                                   */  /*    engine  :: handle to current FreeType library instance */  /*                                                           */  /* <Return>                                                  */  /*    Error code. 0 means success.                           */  /*                                                           */  EXPORT_DEF  TT_Error  TT_Init_SBit_Extension( TT_Engine  engine );  /*************************************************************/  /*                                                           */  /* <Function>                                                */  /*    TT_Get_Face_Bitmaps                                    */  /*                                                           */  /* <Description>                                             */  /*    Loads the "EBLC" table from a font file, if any.       */  /*                                                           */  /* <Input>                                                   */  /*    face :: handle to the source TrueType font/face        */  /*                                                           */  /* <Output>                                                  */  /*    eblc_table :: a descriptor for the EBLC table          */  /*                                                           */  /* <Return>                                                  */  /*    Error code. 0 means success.                           */  /*                                                           */  /* <Note>                                                    */  /*    This function returns TT_Err_Table_Missing when the    */  /*    font contains no embedded bitmaps. All fields in       */  /*    "eblc_table" will then be set to 0.                    */  /*                                                           */  EXPORT_DEF  TT_Error  TT_Get_Face_Bitmaps( TT_Face   face,                                 TT_EBLC  *eblc_table );  /*************************************************************/  /*                                                           */  /* <Function>                                                */  /*    TT_New_SBit_Image                                      */  /*                                                           */  /* <Description>                                             */  /*    Allocates a new embedded bitmap container              */  /*                                                           */  /* <Output>                                                  */  /*    image :: sbit image                                    */  /*                                                           */  /* <Return>                                                  */  /*    Error code. 0 means success.                           */  /*                                                           */  EXPORT_DEF  TT_Error  TT_New_SBit_Image( TT_SBit_Image*  *image );  /*************************************************************/  /*                                                           */  /* <Function>                                                */  /*    TT_Done_SBit_Image                                     */  /*                                                           */  /* <Description>                                             */  /*    Releases an embedded bitmap container                  */  /*                                                           */  /* <Input>                                                   */  /*    image :: sbit image                                    */  /*                                                           */  EXPORT_DEF  void      TT_Done_SBit_Image( TT_SBit_Image*  image );  /*************************************************************/  /*                                                           */  /* <Function>                                                */  /*    TT_Load_Glyph_Bitmap                                   */  /*                                                           */  /* <Description>                                             */  /*    Loads a given glyph embedded bitmap                    */  /*                                                           */  /* <Input>                                                   */  /*    face        :: handle to the source TrueType font/face */  /*    instance    :: current size/transform instance         */  /*    glyph_index :: index of source glyph                   */  /*    bitmap      :: target embedded bitmap descriptor       */  /*                                                           */  /* <Return>                                                  */  /*    Error code. 0 means success.                           */  /*                                                           */  /* <Note>                                                    */  /*    This function returns an error if there is no          */  /*    embedded bitmap for the glyph at the given             */  /*    instance.                                              */  /*                                                           */  EXPORT_DEF  TT_Error  TT_Load_Glyph_Bitmap( TT_Face         face,                                  TT_Instance     instance,                                  TT_UShort       glyph_index,                                  TT_SBit_Image*  bitmap );  /*******************************************************************/  /*                                                                 */  /*  FreeType API                                                   */  /*                                                                 */  /*  All these begin with a 'TT_' prefix.                           */  /*                                                                 */  /*  Most of them are implemented in the 'ttapi.c' source file.     */  /*                                                                 */  /*******************************************************************/  /* Initialize the engine. */  EXPORT_DEF  TT_Error  TT_Init_FreeType( TT_Engine*  engine );  /* Finalize the engine, and release all allocated objects. */  EXPORT_DEF  TT_Error  TT_Done_FreeType( TT_Engine  engine );  /* Set the gray level palette.  This is an array of 5 bytes used */  /* to produce the font smoothed pixmaps.  By convention:         */  /*                                                               */  /*  palette[0] = background (white)                              */  /*  palette[1] = light                                           */  /*  palette[2] = medium                                          */  /*  palette[3] = dark                                            */  /*  palette[4] = foreground (black)                              */  /*                                                               */  EXPORT_DEF  TT_Error  TT_Set_Raster_Gray_Palette( TT_Engine       engine,                                        const TT_Byte*  palette );    /* ----------------------- face management ----------------------- */  /* Open a new TrueType font file, and returns a handle for */  /* it in variable '*face'.                                 */  /* Note: The file can be either a TrueType file (*.ttf) or  */  /*       a TrueType collection (*.ttc, in this case, only   */  /*       the first face is opened).  The number of faces in */  /*       the same collection can be obtained in the face's  */  /*       properties, using TT_Get_Face_Properties() and the */  /*       'max_Faces' field.                                 */  EXPORT_DEF  TT_Error  TT_Open_Face( TT_Engine       engine,                          const TT_Text*  fontPathName,

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -