📄 ftglyph.h
字号:
/***************************************************************************//* *//* ftglyph.h *//* *//* FreeType convenience functions to handle glyphs (specification). *//* *//* Copyright 1996-2001 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. *//* *//***************************************************************************/ /*************************************************************************/ /* */ /* This file contains the definition of several convenience functions */ /* that can be used by client applications to easily retrieve glyph */ /* bitmaps and outlines from a given face. */ /* */ /* These functions should be optional if you are writing a font server */ /* or text layout engine on top of FreeType. However, they are pretty */ /* handy for many other simple uses of the library. */ /* */ /*************************************************************************/#ifndef __FTGLYPH_H__#define __FTGLYPH_H__#include <ft2build.h>#include FT_FREETYPE_HFT_BEGIN_HEADER /*************************************************************************/ /* */ /* <Section> */ /* glyph_management */ /* */ /* <Title> */ /* Glyph Management */ /* */ /* <Abstract> */ /* Generic interface to manage individual glyph data. */ /* */ /* <Description> */ /* This section contains definitions used to manage glyph data */ /* through generic FT_Glyph objects. Each of them can contain a */ /* bitmap, a vector outline, or even images in other formats. */ /* */ /*************************************************************************/ /* forward declaration to a private type */ typedef struct FT_Glyph_Class_ FT_Glyph_Class; /*************************************************************************/ /* */ /* <Type> */ /* FT_Glyph */ /* */ /* <Description> */ /* Handle to an object used to model generic glyph images. It is a */ /* pointer to the @FT_GlyphRec structure and can contain a glyph */ /* bitmap or pointer. */ /* */ /* <Note> */ /* Glyph objects are not owned by the library. You must thus release */ /* them manually (through @FT_Done_Glyph) _before_ calling */ /* @FT_Done_FreeType. */ /* */ typedef struct FT_GlyphRec_* FT_Glyph; /*************************************************************************/ /* */ /* <Struct> */ /* FT_GlyphRec */ /* */ /* <Description> */ /* The root glyph structure contains a given glyph image plus its */ /* advance width in 16.16 fixed float format. */ /* */ /* <Fields> */ /* library :: A handle to the FreeType library object. */ /* */ /* clazz :: A pointer to the glyph's class. Private. */ /* */ /* format :: The format of the glyph's image. */ /* */ /* advance :: A 16.16 vector that gives the glyph's advance width. */ /* */ typedef struct FT_GlyphRec_ { FT_Library library; const FT_Glyph_Class* clazz; FT_Glyph_Format format; FT_Vector advance; } FT_GlyphRec; /*************************************************************************/ /* */ /* <Type> */ /* FT_BitmapGlyph */ /* */ /* <Description> */ /* A handle to an object used to model a bitmap glyph image. This is */ /* a sub-class of @FT_Glyph, and a pointer to @FT_BitmapGlyphRec. */ /* */ typedef struct FT_BitmapGlyphRec_* FT_BitmapGlyph; /*************************************************************************/ /* */ /* <Struct> */ /* FT_BitmapGlyphRec */ /* */ /* <Description> */ /* A structure used for bitmap glyph images. This really is a */ /* `sub-class' of `FT_GlyphRec'. */ /* */ /* <Fields> */ /* root :: The root FT_Glyph fields. */ /* */ /* left :: The left-side bearing, i.e., the horizontal distance */ /* from the current pen position to the left border of the */ /* glyph bitmap. */ /* */ /* top :: The top-side bearing, i.e., the vertical distance from */ /* the current pen position to the top border of the glyph */ /* bitmap. This distance is positive for upwards-y! */ /* */ /* bitmap :: A descriptor for the bitmap. */ /* */ /* <Note> */ /* You can typecast FT_Glyph to FT_BitmapGlyph if you have */ /* glyph->format == ft_glyph_format_bitmap. This lets you access */ /* the bitmap's contents easily. */ /* */ /* The corresponding pixel buffer is always owned by the BitmapGlyph */ /* and is thus created and destroyed with it. */ /* */ typedef struct FT_BitmapGlyphRec_ { FT_GlyphRec root; FT_Int left; FT_Int top; FT_Bitmap bitmap; } FT_BitmapGlyphRec; /*************************************************************************/ /* */ /* <Type> */ /* FT_OutlineGlyph */ /* */ /* <Description> */ /* A handle to an object used to model an outline glyph image. This */ /* is a sub-class of @FT_Glyph, and a pointer to @FT_OutlineGlyphRec. */ /* */ typedef struct FT_OutlineGlyphRec_* FT_OutlineGlyph;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -