summaryrefslogtreecommitdiffstats
path: root/include/freetype/freetype.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/freetype/freetype.h')
-rw-r--r--include/freetype/freetype.h130
1 files changed, 78 insertions, 52 deletions
diff --git a/include/freetype/freetype.h b/include/freetype/freetype.h
index f68718d..10503fd 100644
--- a/include/freetype/freetype.h
+++ b/include/freetype/freetype.h
@@ -4,7 +4,7 @@
/* */
/* FreeType high-level API and common types (specification only). */
/* */
-/* Copyright 1996-2015 by */
+/* Copyright 1996-2016 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -16,8 +16,8 @@
/***************************************************************************/
-#ifndef __FREETYPE_H__
-#define __FREETYPE_H__
+#ifndef FREETYPE_H_
+#define FREETYPE_H_
#ifndef FT_FREETYPE_H
@@ -141,7 +141,6 @@ FT_BEGIN_HEADER
/* FT_FACE_FLAG_GLYPH_NAMES */
/* FT_FACE_FLAG_EXTERNAL_STREAM */
/* FT_FACE_FLAG_HINTER */
- /* FT_FACE_FLAG_TRICKY */
/* */
/* FT_HAS_HORIZONTAL */
/* FT_HAS_VERTICAL */
@@ -652,11 +651,11 @@ FT_BEGIN_HEADER
/* */
/* FT_ENCODING_SJIS :: */
/* Corresponds to Japanese SJIS encoding. More info at */
- /* at `http://en.wikipedia.org/wiki/Shift_JIS'. */
+ /* `http://en.wikipedia.org/wiki/Shift_JIS'. */
/* See note on multi-byte encodings below. */
/* */
/* FT_ENCODING_GB2312 :: */
- /* Corresponds to an encoding system for Simplified Chinese as used */
+ /* Corresponds to an encoding system for Simplified Chinese as */
/* used in mainland China. */
/* */
/* FT_ENCODING_BIG5 :: */
@@ -952,6 +951,10 @@ FT_BEGIN_HEADER
/* strikes in the face. It is set to NULL if */
/* there is no bitmap strike. */
/* */
+ /* Note that FreeType tries to sanitize the */
+ /* strike data since they are sometimes sloppy */
+ /* or incorrect, but this can easily fail. */
+ /* */
/* num_charmaps :: The number of charmaps in the face. */
/* */
/* charmaps :: An array of the charmaps of the face. */
@@ -1104,7 +1107,7 @@ FT_BEGIN_HEADER
/* FT_FACE_FLAG_SCALABLE :: */
/* Indicates that the face contains outline glyphs. This doesn't */
/* prevent bitmap strikes, i.e., a face can have both this and */
- /* and @FT_FACE_FLAG_FIXED_SIZES set. */
+ /* @FT_FACE_FLAG_FIXED_SIZES set. */
/* */
/* FT_FACE_FLAG_FIXED_SIZES :: */
/* Indicates that the face contains bitmap strikes. See also the */
@@ -1223,7 +1226,7 @@ FT_BEGIN_HEADER
*
*/
#define FT_HAS_HORIZONTAL( face ) \
- ( face->face_flags & FT_FACE_FLAG_HORIZONTAL )
+ ( (face)->face_flags & FT_FACE_FLAG_HORIZONTAL )
/*************************************************************************
@@ -1237,7 +1240,7 @@ FT_BEGIN_HEADER
*
*/
#define FT_HAS_VERTICAL( face ) \
- ( face->face_flags & FT_FACE_FLAG_VERTICAL )
+ ( (face)->face_flags & FT_FACE_FLAG_VERTICAL )
/*************************************************************************
@@ -1251,7 +1254,7 @@ FT_BEGIN_HEADER
*
*/
#define FT_HAS_KERNING( face ) \
- ( face->face_flags & FT_FACE_FLAG_KERNING )
+ ( (face)->face_flags & FT_FACE_FLAG_KERNING )
/*************************************************************************
@@ -1266,7 +1269,7 @@ FT_BEGIN_HEADER
*
*/
#define FT_IS_SCALABLE( face ) \
- ( face->face_flags & FT_FACE_FLAG_SCALABLE )
+ ( (face)->face_flags & FT_FACE_FLAG_SCALABLE )
/*************************************************************************
@@ -1285,7 +1288,7 @@ FT_BEGIN_HEADER
*
*/
#define FT_IS_SFNT( face ) \
- ( face->face_flags & FT_FACE_FLAG_SFNT )
+ ( (face)->face_flags & FT_FACE_FLAG_SFNT )
/*************************************************************************
@@ -1300,7 +1303,7 @@ FT_BEGIN_HEADER
*
*/
#define FT_IS_FIXED_WIDTH( face ) \
- ( face->face_flags & FT_FACE_FLAG_FIXED_WIDTH )
+ ( (face)->face_flags & FT_FACE_FLAG_FIXED_WIDTH )
/*************************************************************************
@@ -1315,7 +1318,7 @@ FT_BEGIN_HEADER
*
*/
#define FT_HAS_FIXED_SIZES( face ) \
- ( face->face_flags & FT_FACE_FLAG_FIXED_SIZES )
+ ( (face)->face_flags & FT_FACE_FLAG_FIXED_SIZES )
/*************************************************************************
@@ -1341,7 +1344,7 @@ FT_BEGIN_HEADER
*
*/
#define FT_HAS_GLYPH_NAMES( face ) \
- ( face->face_flags & FT_FACE_FLAG_GLYPH_NAMES )
+ ( (face)->face_flags & FT_FACE_FLAG_GLYPH_NAMES )
/*************************************************************************
@@ -1356,7 +1359,21 @@ FT_BEGIN_HEADER
*
*/
#define FT_HAS_MULTIPLE_MASTERS( face ) \
- ( face->face_flags & FT_FACE_FLAG_MULTIPLE_MASTERS )
+ ( (face)->face_flags & FT_FACE_FLAG_MULTIPLE_MASTERS )
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_IS_NAMED_INSTANCE( face )
+ *
+ * @description:
+ * A macro that returns true whenever a face object is a named instance
+ * of a GX variation font.
+ *
+ */
+#define FT_IS_NAMED_INSTANCE( face ) \
+ ( (face)->face_index & 0x7FFF0000L )
/*************************************************************************
@@ -1374,7 +1391,7 @@ FT_BEGIN_HEADER
*
*/
#define FT_IS_CID_KEYED( face ) \
- ( face->face_flags & FT_FACE_FLAG_CID_KEYED )
+ ( (face)->face_flags & FT_FACE_FLAG_CID_KEYED )
/*************************************************************************
@@ -1388,7 +1405,7 @@ FT_BEGIN_HEADER
*
*/
#define FT_IS_TRICKY( face ) \
- ( face->face_flags & FT_FACE_FLAG_TRICKY )
+ ( (face)->face_flags & FT_FACE_FLAG_TRICKY )
/*************************************************************************
@@ -1402,7 +1419,7 @@ FT_BEGIN_HEADER
*
*/
#define FT_HAS_COLOR( face ) \
- ( face->face_flags & FT_FACE_FLAG_COLOR )
+ ( (face)->face_flags & FT_FACE_FLAG_COLOR )
/*************************************************************************/
@@ -1942,7 +1959,7 @@ FT_BEGIN_HEADER
/* */
/* If the @FT_OPEN_MEMORY bit is set, assume that this is a */
/* memory file of `memory_size' bytes, located at `memory_address'. */
- /* The data are are not copied, and the client is responsible for */
+ /* The data are not copied, and the client is responsible for */
/* releasing and destroying them _after_ the corresponding call to */
/* @FT_Done_Face. */
/* */
@@ -2332,17 +2349,26 @@ FT_BEGIN_HEADER
/* FT_Size_Request_Type */
/* */
/* <Description> */
- /* An enumeration type that lists the supported size request types. */
+ /* An enumeration type that lists the supported size request types, */
+ /* i.e., what input size (in font units) maps to the requested output */
+ /* size (in pixels, as computed from the arguments of */
+ /* @FT_Size_Request). */
/* */
/* <Values> */
/* FT_SIZE_REQUEST_TYPE_NOMINAL :: */
/* The nominal size. The `units_per_EM' field of @FT_FaceRec is */
/* used to determine both scaling values. */
/* */
+ /* This is the standard scaling found in most applications. In */
+ /* particular, use this size request type for TrueType fonts if */
+ /* they provide optical scaling or something similar. Note, */
+ /* however, that `units_per_EM' is a rather abstract value which */
+ /* bears no relation to the actual size of the glyphs in a font. */
+ /* */
/* FT_SIZE_REQUEST_TYPE_REAL_DIM :: */
- /* The real dimension. The sum of the the `ascender' and (minus */
- /* of) the `descender' fields of @FT_FaceRec are used to determine */
- /* both scaling values. */
+ /* The real dimension. The sum of the `ascender' and (minus of) */
+ /* the `descender' fields of @FT_FaceRec are used to determine both */
+ /* scaling values. */
/* */
/* FT_SIZE_REQUEST_TYPE_BBOX :: */
/* The font bounding box. The width and height of the `bbox' field */
@@ -2392,22 +2418,29 @@ FT_BEGIN_HEADER
/* <Fields> */
/* type :: See @FT_Size_Request_Type. */
/* */
- /* width :: The desired width. */
+ /* width :: The desired width, given as a 26.6 fractional */
+ /* point value (with 72pt = 1in). */
/* */
- /* height :: The desired height. */
+ /* height :: The desired height, given as a 26.6 fractional */
+ /* point value (with 72pt = 1in). */
/* */
- /* horiResolution :: The horizontal resolution. If set to zero, */
- /* `width' is treated as a 26.6 fractional pixel */
- /* value. */
+ /* horiResolution :: The horizontal resolution (dpi, i.e., pixels per */
+ /* inch). If set to zero, `width' is treated as a */
+ /* 26.6 fractional *pixel* value. */
/* */
- /* vertResolution :: The vertical resolution. If set to zero, */
- /* `height' is treated as a 26.6 fractional pixel */
- /* value. */
+ /* vertResolution :: The vertical resolution (dpi, i.e., pixels per */
+ /* inch). If set to zero, `height' is treated as a */
+ /* 26.6 fractional *pixel* value. */
/* */
/* <Note> */
/* If `width' is zero, then the horizontal scaling value is set equal */
/* to the vertical scaling value, and vice versa. */
/* */
+ /* If `type' is FT_SIZE_REQUEST_TYPE_SCALES, `width' and `height' are */
+ /* interpreted directly as 16.16 fractional scaling values, without */
+ /* any further modification, and both `horiResolution' and */
+ /* `vertResolution' are ignored. */
+ /* */
typedef struct FT_Size_RequestRec_
{
FT_Size_Request_Type type;
@@ -2579,6 +2612,10 @@ FT_BEGIN_HEADER
/* don't have a corresponding glyph in the font). See the discussion */
/* of the @FT_FACE_FLAG_CID_KEYED flag for more details. */
/* */
+ /* If you receive `FT_Err_Glyph_Too_Big', try getting the glyph */
+ /* outline at EM size, then scale it manually and fill it as a */
+ /* graphics operation. */
+ /* */
FT_EXPORT( FT_Error )
FT_Load_Glyph( FT_Face face,
FT_UInt glyph_index,
@@ -2856,7 +2893,7 @@ FT_BEGIN_HEADER
*
* If @FT_LOAD_RENDER is also set, the glyph is rendered in the
* corresponding mode (i.e., the mode that matches the used algorithm
- * best). An exeption is FT_LOAD_TARGET_MONO since it implies
+ * best). An exception is FT_LOAD_TARGET_MONO since it implies
* @FT_LOAD_MONOCHROME.
*
* You can use a hinting algorithm that doesn't correspond to the same
@@ -3274,7 +3311,7 @@ FT_BEGIN_HEADER
/* `.notdef'). */
/* */
/* This function always returns an error if the config macro */
- /* `FT_CONFIG_OPTION_NO_GLYPH_NAMES' is not defined in `ftoptions.h'. */
+ /* `FT_CONFIG_OPTION_NO_GLYPH_NAMES' is not defined in `ftoption.h'. */
/* */
FT_EXPORT( FT_Error )
FT_Get_Glyph_Name( FT_Face face,
@@ -4172,8 +4209,8 @@ FT_BEGIN_HEADER
*
*/
#define FREETYPE_MAJOR 2
-#define FREETYPE_MINOR 6
-#define FREETYPE_PATCH 2
+#define FREETYPE_MINOR 7
+#define FREETYPE_PATCH 0
/*************************************************************************/
@@ -4218,20 +4255,13 @@ FT_BEGIN_HEADER
/* FT_Face_CheckTrueTypePatents */
/* */
/* <Description> */
- /* Parse all bytecode instructions of a TrueType font file to check */
- /* whether any of the patented opcodes are used. This is only useful */
- /* if you want to be able to use the unpatented hinter with */
- /* fonts that do *not* use these opcodes. */
- /* */
- /* Note that this function parses *all* glyph instructions in the */
- /* font file, which may be slow. */
+ /* Deprecated, does nothing. */
/* */
/* <Input> */
/* face :: A face handle. */
/* */
/* <Return> */
- /* 1~if this is a TrueType font that uses one of the patented */
- /* opcodes, 0~otherwise. */
+ /* Always returns false. */
/* */
/* <Note> */
/* Since May 2010, TrueType hinting is no longer patented. */
@@ -4249,9 +4279,7 @@ FT_BEGIN_HEADER
/* FT_Face_SetUnpatentedHinting */
/* */
/* <Description> */
- /* Enable or disable the unpatented hinter for a given face. */
- /* Only enable it if you have determined that the face doesn't */
- /* use any patented opcodes (see @FT_Face_CheckTrueTypePatents). */
+ /* Deprecated, does nothing. */
/* */
/* <Input> */
/* face :: A face handle. */
@@ -4259,9 +4287,7 @@ FT_BEGIN_HEADER
/* value :: New boolean setting. */
/* */
/* <Return> */
- /* The old setting value. This will always be false if this is not */
- /* an SFNT font, or if the unpatented hinter is not compiled in this */
- /* instance of the library. */
+ /* Always returns false. */
/* */
/* <Note> */
/* Since May 2010, TrueType hinting is no longer patented. */
@@ -4278,7 +4304,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
-#endif /* __FREETYPE_H__ */
+#endif /* FREETYPE_H_ */
/* END */