📄 sfnt.h
字号:
/***************************************************************************//* *//* sfnt.h *//* *//* High-level `sfnt' driver interface (specification). *//* *//* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by *//* David Turner, Robert Wilhelm, and Werner Lemberg. *//* *//* This file is part of the FreeType project, and may only be used, *//* modified, and distributed under the terms of the FreeType project *//* license, LICENSE.TXT. By continuing to use, modify, or distribute *//* this file you indicate that you have read the license and *//* understand and accept it fully. *//* *//***************************************************************************/#ifndef __SFNT_H__#define __SFNT_H__#include <ft2build.h>#include FT_INTERNAL_DRIVER_H#include FT_INTERNAL_TRUETYPE_TYPES_HFT_BEGIN_HEADER /*************************************************************************/ /* */ /* <FuncType> */ /* TT_Init_Face_Func */ /* */ /* <Description> */ /* First part of the SFNT face object initialization. This finds */ /* the face in a SFNT file or collection, and load its format tag in */ /* face->format_tag. */ /* */ /* <Input> */ /* stream :: The input stream. */ /* */ /* face :: A handle to the target face object. */ /* */ /* face_index :: The index of the TrueType font, if we are opening a */ /* collection. */ /* */ /* num_params :: The number of additional parameters. */ /* */ /* params :: Optional additional parameters. */ /* */ /* <Return> */ /* FreeType error code. 0 means success. */ /* */ /* <Note> */ /* The stream cursor must be at the font file's origin. */ /* */ /* This function recognizes fonts embedded in a `TrueType */ /* collection'. */ /* */ /* Once the format tag has been validated by the font driver, it */ /* should then call the TT_Load_Face_Func() callback to read the rest */ /* of the SFNT tables in the object. */ /* */ typedef FT_Error (*TT_Init_Face_Func)( FT_Stream stream, TT_Face face, FT_Int face_index, FT_Int num_params, FT_Parameter* params ); /*************************************************************************/ /* */ /* <FuncType> */ /* TT_Load_Face_Func */ /* */ /* <Description> */ /* Second part of the SFNT face object initialization. This loads */ /* the common SFNT tables (head, OS/2, maxp, metrics, etc.) in the */ /* face object. */ /* */ /* <Input> */ /* stream :: The input stream. */ /* */ /* face :: A handle to the target face object. */ /* */ /* face_index :: The index of the TrueType font, if we are opening a */ /* collection. */ /* */ /* num_params :: The number of additional parameters. */ /* */ /* params :: Optional additional parameters. */ /* */ /* <Return> */ /* FreeType error code. 0 means success. */ /* */ /* <Note> */ /* This function must be called after TT_Init_Face_Func(). */ /* */ typedef FT_Error (*TT_Load_Face_Func)( FT_Stream stream, TT_Face face, FT_Int face_index, FT_Int num_params, FT_Parameter* params ); /*************************************************************************/ /* */ /* <FuncType> */ /* TT_Done_Face_Func */ /* */ /* <Description> */ /* A callback used to delete the common SFNT data from a face. */ /* */ /* <Input> */ /* face :: A handle to the target face object. */ /* */ /* <Note> */ /* This function does NOT destroy the face object. */ /* */ typedef void (*TT_Done_Face_Func)( TT_Face face );#ifdef FT_CONFIG_OPTION_OLD_INTERNALS /*************************************************************************/ /* */ /* <FuncType> */ /* TT_Load_SFNT_HeaderRec_Func */ /* */ /* <Description> */ /* Loads the header of a SFNT font file. Supports collections. */ /* */ /* <Input> */ /* face :: A handle to the target face object. */ /* */ /* stream :: The input stream. */ /* */ /* face_index :: The index of the TrueType font, if we are opening a */ /* collection. */ /* */ /* <Output> */ /* sfnt :: The SFNT header. */ /* */ /* <Return> */ /* FreeType error code. 0 means success. */ /* */ /* <Note> */ /* The stream cursor must be at the font file's origin. */ /* */ /* This function recognizes fonts embedded in a `TrueType */ /* collection'. */ /* */ /* This function checks that the header is valid by looking at the */ /* values of `search_range', `entry_selector', and `range_shift'. */ /* */ typedef FT_Error (*TT_Load_SFNT_HeaderRec_Func)( TT_Face face, FT_Stream stream, FT_Long face_index, SFNT_Header sfnt ); /*************************************************************************/ /* */ /* <FuncType> */ /* TT_Load_Directory_Func */ /* */ /* <Description> */ /* Loads the table directory into a face object. */ /* */ /* <Input> */ /* face :: A handle to the target face object. */ /* */ /* stream :: The input stream. */ /* */ /* sfnt :: The SFNT header. */ /* */ /* <Return> */ /* FreeType error code. 0 means success. */ /* */ /* <Note> */ /* The stream cursor must be on the first byte after the 4-byte font */ /* format tag. This is the case just after a call to */ /* TT_Load_Format_Tag(). */ /* */ typedef FT_Error (*TT_Load_Directory_Func)( TT_Face face, FT_Stream stream, SFNT_Header sfnt );#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */ /*************************************************************************/ /* */ /* <FuncType> */ /* TT_Load_Any_Func */ /* */ /* <Description> */ /* Load any font table into client memory. */ /* */ /* <Input> */ /* face :: The face object to look for. */ /* */ /* tag :: The tag of table to load. Use the value 0 if you want */ /* to access the whole font file, else set this parameter */ /* to a valid TrueType table tag that you can forge with */ /* the MAKE_TT_TAG macro. */ /* */ /* offset :: The starting offset in the table (or the file if */ /* tag == 0). */ /* */ /* length :: The address of the decision variable: */ /* */ /* If length == NULL: */ /* Loads the whole table. Returns an error if */ /* `offset' == 0! */ /* */ /* If *length == 0: */ /* Exits immediately; returning the length of the given */ /* table or of the font file, depending on the value of */ /* `tag'. */ /* */ /* If *length != 0: */ /* Loads the next `length' bytes of table or font, */ /* starting at offset `offset' (in table or font too). */ /* */ /* <Output> */ /* buffer :: The address of target buffer. */ /* */ /* <Return> */ /* TrueType error code. 0 means success. */ /* */ typedef FT_Error (*TT_Load_Any_Func)( TT_Face face, FT_ULong tag, FT_Long offset, FT_Byte *buffer, FT_ULong* length ); /*************************************************************************/ /* */ /* <FuncType> */ /* TT_Find_SBit_Image_Func */ /* */ /* <Description> */ /* Check whether an embedded bitmap (an `sbit') exists for a given */ /* glyph, at a given strike. */ /* */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -