Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Courses
DrawSVG
Commits
57023a55
Commit
57023a55
authored
Sep 21, 2019
by
Adrian Biagioli
Browse files
Update freetype and drawsvg_ref.dll so on Win64 DrawSVG builds correctly
parent
ab7caec5
Changes
104
Hide whitespace changes
Inline
Side-by-side
CMU462/deps/freetype/include/freetype/ftgxval.h
0 → 100644
View file @
57023a55
/****************************************************************************
*
* ftgxval.h
*
* FreeType API for validating TrueTypeGX/AAT tables (specification).
*
* Copyright (C) 2004-2019 by
* Masatake YAMATO, Redhat K.K,
* 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.
*
*/
/****************************************************************************
*
* gxvalid is derived from both gxlayout module and otvalid module.
* Development of gxlayout is supported by the Information-technology
* Promotion Agency(IPA), Japan.
*
*/
#ifndef FTGXVAL_H_
#define FTGXVAL_H_
#include <ft2build.h>
#include FT_FREETYPE_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
FT_BEGIN_HEADER
/**************************************************************************
*
* @section:
* gx_validation
*
* @title:
* TrueTypeGX/AAT Validation
*
* @abstract:
* An API to validate TrueTypeGX/AAT tables.
*
* @description:
* This section contains the declaration of functions to validate some
* TrueTypeGX tables (feat, mort, morx, bsln, just, kern, opbd, trak,
* prop, lcar).
*
* @order:
* FT_TrueTypeGX_Validate
* FT_TrueTypeGX_Free
*
* FT_ClassicKern_Validate
* FT_ClassicKern_Free
*
* FT_VALIDATE_GX_LENGTH
* FT_VALIDATE_GXXXX
* FT_VALIDATE_CKERNXXX
*
*/
/**************************************************************************
*
*
* Warning: Use `FT_VALIDATE_XXX` to validate a table.
* Following definitions are for gxvalid developers.
*
*
*/
#define FT_VALIDATE_feat_INDEX 0
#define FT_VALIDATE_mort_INDEX 1
#define FT_VALIDATE_morx_INDEX 2
#define FT_VALIDATE_bsln_INDEX 3
#define FT_VALIDATE_just_INDEX 4
#define FT_VALIDATE_kern_INDEX 5
#define FT_VALIDATE_opbd_INDEX 6
#define FT_VALIDATE_trak_INDEX 7
#define FT_VALIDATE_prop_INDEX 8
#define FT_VALIDATE_lcar_INDEX 9
#define FT_VALIDATE_GX_LAST_INDEX FT_VALIDATE_lcar_INDEX
/**************************************************************************
*
* @macro:
* FT_VALIDATE_GX_LENGTH
*
* @description:
* The number of tables checked in this module. Use it as a parameter
* for the `table-length` argument of function @FT_TrueTypeGX_Validate.
*/
#define FT_VALIDATE_GX_LENGTH ( FT_VALIDATE_GX_LAST_INDEX + 1 )
/* */
/* Up to 0x1000 is used by otvalid.
Ox2xxx is reserved for feature OT extension. */
#define FT_VALIDATE_GX_START 0x4000
#define FT_VALIDATE_GX_BITFIELD( tag ) \
( FT_VALIDATE_GX_START << FT_VALIDATE_##tag##_INDEX )
/**************************************************************************
*
* @enum:
* FT_VALIDATE_GXXXX
*
* @description:
* A list of bit-field constants used with @FT_TrueTypeGX_Validate to
* indicate which TrueTypeGX/AAT Type tables should be validated.
*
* @values:
* FT_VALIDATE_feat ::
* Validate 'feat' table.
*
* FT_VALIDATE_mort ::
* Validate 'mort' table.
*
* FT_VALIDATE_morx ::
* Validate 'morx' table.
*
* FT_VALIDATE_bsln ::
* Validate 'bsln' table.
*
* FT_VALIDATE_just ::
* Validate 'just' table.
*
* FT_VALIDATE_kern ::
* Validate 'kern' table.
*
* FT_VALIDATE_opbd ::
* Validate 'opbd' table.
*
* FT_VALIDATE_trak ::
* Validate 'trak' table.
*
* FT_VALIDATE_prop ::
* Validate 'prop' table.
*
* FT_VALIDATE_lcar ::
* Validate 'lcar' table.
*
* FT_VALIDATE_GX ::
* Validate all TrueTypeGX tables (feat, mort, morx, bsln, just, kern,
* opbd, trak, prop and lcar).
*
*/
#define FT_VALIDATE_feat FT_VALIDATE_GX_BITFIELD( feat )
#define FT_VALIDATE_mort FT_VALIDATE_GX_BITFIELD( mort )
#define FT_VALIDATE_morx FT_VALIDATE_GX_BITFIELD( morx )
#define FT_VALIDATE_bsln FT_VALIDATE_GX_BITFIELD( bsln )
#define FT_VALIDATE_just FT_VALIDATE_GX_BITFIELD( just )
#define FT_VALIDATE_kern FT_VALIDATE_GX_BITFIELD( kern )
#define FT_VALIDATE_opbd FT_VALIDATE_GX_BITFIELD( opbd )
#define FT_VALIDATE_trak FT_VALIDATE_GX_BITFIELD( trak )
#define FT_VALIDATE_prop FT_VALIDATE_GX_BITFIELD( prop )
#define FT_VALIDATE_lcar FT_VALIDATE_GX_BITFIELD( lcar )
#define FT_VALIDATE_GX ( FT_VALIDATE_feat | \
FT_VALIDATE_mort | \
FT_VALIDATE_morx | \
FT_VALIDATE_bsln | \
FT_VALIDATE_just | \
FT_VALIDATE_kern | \
FT_VALIDATE_opbd | \
FT_VALIDATE_trak | \
FT_VALIDATE_prop | \
FT_VALIDATE_lcar )
/**************************************************************************
*
* @function:
* FT_TrueTypeGX_Validate
*
* @description:
* Validate various TrueTypeGX tables to assure that all offsets and
* indices are valid. The idea is that a higher-level library that
* actually does the text layout can access those tables without error
* checking (which can be quite time consuming).
*
* @input:
* face ::
* A handle to the input face.
*
* validation_flags ::
* A bit field that specifies the tables to be validated. See
* @FT_VALIDATE_GXXXX for possible values.
*
* table_length ::
* The size of the `tables` array. Normally, @FT_VALIDATE_GX_LENGTH
* should be passed.
*
* @output:
* tables ::
* The array where all validated sfnt tables are stored. The array
* itself must be allocated by a client.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* This function only works with TrueTypeGX fonts, returning an error
* otherwise.
*
* After use, the application should deallocate the buffers pointed to by
* each `tables` element, by calling @FT_TrueTypeGX_Free. A `NULL` value
* indicates that the table either doesn't exist in the font, the
* application hasn't asked for validation, or the validator doesn't have
* the ability to validate the sfnt table.
*/
FT_EXPORT
(
FT_Error
)
FT_TrueTypeGX_Validate
(
FT_Face
face
,
FT_UInt
validation_flags
,
FT_Bytes
tables
[
FT_VALIDATE_GX_LENGTH
],
FT_UInt
table_length
);
/**************************************************************************
*
* @function:
* FT_TrueTypeGX_Free
*
* @description:
* Free the buffer allocated by TrueTypeGX validator.
*
* @input:
* face ::
* A handle to the input face.
*
* table ::
* The pointer to the buffer allocated by @FT_TrueTypeGX_Validate.
*
* @note:
* This function must be used to free the buffer allocated by
* @FT_TrueTypeGX_Validate only.
*/
FT_EXPORT
(
void
)
FT_TrueTypeGX_Free
(
FT_Face
face
,
FT_Bytes
table
);
/**************************************************************************
*
* @enum:
* FT_VALIDATE_CKERNXXX
*
* @description:
* A list of bit-field constants used with @FT_ClassicKern_Validate to
* indicate the classic kern dialect or dialects. If the selected type
* doesn't fit, @FT_ClassicKern_Validate regards the table as invalid.
*
* @values:
* FT_VALIDATE_MS ::
* Handle the 'kern' table as a classic Microsoft kern table.
*
* FT_VALIDATE_APPLE ::
* Handle the 'kern' table as a classic Apple kern table.
*
* FT_VALIDATE_CKERN ::
* Handle the 'kern' as either classic Apple or Microsoft kern table.
*/
#define FT_VALIDATE_MS ( FT_VALIDATE_GX_START << 0 )
#define FT_VALIDATE_APPLE ( FT_VALIDATE_GX_START << 1 )
#define FT_VALIDATE_CKERN ( FT_VALIDATE_MS | FT_VALIDATE_APPLE )
/**************************************************************************
*
* @function:
* FT_ClassicKern_Validate
*
* @description:
* Validate classic (16-bit format) kern table to assure that the
* offsets and indices are valid. The idea is that a higher-level
* library that actually does the text layout can access those tables
* without error checking (which can be quite time consuming).
*
* The 'kern' table validator in @FT_TrueTypeGX_Validate deals with both
* the new 32-bit format and the classic 16-bit format, while
* FT_ClassicKern_Validate only supports the classic 16-bit format.
*
* @input:
* face ::
* A handle to the input face.
*
* validation_flags ::
* A bit field that specifies the dialect to be validated. See
* @FT_VALIDATE_CKERNXXX for possible values.
*
* @output:
* ckern_table ::
* A pointer to the kern table.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* After use, the application should deallocate the buffers pointed to by
* `ckern_table`, by calling @FT_ClassicKern_Free. A `NULL` value
* indicates that the table doesn't exist in the font.
*/
FT_EXPORT
(
FT_Error
)
FT_ClassicKern_Validate
(
FT_Face
face
,
FT_UInt
validation_flags
,
FT_Bytes
*
ckern_table
);
/**************************************************************************
*
* @function:
* FT_ClassicKern_Free
*
* @description:
* Free the buffer allocated by classic Kern validator.
*
* @input:
* face ::
* A handle to the input face.
*
* table ::
* The pointer to the buffer that is allocated by
* @FT_ClassicKern_Validate.
*
* @note:
* This function must be used to free the buffer allocated by
* @FT_ClassicKern_Validate only.
*/
FT_EXPORT
(
void
)
FT_ClassicKern_Free
(
FT_Face
face
,
FT_Bytes
table
);
/* */
FT_END_HEADER
#endif
/* FTGXVAL_H_ */
/* END */
CMU462/deps/freetype/include/freetype/ftgzip.h
0 → 100644
View file @
57023a55
/****************************************************************************
*
* ftgzip.h
*
* Gzip-compressed stream support.
*
* Copyright (C) 2002-2019 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 FTGZIP_H_
#define FTGZIP_H_
#include <ft2build.h>
#include FT_FREETYPE_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
FT_BEGIN_HEADER
/**************************************************************************
*
* @section:
* gzip
*
* @title:
* GZIP Streams
*
* @abstract:
* Using gzip-compressed font files.
*
* @description:
* This section contains the declaration of Gzip-specific functions.
*
*/
/**************************************************************************
*
* @function:
* FT_Stream_OpenGzip
*
* @description:
* Open a new stream to parse gzip-compressed font files. This is mainly
* used to support the compressed `*.pcf.gz` fonts that come with
* XFree86.
*
* @input:
* stream ::
* The target embedding stream.
*
* source ::
* The source stream.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* The source stream must be opened _before_ calling this function.
*
* Calling the internal function `FT_Stream_Close` on the new stream will
* **not** call `FT_Stream_Close` on the source stream. None of the
* stream objects will be released to the heap.
*
* The stream implementation is very basic and resets the decompression
* process each time seeking backwards is needed within the stream.
*
* In certain builds of the library, gzip compression recognition is
* automatically handled when calling @FT_New_Face or @FT_Open_Face.
* This means that if no font driver is capable of handling the raw
* compressed file, the library will try to open a gzipped stream from it
* and re-open the face with it.
*
* This function may return `FT_Err_Unimplemented_Feature` if your build
* of FreeType was not compiled with zlib support.
*/
FT_EXPORT
(
FT_Error
)
FT_Stream_OpenGzip
(
FT_Stream
stream
,
FT_Stream
source
);
/**************************************************************************
*
* @function:
* FT_Gzip_Uncompress
*
* @description:
* Decompress a zipped input buffer into an output buffer. This function
* is modeled after zlib's `uncompress` function.
*
* @input:
* memory ::
* A FreeType memory handle.
*
* input ::
* The input buffer.
*
* input_len ::
* The length of the input buffer.
*
* @output:
* output ::
* The output buffer.
*
* @inout:
* output_len ::
* Before calling the function, this is the total size of the output
* buffer, which must be large enough to hold the entire uncompressed
* data (so the size of the uncompressed data must be known in
* advance). After calling the function, `output_len` is the size of
* the used data in `output`.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* This function may return `FT_Err_Unimplemented_Feature` if your build
* of FreeType was not compiled with zlib support.
*
* @since:
* 2.5.1
*/
FT_EXPORT
(
FT_Error
)
FT_Gzip_Uncompress
(
FT_Memory
memory
,
FT_Byte
*
output
,
FT_ULong
*
output_len
,
const
FT_Byte
*
input
,
FT_ULong
input_len
);
/* */
FT_END_HEADER
#endif
/* FTGZIP_H_ */
/* END */
CMU462/deps/freetype/include/freetype/ftimage.h
0 → 100644
View file @
57023a55
/****************************************************************************
*
* ftimage.h
*
* FreeType glyph image formats and default raster interface
* (specification).
*
* Copyright (C) 1996-2019 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.
*
*/
/**************************************************************************
*
* Note: A 'raster' is simply a scan-line converter, used to render
* FT_Outlines into FT_Bitmaps.
*
*/
#ifndef FTIMAGE_H_
#define FTIMAGE_H_
/* STANDALONE_ is from ftgrays.c */
#ifndef STANDALONE_
#include <ft2build.h>
#endif
FT_BEGIN_HEADER
/**************************************************************************
*
* @section:
* basic_types
*
*/
/**************************************************************************
*
* @type:
* FT_Pos
*
* @description:
* The type FT_Pos is used to store vectorial coordinates. Depending on
* the context, these can represent distances in integer font units, or
* 16.16, or 26.6 fixed-point pixel coordinates.
*/
typedef
signed
long
FT_Pos
;
/**************************************************************************
*
* @struct:
* FT_Vector
*
* @description:
* A simple structure used to store a 2D vector; coordinates are of the
* FT_Pos type.
*
* @fields:
* x ::
* The horizontal coordinate.
* y ::
* The vertical coordinate.
*/
typedef
struct
FT_Vector_
{
FT_Pos
x
;
FT_Pos
y
;
}
FT_Vector
;
/**************************************************************************
*
* @struct:
* FT_BBox
*
* @description:
* A structure used to hold an outline's bounding box, i.e., the
* coordinates of its extrema in the horizontal and vertical directions.
*
* @fields:
* xMin ::
* The horizontal minimum (left-most).
*
* yMin ::
* The vertical minimum (bottom-most).
*
* xMax ::
* The horizontal maximum (right-most).
*
* yMax ::
* The vertical maximum (top-most).
*
* @note:
* The bounding box is specified with the coordinates of the lower left
* and the upper right corner. In PostScript, those values are often
* called (llx,lly) and (urx,ury), respectively.
*
* If `yMin` is negative, this value gives the glyph's descender.
* Otherwise, the glyph doesn't descend below the baseline. Similarly,
* if `ymax` is positive, this value gives the glyph's ascender.
*
* `xMin` gives the horizontal distance from the glyph's origin to the
* left edge of the glyph's bounding box. If `xMin` is negative, the
* glyph extends to the left of the origin.
*/
typedef
struct
FT_BBox_
{
FT_Pos
xMin
,
yMin
;
FT_Pos
xMax
,
yMax
;
}
FT_BBox
;
/**************************************************************************
*
* @enum:
* FT_Pixel_Mode
*
* @description:
* An enumeration type used to describe the format of pixels in a given
* bitmap. Note that additional formats may be added in the future.
*
* @values:
* FT_PIXEL_MODE_NONE ::
* Value~0 is reserved.
*
* FT_PIXEL_MODE_MONO ::
* A monochrome bitmap, using 1~bit per pixel. Note that pixels are
* stored in most-significant order (MSB), which means that the
* left-most pixel in a byte has value 128.
*
* FT_PIXEL_MODE_GRAY ::
* An 8-bit bitmap, generally used to represent anti-aliased glyph
* images. Each pixel is stored in one byte. Note that the number of
* 'gray' levels is stored in the `num_grays` field of the @FT_Bitmap
* structure (it generally is 256).
*
* FT_PIXEL_MODE_GRAY2 ::
* A 2-bit per pixel bitmap, used to represent embedded anti-aliased
* bitmaps in font files according to the OpenType specification. We
* haven't found a single font using this format, however.
*
* FT_PIXEL_MODE_GRAY4 ::
* A 4-bit per pixel bitmap, representing embedded anti-aliased bitmaps
* in font files according to the OpenType specification. We haven't
* found a single font using this format, however.
*
* FT_PIXEL_MODE_LCD ::
* An 8-bit bitmap, representing RGB or BGR decimated glyph images used
* for display on LCD displays; the bitmap is three times wider than
* the original glyph image. See also @FT_RENDER_MODE_LCD.
*
* FT_PIXEL_MODE_LCD_V ::
* An 8-bit bitmap, representing RGB or BGR decimated glyph images used
* for display on rotated LCD displays; the bitmap is three times
* taller than the original glyph image. See also
* @FT_RENDER_MODE_LCD_V.
*
* FT_PIXEL_MODE_BGRA ::
* [Since 2.5] An image with four 8-bit channels per pixel,
* representing a color image (such as emoticons) with alpha channel.
* For each pixel, the format is BGRA, which means, the blue channel
* comes first in memory. The color channels are pre-multiplied and in
* the sRGB colorspace. For example, full red at half-translucent
* opacity will be represented as '00,00,80,80', not '00,00,FF,80'.
* See also @FT_LOAD_COLOR.
*/
typedef
enum
FT_Pixel_Mode_
{
FT_PIXEL_MODE_NONE
=
0
,
FT_PIXEL_MODE_MONO
,
FT_PIXEL_MODE_GRAY
,
FT_PIXEL_MODE_GRAY2
,
FT_PIXEL_MODE_GRAY4
,
FT_PIXEL_MODE_LCD
,
FT_PIXEL_MODE_LCD_V
,
FT_PIXEL_MODE_BGRA
,
FT_PIXEL_MODE_MAX
/* do not remove */
}
FT_Pixel_Mode
;
/* these constants are deprecated; use the corresponding `FT_Pixel_Mode` */
/* values instead. */
#define ft_pixel_mode_none FT_PIXEL_MODE_NONE
#define ft_pixel_mode_mono FT_PIXEL_MODE_MONO
#define ft_pixel_mode_grays FT_PIXEL_MODE_GRAY
#define ft_pixel_mode_pal2 FT_PIXEL_MODE_GRAY2
#define ft_pixel_mode_pal4 FT_PIXEL_MODE_GRAY4
/**************************************************************************
*
* @struct:
* FT_Bitmap
*
* @description:
* A structure used to describe a bitmap or pixmap to the raster. Note
* that we now manage pixmaps of various depths through the `pixel_mode`
* field.
*
* @fields:
* rows ::
* The number of bitmap rows.
*
* width ::
* The number of pixels in bitmap row.
*
* pitch ::
* The pitch's absolute value is the number of bytes taken by one
* bitmap row, including padding. However, the pitch is positive when
* the bitmap has a 'down' flow, and negative when it has an 'up' flow.
* In all cases, the pitch is an offset to add to a bitmap pointer in
* order to go down one row.
*
* Note that 'padding' means the alignment of a bitmap to a byte
* border, and FreeType functions normally align to the smallest
* possible integer value.
*
* For the B/W rasterizer, `pitch` is always an even number.
*
* To change the pitch of a bitmap (say, to make it a multiple of 4),
* use @FT_Bitmap_Convert. Alternatively, you might use callback
* functions to directly render to the application's surface; see the
* file `example2.cpp` in the tutorial for a demonstration.
*
* buffer ::
* A typeless pointer to the bitmap buffer. This value should be
* aligned on 32-bit boundaries in most cases.
*
* num_grays ::
* This field is only used with @FT_PIXEL_MODE_GRAY; it gives the
* number of gray levels used in the bitmap.
*
* pixel_mode ::
* The pixel mode, i.e., how pixel bits are stored. See @FT_Pixel_Mode
* for possible values.
*
* palette_mode ::
* This field is intended for paletted pixel modes; it indicates how
* the palette is stored. Not used currently.
*
* palette ::
* A typeless pointer to the bitmap palette; this field is intended for
* paletted pixel modes. Not used currently.
*/
typedef
struct
FT_Bitmap_
{
unsigned
int
rows
;
unsigned
int
width
;
int
pitch
;
unsigned
char
*
buffer
;
unsigned
short
num_grays
;
unsigned
char
pixel_mode
;
unsigned
char
palette_mode
;
void
*
palette
;
}
FT_Bitmap
;
/**************************************************************************
*
* @section:
* outline_processing
*
*/
/**************************************************************************
*
* @struct:
* FT_Outline
*
* @description:
* This structure is used to describe an outline to the scan-line
* converter.
*
* @fields:
* n_contours ::
* The number of contours in the outline.
*
* n_points ::
* The number of points in the outline.
*
* points ::
* A pointer to an array of `n_points` @FT_Vector elements, giving the
* outline's point coordinates.
*
* tags ::
* A pointer to an array of `n_points` chars, giving each outline
* point's type.
*
* If bit~0 is unset, the point is 'off' the curve, i.e., a Bezier
* control point, while it is 'on' if set.
*
* Bit~1 is meaningful for 'off' points only. If set, it indicates a
* third-order Bezier arc control point; and a second-order control
* point if unset.
*
* If bit~2 is set, bits 5-7 contain the drop-out mode (as defined in
* the OpenType specification; the value is the same as the argument to
* the 'SCANMODE' instruction).
*
* Bits 3 and~4 are reserved for internal purposes.
*
* contours ::
* An array of `n_contours` shorts, giving the end point of each
* contour within the outline. For example, the first contour is
* defined by the points '0' to `contours[0]`, the second one is
* defined by the points `contours[0]+1` to `contours[1]`, etc.
*
* flags ::
* A set of bit flags used to characterize the outline and give hints
* to the scan-converter and hinter on how to convert/grid-fit it. See
* @FT_OUTLINE_XXX.
*
* @note:
* The B/W rasterizer only checks bit~2 in the `tags` array for the first
* point of each contour. The drop-out mode as given with
* @FT_OUTLINE_IGNORE_DROPOUTS, @FT_OUTLINE_SMART_DROPOUTS, and
* @FT_OUTLINE_INCLUDE_STUBS in `flags` is then overridden.
*/
typedef
struct
FT_Outline_
{
short
n_contours
;
/* number of contours in glyph */
short
n_points
;
/* number of points in the glyph */
FT_Vector
*
points
;
/* the outline's points */
char
*
tags
;
/* the points flags */
short
*
contours
;
/* the contour end points */
int
flags
;
/* outline masks */
}
FT_Outline
;
/* */
/* Following limits must be consistent with */
/* FT_Outline.{n_contours,n_points} */
#define FT_OUTLINE_CONTOURS_MAX SHRT_MAX
#define FT_OUTLINE_POINTS_MAX SHRT_MAX
/**************************************************************************
*
* @enum:
* FT_OUTLINE_XXX
*
* @description:
* A list of bit-field constants used for the flags in an outline's
* `flags` field.
*
* @values:
* FT_OUTLINE_NONE ::
* Value~0 is reserved.
*
* FT_OUTLINE_OWNER ::
* If set, this flag indicates that the outline's field arrays (i.e.,
* `points`, `flags`, and `contours`) are 'owned' by the outline
* object, and should thus be freed when it is destroyed.
*
* FT_OUTLINE_EVEN_ODD_FILL ::
* By default, outlines are filled using the non-zero winding rule. If
* set to 1, the outline will be filled using the even-odd fill rule
* (only works with the smooth rasterizer).
*
* FT_OUTLINE_REVERSE_FILL ::
* By default, outside contours of an outline are oriented in
* clock-wise direction, as defined in the TrueType specification.
* This flag is set if the outline uses the opposite direction
* (typically for Type~1 fonts). This flag is ignored by the scan
* converter.
*
* FT_OUTLINE_IGNORE_DROPOUTS ::
* By default, the scan converter will try to detect drop-outs in an
* outline and correct the glyph bitmap to ensure consistent shape
* continuity. If set, this flag hints the scan-line converter to
* ignore such cases. See below for more information.
*
* FT_OUTLINE_SMART_DROPOUTS ::
* Select smart dropout control. If unset, use simple dropout control.
* Ignored if @FT_OUTLINE_IGNORE_DROPOUTS is set. See below for more
* information.
*
* FT_OUTLINE_INCLUDE_STUBS ::
* If set, turn pixels on for 'stubs', otherwise exclude them. Ignored
* if @FT_OUTLINE_IGNORE_DROPOUTS is set. See below for more
* information.
*
* FT_OUTLINE_HIGH_PRECISION ::
* This flag indicates that the scan-line converter should try to
* convert this outline to bitmaps with the highest possible quality.
* It is typically set for small character sizes. Note that this is
* only a hint that might be completely ignored by a given
* scan-converter.
*
* FT_OUTLINE_SINGLE_PASS ::
* This flag is set to force a given scan-converter to only use a
* single pass over the outline to render a bitmap glyph image.
* Normally, it is set for very large character sizes. It is only a
* hint that might be completely ignored by a given scan-converter.
*
* @note:
* The flags @FT_OUTLINE_IGNORE_DROPOUTS, @FT_OUTLINE_SMART_DROPOUTS, and
* @FT_OUTLINE_INCLUDE_STUBS are ignored by the smooth rasterizer.
*
* There exists a second mechanism to pass the drop-out mode to the B/W
* rasterizer; see the `tags` field in @FT_Outline.
*
* Please refer to the description of the 'SCANTYPE' instruction in the
* OpenType specification (in file `ttinst1.doc`) how simple drop-outs,
* smart drop-outs, and stubs are defined.
*/
#define FT_OUTLINE_NONE 0x0
#define FT_OUTLINE_OWNER 0x1
#define FT_OUTLINE_EVEN_ODD_FILL 0x2
#define FT_OUTLINE_REVERSE_FILL 0x4
#define FT_OUTLINE_IGNORE_DROPOUTS 0x8
#define FT_OUTLINE_SMART_DROPOUTS 0x10
#define FT_OUTLINE_INCLUDE_STUBS 0x20
#define FT_OUTLINE_HIGH_PRECISION 0x100
#define FT_OUTLINE_SINGLE_PASS 0x200
/* these constants are deprecated; use the corresponding */
/* `FT_OUTLINE_XXX` values instead */
#define ft_outline_none FT_OUTLINE_NONE
#define ft_outline_owner FT_OUTLINE_OWNER
#define ft_outline_even_odd_fill FT_OUTLINE_EVEN_ODD_FILL
#define ft_outline_reverse_fill FT_OUTLINE_REVERSE_FILL
#define ft_outline_ignore_dropouts FT_OUTLINE_IGNORE_DROPOUTS
#define ft_outline_high_precision FT_OUTLINE_HIGH_PRECISION
#define ft_outline_single_pass FT_OUTLINE_SINGLE_PASS
/* */
#define FT_CURVE_TAG( flag ) ( flag & 0x03 )
/* see the `tags` field in `FT_Outline` for a description of the values */
#define FT_CURVE_TAG_ON 0x01
#define FT_CURVE_TAG_CONIC 0x00
#define FT_CURVE_TAG_CUBIC 0x02
#define FT_CURVE_TAG_HAS_SCANMODE 0x04
#define FT_CURVE_TAG_TOUCH_X 0x08
/* reserved for TrueType hinter */
#define FT_CURVE_TAG_TOUCH_Y 0x10
/* reserved for TrueType hinter */
#define FT_CURVE_TAG_TOUCH_BOTH ( FT_CURVE_TAG_TOUCH_X | \
FT_CURVE_TAG_TOUCH_Y )
/* values 0x20, 0x40, and 0x80 are reserved */
/* these constants are deprecated; use the corresponding */
/* `FT_CURVE_TAG_XXX` values instead */
#define FT_Curve_Tag_On FT_CURVE_TAG_ON
#define FT_Curve_Tag_Conic FT_CURVE_TAG_CONIC
#define FT_Curve_Tag_Cubic FT_CURVE_TAG_CUBIC
#define FT_Curve_Tag_Touch_X FT_CURVE_TAG_TOUCH_X
#define FT_Curve_Tag_Touch_Y FT_CURVE_TAG_TOUCH_Y
/**************************************************************************
*
* @functype:
* FT_Outline_MoveToFunc
*
* @description:
* A function pointer type used to describe the signature of a 'move to'
* function during outline walking/decomposition.
*
* A 'move to' is emitted to start a new contour in an outline.
*
* @input:
* to ::
* A pointer to the target point of the 'move to'.
*
* user ::
* A typeless pointer, which is passed from the caller of the
* decomposition function.
*
* @return:
* Error code. 0~means success.
*/
typedef
int
(
*
FT_Outline_MoveToFunc
)(
const
FT_Vector
*
to
,
void
*
user
);
#define FT_Outline_MoveTo_Func FT_Outline_MoveToFunc
/**************************************************************************
*
* @functype:
* FT_Outline_LineToFunc
*
* @description:
* A function pointer type used to describe the signature of a 'line to'
* function during outline walking/decomposition.
*
* A 'line to' is emitted to indicate a segment in the outline.
*
* @input:
* to ::
* A pointer to the target point of the 'line to'.
*
* user ::
* A typeless pointer, which is passed from the caller of the
* decomposition function.
*
* @return:
* Error code. 0~means success.
*/
typedef
int
(
*
FT_Outline_LineToFunc
)(
const
FT_Vector
*
to
,
void
*
user
);
#define FT_Outline_LineTo_Func FT_Outline_LineToFunc
/**************************************************************************
*
* @functype:
* FT_Outline_ConicToFunc
*
* @description:
* A function pointer type used to describe the signature of a 'conic to'
* function during outline walking or decomposition.
*
* A 'conic to' is emitted to indicate a second-order Bezier arc in the
* outline.
*
* @input:
* control ::
* An intermediate control point between the last position and the new
* target in `to`.
*
* to ::
* A pointer to the target end point of the conic arc.
*
* user ::
* A typeless pointer, which is passed from the caller of the
* decomposition function.
*
* @return:
* Error code. 0~means success.
*/
typedef
int
(
*
FT_Outline_ConicToFunc
)(
const
FT_Vector
*
control
,
const
FT_Vector
*
to
,
void
*
user
);
#define FT_Outline_ConicTo_Func FT_Outline_ConicToFunc
/**************************************************************************
*
* @functype:
* FT_Outline_CubicToFunc
*
* @description:
* A function pointer type used to describe the signature of a 'cubic to'
* function during outline walking or decomposition.
*
* A 'cubic to' is emitted to indicate a third-order Bezier arc.
*
* @input:
* control1 ::
* A pointer to the first Bezier control point.
*
* control2 ::
* A pointer to the second Bezier control point.
*
* to ::
* A pointer to the target end point.
*
* user ::
* A typeless pointer, which is passed from the caller of the
* decomposition function.
*
* @return:
* Error code. 0~means success.
*/
typedef
int
(
*
FT_Outline_CubicToFunc
)(
const
FT_Vector
*
control1
,
const
FT_Vector
*
control2
,
const
FT_Vector
*
to
,
void
*
user
);
#define FT_Outline_CubicTo_Func FT_Outline_CubicToFunc
/**************************************************************************
*
* @struct:
* FT_Outline_Funcs
*
* @description:
* A structure to hold various function pointers used during outline
* decomposition in order to emit segments, conic, and cubic Beziers.
*
* @fields:
* move_to ::
* The 'move to' emitter.
*
* line_to ::
* The segment emitter.
*
* conic_to ::
* The second-order Bezier arc emitter.
*
* cubic_to ::
* The third-order Bezier arc emitter.
*
* shift ::
* The shift that is applied to coordinates before they are sent to the
* emitter.
*
* delta ::
* The delta that is applied to coordinates before they are sent to the
* emitter, but after the shift.
*
* @note:
* The point coordinates sent to the emitters are the transformed version
* of the original coordinates (this is important for high accuracy
* during scan-conversion). The transformation is simple:
*
* ```
* x' = (x << shift) - delta
* y' = (y << shift) - delta
* ```
*
* Set the values of `shift` and `delta` to~0 to get the original point
* coordinates.
*/
typedef
struct
FT_Outline_Funcs_
{
FT_Outline_MoveToFunc
move_to
;
FT_Outline_LineToFunc
line_to
;
FT_Outline_ConicToFunc
conic_to
;
FT_Outline_CubicToFunc
cubic_to
;
int
shift
;
FT_Pos
delta
;
}
FT_Outline_Funcs
;
/**************************************************************************
*
* @section:
* basic_types
*
*/
/**************************************************************************
*
* @macro:
* FT_IMAGE_TAG
*
* @description:
* This macro converts four-letter tags to an unsigned long type.
*
* @note:
* Since many 16-bit compilers don't like 32-bit enumerations, you should
* redefine this macro in case of problems to something like this:
*
* ```
* #define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 ) value
* ```
*
* to get a simple enumeration without assigning special numbers.
*/
#ifndef FT_IMAGE_TAG
#define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 ) \
value = ( ( (unsigned long)_x1 << 24 ) | \
( (unsigned long)_x2 << 16 ) | \
( (unsigned long)_x3 << 8 ) | \
(unsigned long)_x4 )
#endif
/* FT_IMAGE_TAG */
/**************************************************************************
*
* @enum:
* FT_Glyph_Format
*
* @description:
* An enumeration type used to describe the format of a given glyph
* image. Note that this version of FreeType only supports two image
* formats, even though future font drivers will be able to register
* their own format.
*
* @values:
* FT_GLYPH_FORMAT_NONE ::
* The value~0 is reserved.
*
* FT_GLYPH_FORMAT_COMPOSITE ::
* The glyph image is a composite of several other images. This format
* is _only_ used with @FT_LOAD_NO_RECURSE, and is used to report
* compound glyphs (like accented characters).
*
* FT_GLYPH_FORMAT_BITMAP ::
* The glyph image is a bitmap, and can be described as an @FT_Bitmap.
* You generally need to access the `bitmap` field of the
* @FT_GlyphSlotRec structure to read it.
*
* FT_GLYPH_FORMAT_OUTLINE ::
* The glyph image is a vectorial outline made of line segments and
* Bezier arcs; it can be described as an @FT_Outline; you generally
* want to access the `outline` field of the @FT_GlyphSlotRec structure
* to read it.
*
* FT_GLYPH_FORMAT_PLOTTER ::
* The glyph image is a vectorial path with no inside and outside
* contours. Some Type~1 fonts, like those in the Hershey family,
* contain glyphs in this format. These are described as @FT_Outline,
* but FreeType isn't currently capable of rendering them correctly.
*/
typedef
enum
FT_Glyph_Format_
{
FT_IMAGE_TAG
(
FT_GLYPH_FORMAT_NONE
,
0
,
0
,
0
,
0
),
FT_IMAGE_TAG
(
FT_GLYPH_FORMAT_COMPOSITE
,
'c'
,
'o'
,
'm'
,
'p'
),
FT_IMAGE_TAG
(
FT_GLYPH_FORMAT_BITMAP
,
'b'
,
'i'
,
't'
,
's'
),
FT_IMAGE_TAG
(
FT_GLYPH_FORMAT_OUTLINE
,
'o'
,
'u'
,
't'
,
'l'
),
FT_IMAGE_TAG
(
FT_GLYPH_FORMAT_PLOTTER
,
'p'
,
'l'
,
'o'
,
't'
)
}
FT_Glyph_Format
;
/* these constants are deprecated; use the corresponding */
/* `FT_Glyph_Format` values instead. */
#define ft_glyph_format_none FT_GLYPH_FORMAT_NONE
#define ft_glyph_format_composite FT_GLYPH_FORMAT_COMPOSITE
#define ft_glyph_format_bitmap FT_GLYPH_FORMAT_BITMAP
#define ft_glyph_format_outline FT_GLYPH_FORMAT_OUTLINE
#define ft_glyph_format_plotter FT_GLYPH_FORMAT_PLOTTER
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/***** *****/
/***** R A S T E R D E F I N I T I O N S *****/
/***** *****/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/**************************************************************************
*
* A raster is a scan converter, in charge of rendering an outline into a
* bitmap. This section contains the public API for rasters.
*
* Note that in FreeType 2, all rasters are now encapsulated within
* specific modules called 'renderers'. See `ftrender.h` for more details
* on renderers.
*
*/
/**************************************************************************
*
* @section:
* raster
*
* @title:
* Scanline Converter
*
* @abstract:
* How vectorial outlines are converted into bitmaps and pixmaps.
*
* @description:
* This section contains technical definitions.
*
* @order:
* FT_Raster
* FT_Span
* FT_SpanFunc
*
* FT_Raster_Params
* FT_RASTER_FLAG_XXX
*
* FT_Raster_NewFunc
* FT_Raster_DoneFunc
* FT_Raster_ResetFunc
* FT_Raster_SetModeFunc
* FT_Raster_RenderFunc
* FT_Raster_Funcs
*
*/
/**************************************************************************
*
* @type:
* FT_Raster
*
* @description:
* An opaque handle (pointer) to a raster object. Each object can be
* used independently to convert an outline into a bitmap or pixmap.
*/
typedef
struct
FT_RasterRec_
*
FT_Raster
;
/**************************************************************************
*
* @struct:
* FT_Span
*
* @description:
* A structure used to model a single span of gray pixels when rendering
* an anti-aliased bitmap.
*
* @fields:
* x ::
* The span's horizontal start position.
*
* len ::
* The span's length in pixels.
*
* coverage ::
* The span color/coverage, ranging from 0 (background) to 255
* (foreground).
*
* @note:
* This structure is used by the span drawing callback type named
* @FT_SpanFunc that takes the y~coordinate of the span as a parameter.
*
* The coverage value is always between 0 and 255. If you want less gray
* values, the callback function has to reduce them.
*/
typedef
struct
FT_Span_
{
short
x
;
unsigned
short
len
;
unsigned
char
coverage
;
}
FT_Span
;
/**************************************************************************
*
* @functype:
* FT_SpanFunc
*
* @description:
* A function used as a call-back by the anti-aliased renderer in order
* to let client applications draw themselves the gray pixel spans on
* each scan line.
*
* @input:
* y ::
* The scanline's upward y~coordinate.
*
* count ::
* The number of spans to draw on this scanline.
*
* spans ::
* A table of `count` spans to draw on the scanline.
*
* user ::
* User-supplied data that is passed to the callback.
*
* @note:
* This callback allows client applications to directly render the gray
* spans of the anti-aliased bitmap to any kind of surfaces.
*
* This can be used to write anti-aliased outlines directly to a given
* background bitmap, and even perform translucency.
*/
typedef
void
(
*
FT_SpanFunc
)(
int
y
,
int
count
,
const
FT_Span
*
spans
,
void
*
user
);
#define FT_Raster_Span_Func FT_SpanFunc
/**************************************************************************
*
* @functype:
* FT_Raster_BitTest_Func
*
* @description:
* Deprecated, unimplemented.
*/
typedef
int
(
*
FT_Raster_BitTest_Func
)(
int
y
,
int
x
,
void
*
user
);
/**************************************************************************
*
* @functype:
* FT_Raster_BitSet_Func
*
* @description:
* Deprecated, unimplemented.
*/
typedef
void
(
*
FT_Raster_BitSet_Func
)(
int
y
,
int
x
,
void
*
user
);
/**************************************************************************
*
* @enum:
* FT_RASTER_FLAG_XXX
*
* @description:
* A list of bit flag constants as used in the `flags` field of a
* @FT_Raster_Params structure.
*
* @values:
* FT_RASTER_FLAG_DEFAULT ::
* This value is 0.
*
* FT_RASTER_FLAG_AA ::
* This flag is set to indicate that an anti-aliased glyph image should
* be generated. Otherwise, it will be monochrome (1-bit).
*
* FT_RASTER_FLAG_DIRECT ::
* This flag is set to indicate direct rendering. In this mode, client
* applications must provide their own span callback. This lets them
* directly draw or compose over an existing bitmap. If this bit is
* _not_ set, the target pixmap's buffer _must_ be zeroed before
* rendering and the output will be clipped to its size.
*
* Direct rendering is only possible with anti-aliased glyphs.
*
* FT_RASTER_FLAG_CLIP ::
* This flag is only used in direct rendering mode. If set, the output
* will be clipped to a box specified in the `clip_box` field of the
* @FT_Raster_Params structure. Otherwise, the `clip_box` is
* effectively set to the bounding box and all spans are generated.
*/
#define FT_RASTER_FLAG_DEFAULT 0x0
#define FT_RASTER_FLAG_AA 0x1
#define FT_RASTER_FLAG_DIRECT 0x2
#define FT_RASTER_FLAG_CLIP 0x4
/* these constants are deprecated; use the corresponding */
/* `FT_RASTER_FLAG_XXX` values instead */
#define ft_raster_flag_default FT_RASTER_FLAG_DEFAULT
#define ft_raster_flag_aa FT_RASTER_FLAG_AA
#define ft_raster_flag_direct FT_RASTER_FLAG_DIRECT
#define ft_raster_flag_clip FT_RASTER_FLAG_CLIP
/**************************************************************************
*
* @struct:
* FT_Raster_Params
*
* @description:
* A structure to hold the parameters used by a raster's render function,
* passed as an argument to @FT_Outline_Render.
*
* @fields:
* target ::
* The target bitmap.
*
* source ::
* A pointer to the source glyph image (e.g., an @FT_Outline).
*
* flags ::
* The rendering flags.
*
* gray_spans ::
* The gray span drawing callback.
*
* black_spans ::
* Unused.
*
* bit_test ::
* Unused.
*
* bit_set ::
* Unused.
*
* user ::
* User-supplied data that is passed to each drawing callback.
*
* clip_box ::
* An optional clipping box. It is only used in direct rendering mode.
* Note that coordinates here should be expressed in _integer_ pixels
* (and not in 26.6 fixed-point units).
*
* @note:
* An anti-aliased glyph bitmap is drawn if the @FT_RASTER_FLAG_AA bit
* flag is set in the `flags` field, otherwise a monochrome bitmap is
* generated.
*
* If the @FT_RASTER_FLAG_DIRECT bit flag is set in `flags`, the raster
* will call the `gray_spans` callback to draw gray pixel spans. This
* allows direct composition over a pre-existing bitmap through
* user-provided callbacks to perform the span drawing and composition.
* Not supported by the monochrome rasterizer.
*/
typedef
struct
FT_Raster_Params_
{
const
FT_Bitmap
*
target
;
const
void
*
source
;
int
flags
;
FT_SpanFunc
gray_spans
;
FT_SpanFunc
black_spans
;
/* unused */
FT_Raster_BitTest_Func
bit_test
;
/* unused */
FT_Raster_BitSet_Func
bit_set
;
/* unused */
void
*
user
;
FT_BBox
clip_box
;
}
FT_Raster_Params
;
/**************************************************************************
*
* @functype:
* FT_Raster_NewFunc
*
* @description:
* A function used to create a new raster object.
*
* @input:
* memory ::
* A handle to the memory allocator.
*
* @output:
* raster ::
* A handle to the new raster object.
*
* @return:
* Error code. 0~means success.
*
* @note:
* The `memory` parameter is a typeless pointer in order to avoid
* un-wanted dependencies on the rest of the FreeType code. In practice,
* it is an @FT_Memory object, i.e., a handle to the standard FreeType
* memory allocator. However, this field can be completely ignored by a
* given raster implementation.
*/
typedef
int
(
*
FT_Raster_NewFunc
)(
void
*
memory
,
FT_Raster
*
raster
);
#define FT_Raster_New_Func FT_Raster_NewFunc
/**************************************************************************
*
* @functype:
* FT_Raster_DoneFunc
*
* @description:
* A function used to destroy a given raster object.
*
* @input:
* raster ::
* A handle to the raster object.
*/
typedef
void
(
*
FT_Raster_DoneFunc
)(
FT_Raster
raster
);
#define FT_Raster_Done_Func FT_Raster_DoneFunc
/**************************************************************************
*
* @functype:
* FT_Raster_ResetFunc
*
* @description:
* FreeType used to provide an area of memory called the 'render pool'
* available to all registered rasterizers. This was not thread safe,
* however, and now FreeType never allocates this pool.
*
* This function is called after a new raster object is created.
*
* @input:
* raster ::
* A handle to the new raster object.
*
* pool_base ::
* Previously, the address in memory of the render pool. Set this to
* `NULL`.
*
* pool_size ::
* Previously, the size in bytes of the render pool. Set this to 0.
*
* @note:
* Rasterizers should rely on dynamic or stack allocation if they want to
* (a handle to the memory allocator is passed to the rasterizer
* constructor).
*/
typedef
void
(
*
FT_Raster_ResetFunc
)(
FT_Raster
raster
,
unsigned
char
*
pool_base
,
unsigned
long
pool_size
);
#define FT_Raster_Reset_Func FT_Raster_ResetFunc
/**************************************************************************
*
* @functype:
* FT_Raster_SetModeFunc
*
* @description:
* This function is a generic facility to change modes or attributes in a
* given raster. This can be used for debugging purposes, or simply to
* allow implementation-specific 'features' in a given raster module.
*
* @input:
* raster ::
* A handle to the new raster object.
*
* mode ::
* A 4-byte tag used to name the mode or property.
*
* args ::
* A pointer to the new mode/property to use.
*/
typedef
int
(
*
FT_Raster_SetModeFunc
)(
FT_Raster
raster
,
unsigned
long
mode
,
void
*
args
);
#define FT_Raster_Set_Mode_Func FT_Raster_SetModeFunc
/**************************************************************************
*
* @functype:
* FT_Raster_RenderFunc
*
* @description:
* Invoke a given raster to scan-convert a given glyph image into a
* target bitmap.
*
* @input:
* raster ::
* A handle to the raster object.
*
* params ::
* A pointer to an @FT_Raster_Params structure used to store the
* rendering parameters.
*
* @return:
* Error code. 0~means success.
*
* @note:
* The exact format of the source image depends on the raster's glyph
* format defined in its @FT_Raster_Funcs structure. It can be an
* @FT_Outline or anything else in order to support a large array of
* glyph formats.
*
* Note also that the render function can fail and return a
* `FT_Err_Unimplemented_Feature` error code if the raster used does not
* support direct composition.
*/
typedef
int
(
*
FT_Raster_RenderFunc
)(
FT_Raster
raster
,
const
FT_Raster_Params
*
params
);
#define FT_Raster_Render_Func FT_Raster_RenderFunc
/**************************************************************************
*
* @struct:
* FT_Raster_Funcs
*
* @description:
* A structure used to describe a given raster class to the library.
*
* @fields:
* glyph_format ::
* The supported glyph format for this raster.
*
* raster_new ::
* The raster constructor.
*
* raster_reset ::
* Used to reset the render pool within the raster.
*
* raster_render ::
* A function to render a glyph into a given bitmap.
*
* raster_done ::
* The raster destructor.
*/
typedef
struct
FT_Raster_Funcs_
{
FT_Glyph_Format
glyph_format
;
FT_Raster_NewFunc
raster_new
;
FT_Raster_ResetFunc
raster_reset
;
FT_Raster_SetModeFunc
raster_set_mode
;
FT_Raster_RenderFunc
raster_render
;
FT_Raster_DoneFunc
raster_done
;
}
FT_Raster_Funcs
;
/* */
FT_END_HEADER
#endif
/* FTIMAGE_H_ */
/* END */
/* Local Variables: */
/* coding: utf-8 */
/* End: */
CMU462/deps/freetype/include/freetype/ftincrem.h
0 → 100644
View file @
57023a55
/****************************************************************************
*
* ftincrem.h
*
* FreeType incremental loading (specification).
*
* Copyright (C) 2002-2019 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 FTINCREM_H_
#define FTINCREM_H_
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_PARAMETER_TAGS_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
FT_BEGIN_HEADER
/**************************************************************************
*
* @section:
* incremental
*
* @title:
* Incremental Loading
*
* @abstract:
* Custom Glyph Loading.
*
* @description:
* This section contains various functions used to perform so-called
* 'incremental' glyph loading. This is a mode where all glyphs loaded
* from a given @FT_Face are provided by the client application.
*
* Apart from that, all other tables are loaded normally from the font
* file. This mode is useful when FreeType is used within another
* engine, e.g., a PostScript Imaging Processor.
*
* To enable this mode, you must use @FT_Open_Face, passing an
* @FT_Parameter with the @FT_PARAM_TAG_INCREMENTAL tag and an
* @FT_Incremental_Interface value. See the comments for
* @FT_Incremental_InterfaceRec for an example.
*
*/
/**************************************************************************
*
* @type:
* FT_Incremental
*
* @description:
* An opaque type describing a user-provided object used to implement
* 'incremental' glyph loading within FreeType. This is used to support
* embedded fonts in certain environments (e.g., PostScript
* interpreters), where the glyph data isn't in the font file, or must be
* overridden by different values.
*
* @note:
* It is up to client applications to create and implement
* @FT_Incremental objects, as long as they provide implementations for
* the methods @FT_Incremental_GetGlyphDataFunc,
* @FT_Incremental_FreeGlyphDataFunc and
* @FT_Incremental_GetGlyphMetricsFunc.
*
* See the description of @FT_Incremental_InterfaceRec to understand how
* to use incremental objects with FreeType.
*
*/
typedef
struct
FT_IncrementalRec_
*
FT_Incremental
;
/**************************************************************************
*
* @struct:
* FT_Incremental_MetricsRec
*
* @description:
* A small structure used to contain the basic glyph metrics returned by
* the @FT_Incremental_GetGlyphMetricsFunc method.
*
* @fields:
* bearing_x ::
* Left bearing, in font units.
*
* bearing_y ::
* Top bearing, in font units.
*
* advance ::
* Horizontal component of glyph advance, in font units.
*
* advance_v ::
* Vertical component of glyph advance, in font units.
*
* @note:
* These correspond to horizontal or vertical metrics depending on the
* value of the `vertical` argument to the function
* @FT_Incremental_GetGlyphMetricsFunc.
*
*/
typedef
struct
FT_Incremental_MetricsRec_
{
FT_Long
bearing_x
;
FT_Long
bearing_y
;
FT_Long
advance
;
FT_Long
advance_v
;
/* since 2.3.12 */
}
FT_Incremental_MetricsRec
;
/**************************************************************************
*
* @struct:
* FT_Incremental_Metrics
*
* @description:
* A handle to an @FT_Incremental_MetricsRec structure.
*
*/
typedef
struct
FT_Incremental_MetricsRec_
*
FT_Incremental_Metrics
;
/**************************************************************************
*
* @type:
* FT_Incremental_GetGlyphDataFunc
*
* @description:
* A function called by FreeType to access a given glyph's data bytes
* during @FT_Load_Glyph or @FT_Load_Char if incremental loading is
* enabled.
*
* Note that the format of the glyph's data bytes depends on the font
* file format. For TrueType, it must correspond to the raw bytes within
* the 'glyf' table. For PostScript formats, it must correspond to the
* **unencrypted** charstring bytes, without any `lenIV` header. It is
* undefined for any other format.
*
* @input:
* incremental ::
* Handle to an opaque @FT_Incremental handle provided by the client
* application.
*
* glyph_index ::
* Index of relevant glyph.
*
* @output:
* adata ::
* A structure describing the returned glyph data bytes (which will be
* accessed as a read-only byte block).
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* If this function returns successfully the method
* @FT_Incremental_FreeGlyphDataFunc will be called later to release the
* data bytes.
*
* Nested calls to @FT_Incremental_GetGlyphDataFunc can happen for
* compound glyphs.
*
*/
typedef
FT_Error
(
*
FT_Incremental_GetGlyphDataFunc
)(
FT_Incremental
incremental
,
FT_UInt
glyph_index
,
FT_Data
*
adata
);
/**************************************************************************
*
* @type:
* FT_Incremental_FreeGlyphDataFunc
*
* @description:
* A function used to release the glyph data bytes returned by a
* successful call to @FT_Incremental_GetGlyphDataFunc.
*
* @input:
* incremental ::
* A handle to an opaque @FT_Incremental handle provided by the client
* application.
*
* data ::
* A structure describing the glyph data bytes (which will be accessed
* as a read-only byte block).
*
*/
typedef
void
(
*
FT_Incremental_FreeGlyphDataFunc
)(
FT_Incremental
incremental
,
FT_Data
*
data
);
/**************************************************************************
*
* @type:
* FT_Incremental_GetGlyphMetricsFunc
*
* @description:
* A function used to retrieve the basic metrics of a given glyph index
* before accessing its data. This is necessary because, in certain
* formats like TrueType, the metrics are stored in a different place
* from the glyph images proper.
*
* @input:
* incremental ::
* A handle to an opaque @FT_Incremental handle provided by the client
* application.
*
* glyph_index ::
* Index of relevant glyph.
*
* vertical ::
* If true, return vertical metrics.
*
* ametrics ::
* This parameter is used for both input and output. The original
* glyph metrics, if any, in font units. If metrics are not available
* all the values must be set to zero.
*
* @output:
* ametrics ::
* The replacement glyph metrics in font units.
*
*/
typedef
FT_Error
(
*
FT_Incremental_GetGlyphMetricsFunc
)
(
FT_Incremental
incremental
,
FT_UInt
glyph_index
,
FT_Bool
vertical
,
FT_Incremental_MetricsRec
*
ametrics
);
/**************************************************************************
*
* @struct:
* FT_Incremental_FuncsRec
*
* @description:
* A table of functions for accessing fonts that load data incrementally.
* Used in @FT_Incremental_InterfaceRec.
*
* @fields:
* get_glyph_data ::
* The function to get glyph data. Must not be null.
*
* free_glyph_data ::
* The function to release glyph data. Must not be null.
*
* get_glyph_metrics ::
* The function to get glyph metrics. May be null if the font does not
* provide overriding glyph metrics.
*
*/
typedef
struct
FT_Incremental_FuncsRec_
{
FT_Incremental_GetGlyphDataFunc
get_glyph_data
;
FT_Incremental_FreeGlyphDataFunc
free_glyph_data
;
FT_Incremental_GetGlyphMetricsFunc
get_glyph_metrics
;
}
FT_Incremental_FuncsRec
;
/**************************************************************************
*
* @struct:
* FT_Incremental_InterfaceRec
*
* @description:
* A structure to be used with @FT_Open_Face to indicate that the user
* wants to support incremental glyph loading. You should use it with
* @FT_PARAM_TAG_INCREMENTAL as in the following example:
*
* ```
* FT_Incremental_InterfaceRec inc_int;
* FT_Parameter parameter;
* FT_Open_Args open_args;
*
*
* // set up incremental descriptor
* inc_int.funcs = my_funcs;
* inc_int.object = my_object;
*
* // set up optional parameter
* parameter.tag = FT_PARAM_TAG_INCREMENTAL;
* parameter.data = &inc_int;
*
* // set up FT_Open_Args structure
* open_args.flags = FT_OPEN_PATHNAME | FT_OPEN_PARAMS;
* open_args.pathname = my_font_pathname;
* open_args.num_params = 1;
* open_args.params = ¶meter; // we use one optional argument
*
* // open the font
* error = FT_Open_Face( library, &open_args, index, &face );
* ...
* ```
*
*/
typedef
struct
FT_Incremental_InterfaceRec_
{
const
FT_Incremental_FuncsRec
*
funcs
;
FT_Incremental
object
;
}
FT_Incremental_InterfaceRec
;
/**************************************************************************
*
* @type:
* FT_Incremental_Interface
*
* @description:
* A pointer to an @FT_Incremental_InterfaceRec structure.
*
*/
typedef
FT_Incremental_InterfaceRec
*
FT_Incremental_Interface
;
/* */
FT_END_HEADER
#endif
/* FTINCREM_H_ */
/* END */
CMU462/deps/freetype/include/freetype/ftlcdfil.h
0 → 100644
View file @
57023a55
/****************************************************************************
*
* ftlcdfil.h
*
* FreeType API for color filtering of subpixel bitmap glyphs
* (specification).
*
* Copyright (C) 2006-2019 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 FTLCDFIL_H_
#define FTLCDFIL_H_
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_PARAMETER_TAGS_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
FT_BEGIN_HEADER
/**************************************************************************
*
* @section:
* lcd_rendering
*
* @title:
* Subpixel Rendering
*
* @abstract:
* API to control subpixel rendering.
*
* @description:
* FreeType provides two alternative subpixel rendering technologies.
* Should you define `FT_CONFIG_OPTION_SUBPIXEL_RENDERING` in your
* `ftoption.h` file, this enables patented ClearType-style rendering.
* Otherwise, Harmony LCD rendering is enabled. These technologies are
* controlled differently and API described below, although always
* available, performs its function when appropriate method is enabled
* and does nothing otherwise.
*
* ClearType-style LCD rendering exploits the color-striped structure of
* LCD pixels, increasing the available resolution in the direction of
* the stripe (usually horizontal RGB) by a factor of~3. Using the
* subpixels coverages unfiltered can create severe color fringes
* especially when rendering thin features. Indeed, to produce
* black-on-white text, the nearby color subpixels must be dimmed
* equally.
*
* A good 5-tap FIR filter should be applied to subpixel coverages
* regardless of pixel boundaries and should have these properties:
*
* 1. It should be symmetrical, like {~a, b, c, b, a~}, to avoid
* any shifts in appearance.
*
* 2. It should be color-balanced, meaning a~+ b~=~c, to reduce color
* fringes by distributing the computed coverage for one subpixel to
* all subpixels equally.
*
* 3. It should be normalized, meaning 2a~+ 2b~+ c~=~1.0 to maintain
* overall brightness.
*
* Boxy 3-tap filter {0, 1/3, 1/3, 1/3, 0} is sharper but is less
* forgiving of non-ideal gamma curves of a screen (and viewing angles),
* beveled filters are fuzzier but more tolerant.
*
* Use the @FT_Library_SetLcdFilter or @FT_Library_SetLcdFilterWeights
* API to specify a low-pass filter, which is then applied to
* subpixel-rendered bitmaps generated through @FT_Render_Glyph.
*
* Harmony LCD rendering is suitable to panels with any regular subpixel
* structure, not just monitors with 3 color striped subpixels, as long
* as the color subpixels have fixed positions relative to the pixel
* center. In this case, each color channel is then rendered separately
* after shifting the outline opposite to the subpixel shift so that the
* coverage maps are aligned. This method is immune to color fringes
* because the shifts do not change integral coverage.
*
* The subpixel geometry must be specified by xy-coordinates for each
* subpixel. By convention they may come in the RGB order: {{-1/3, 0},
* {0, 0}, {1/3, 0}} for standard RGB striped panel or {{-1/6, 1/4},
* {-1/6, -1/4}, {1/3, 0}} for a certain PenTile panel.
*
* Use the @FT_Library_SetLcdGeometry API to specify subpixel positions.
* If one follows the RGB order convention, the same order applies to the
* resulting @FT_PIXEL_MODE_LCD and @FT_PIXEL_MODE_LCD_V bitmaps. Note,
* however, that the coordinate frame for the latter must be rotated
* clockwise. Harmony with default LCD geometry is equivalent to
* ClearType with light filter.
*
* As a result of ClearType filtering or Harmony rendering, the
* dimensions of LCD bitmaps can be either wider or taller than the
* dimensions of the corresponding outline with regard to the pixel grid.
* For example, for @FT_RENDER_MODE_LCD, the filter adds 2~subpixels to
* the left, and 2~subpixels to the right. The bitmap offset values are
* adjusted accordingly, so clients shouldn't need to modify their layout
* and glyph positioning code when enabling the filter.
*
* The ClearType and Harmony rendering is applicable to glyph bitmaps
* rendered through @FT_Render_Glyph, @FT_Load_Glyph, @FT_Load_Char, and
* @FT_Glyph_To_Bitmap, when @FT_RENDER_MODE_LCD or @FT_RENDER_MODE_LCD_V
* is specified. This API does not control @FT_Outline_Render and
* @FT_Outline_Get_Bitmap.
*
* The described algorithms can completely remove color artefacts when
* combined with gamma-corrected alpha blending in linear space. Each of
* the 3~alpha values (subpixels) must by independently used to blend one
* color channel. That is, red alpha blends the red channel of the text
* color with the red channel of the background pixel.
*/
/**************************************************************************
*
* @enum:
* FT_LcdFilter
*
* @description:
* A list of values to identify various types of LCD filters.
*
* @values:
* FT_LCD_FILTER_NONE ::
* Do not perform filtering. When used with subpixel rendering, this
* results in sometimes severe color fringes.
*
* FT_LCD_FILTER_DEFAULT ::
* This is a beveled, normalized, and color-balanced five-tap filter
* with weights of [0x08 0x4D 0x56 0x4D 0x08] in 1/256th units.
*
* FT_LCD_FILTER_LIGHT ::
* this is a boxy, normalized, and color-balanced three-tap filter with
* weights of [0x00 0x55 0x56 0x55 0x00] in 1/256th units.
*
* FT_LCD_FILTER_LEGACY ::
* FT_LCD_FILTER_LEGACY1 ::
* This filter corresponds to the original libXft color filter. It
* provides high contrast output but can exhibit really bad color
* fringes if glyphs are not extremely well hinted to the pixel grid.
* This filter is only provided for comparison purposes, and might be
* disabled or stay unsupported in the future. The second value is
* provided for compatibility with FontConfig, which historically used
* different enumeration, sometimes incorrectly forwarded to FreeType.
*
* @since:
* 2.3.0 (`FT_LCD_FILTER_LEGACY1` since 2.6.2)
*/
typedef
enum
FT_LcdFilter_
{
FT_LCD_FILTER_NONE
=
0
,
FT_LCD_FILTER_DEFAULT
=
1
,
FT_LCD_FILTER_LIGHT
=
2
,
FT_LCD_FILTER_LEGACY1
=
3
,
FT_LCD_FILTER_LEGACY
=
16
,
FT_LCD_FILTER_MAX
/* do not remove */
}
FT_LcdFilter
;
/**************************************************************************
*
* @function:
* FT_Library_SetLcdFilter
*
* @description:
* This function is used to apply color filtering to LCD decimated
* bitmaps, like the ones used when calling @FT_Render_Glyph with
* @FT_RENDER_MODE_LCD or @FT_RENDER_MODE_LCD_V.
*
* @input:
* library ::
* A handle to the target library instance.
*
* filter ::
* The filter type.
*
* You can use @FT_LCD_FILTER_NONE here to disable this feature, or
* @FT_LCD_FILTER_DEFAULT to use a default filter that should work well
* on most LCD screens.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* This feature is always disabled by default. Clients must make an
* explicit call to this function with a `filter` value other than
* @FT_LCD_FILTER_NONE in order to enable it.
*
* Due to **PATENTS** covering subpixel rendering, this function doesn't
* do anything except returning `FT_Err_Unimplemented_Feature` if the
* configuration macro `FT_CONFIG_OPTION_SUBPIXEL_RENDERING` is not
* defined in your build of the library, which should correspond to all
* default builds of FreeType.
*
* @since:
* 2.3.0
*/
FT_EXPORT
(
FT_Error
)
FT_Library_SetLcdFilter
(
FT_Library
library
,
FT_LcdFilter
filter
);
/**************************************************************************
*
* @function:
* FT_Library_SetLcdFilterWeights
*
* @description:
* This function can be used to enable LCD filter with custom weights,
* instead of using presets in @FT_Library_SetLcdFilter.
*
* @input:
* library ::
* A handle to the target library instance.
*
* weights ::
* A pointer to an array; the function copies the first five bytes and
* uses them to specify the filter weights in 1/256th units.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* Due to **PATENTS** covering subpixel rendering, this function doesn't
* do anything except returning `FT_Err_Unimplemented_Feature` if the
* configuration macro `FT_CONFIG_OPTION_SUBPIXEL_RENDERING` is not
* defined in your build of the library, which should correspond to all
* default builds of FreeType.
*
* LCD filter weights can also be set per face using @FT_Face_Properties
* with @FT_PARAM_TAG_LCD_FILTER_WEIGHTS.
*
* @since:
* 2.4.0
*/
FT_EXPORT
(
FT_Error
)
FT_Library_SetLcdFilterWeights
(
FT_Library
library
,
unsigned
char
*
weights
);
/**************************************************************************
*
* @type:
* FT_LcdFiveTapFilter
*
* @description:
* A typedef for passing the five LCD filter weights to
* @FT_Face_Properties within an @FT_Parameter structure.
*
* @since:
* 2.8
*
*/
#define FT_LCD_FILTER_FIVE_TAPS 5
typedef
FT_Byte
FT_LcdFiveTapFilter
[
FT_LCD_FILTER_FIVE_TAPS
];
/**************************************************************************
*
* @function:
* FT_Library_SetLcdGeometry
*
* @description:
* This function can be used to modify default positions of color
* subpixels, which controls Harmony LCD rendering.
*
* @input:
* library ::
* A handle to the target library instance.
*
* sub ::
* A pointer to an array of 3 vectors in 26.6 fractional pixel format;
* the function modifies the default values, see the note below.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* Subpixel geometry examples:
*
* - {{-21, 0}, {0, 0}, {21, 0}} is the default, corresponding to 3 color
* stripes shifted by a third of a pixel. This could be an RGB panel.
*
* - {{21, 0}, {0, 0}, {-21, 0}} looks the same as the default but can
* specify a BGR panel instead, while keeping the bitmap in the same
* RGB888 format.
*
* - {{0, 21}, {0, 0}, {0, -21}} is the vertical RGB, but the bitmap
* stays RGB888 as a result.
*
* - {{-11, 16}, {-11, -16}, {22, 0}} is a certain PenTile arrangement.
*
* This function does nothing and returns `FT_Err_Unimplemented_Feature`
* in the context of ClearType-style subpixel rendering when
* `FT_CONFIG_OPTION_SUBPIXEL_RENDERING` is defined in your build of the
* library.
*
* @since:
* 2.10.0
*/
FT_EXPORT
(
FT_Error
)
FT_Library_SetLcdGeometry
(
FT_Library
library
,
FT_Vector
sub
[
3
]
);
/* */
FT_END_HEADER
#endif
/* FTLCDFIL_H_ */
/* END */
CMU462/deps/freetype/include/freetype/ftlist.h
0 → 100644
View file @
57023a55
/****************************************************************************
*
* ftlist.h
*
* Generic list support for FreeType (specification).
*
* Copyright (C) 1996-2019 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 implements functions relative to list processing. Its data
* structures are defined in `freetype.h`.
*
*/
#ifndef FTLIST_H_
#define FTLIST_H_
#include <ft2build.h>
#include FT_FREETYPE_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
FT_BEGIN_HEADER
/**************************************************************************
*
* @section:
* list_processing
*
* @title:
* List Processing
*
* @abstract:
* Simple management of lists.
*
* @description:
* This section contains various definitions related to list processing
* using doubly-linked nodes.
*
* @order:
* FT_List
* FT_ListNode
* FT_ListRec
* FT_ListNodeRec
*
* FT_List_Add
* FT_List_Insert
* FT_List_Find
* FT_List_Remove
* FT_List_Up
* FT_List_Iterate
* FT_List_Iterator
* FT_List_Finalize
* FT_List_Destructor
*
*/
/**************************************************************************
*
* @function:
* FT_List_Find
*
* @description:
* Find the list node for a given listed object.
*
* @input:
* list ::
* A pointer to the parent list.
* data ::
* The address of the listed object.
*
* @return:
* List node. `NULL` if it wasn't found.
*/
FT_EXPORT
(
FT_ListNode
)
FT_List_Find
(
FT_List
list
,
void
*
data
);
/**************************************************************************
*
* @function:
* FT_List_Add
*
* @description:
* Append an element to the end of a list.
*
* @inout:
* list ::
* A pointer to the parent list.
* node ::
* The node to append.
*/
FT_EXPORT
(
void
)
FT_List_Add
(
FT_List
list
,
FT_ListNode
node
);
/**************************************************************************
*
* @function:
* FT_List_Insert
*
* @description:
* Insert an element at the head of a list.
*
* @inout:
* list ::
* A pointer to parent list.
* node ::
* The node to insert.
*/
FT_EXPORT
(
void
)
FT_List_Insert
(
FT_List
list
,
FT_ListNode
node
);
/**************************************************************************
*
* @function:
* FT_List_Remove
*
* @description:
* Remove a node from a list. This function doesn't check whether the
* node is in the list!
*
* @input:
* node ::
* The node to remove.
*
* @inout:
* list ::
* A pointer to the parent list.
*/
FT_EXPORT
(
void
)
FT_List_Remove
(
FT_List
list
,
FT_ListNode
node
);
/**************************************************************************
*
* @function:
* FT_List_Up
*
* @description:
* Move a node to the head/top of a list. Used to maintain LRU lists.
*
* @inout:
* list ::
* A pointer to the parent list.
* node ::
* The node to move.
*/
FT_EXPORT
(
void
)
FT_List_Up
(
FT_List
list
,
FT_ListNode
node
);
/**************************************************************************
*
* @functype:
* FT_List_Iterator
*
* @description:
* An FT_List iterator function that is called during a list parse by
* @FT_List_Iterate.
*
* @input:
* node ::
* The current iteration list node.
*
* user ::
* A typeless pointer passed to @FT_List_Iterate. Can be used to point
* to the iteration's state.
*/
typedef
FT_Error
(
*
FT_List_Iterator
)(
FT_ListNode
node
,
void
*
user
);
/**************************************************************************
*
* @function:
* FT_List_Iterate
*
* @description:
* Parse a list and calls a given iterator function on each element.
* Note that parsing is stopped as soon as one of the iterator calls
* returns a non-zero value.
*
* @input:
* list ::
* A handle to the list.
* iterator ::
* An iterator function, called on each node of the list.
* user ::
* A user-supplied field that is passed as the second argument to the
* iterator.
*
* @return:
* The result (a FreeType error code) of the last iterator call.
*/
FT_EXPORT
(
FT_Error
)
FT_List_Iterate
(
FT_List
list
,
FT_List_Iterator
iterator
,
void
*
user
);
/**************************************************************************
*
* @functype:
* FT_List_Destructor
*
* @description:
* An @FT_List iterator function that is called during a list
* finalization by @FT_List_Finalize to destroy all elements in a given
* list.
*
* @input:
* system ::
* The current system object.
*
* data ::
* The current object to destroy.
*
* user ::
* A typeless pointer passed to @FT_List_Iterate. It can be used to
* point to the iteration's state.
*/
typedef
void
(
*
FT_List_Destructor
)(
FT_Memory
memory
,
void
*
data
,
void
*
user
);
/**************************************************************************
*
* @function:
* FT_List_Finalize
*
* @description:
* Destroy all elements in the list as well as the list itself.
*
* @input:
* list ::
* A handle to the list.
*
* destroy ::
* A list destructor that will be applied to each element of the list.
* Set this to `NULL` if not needed.
*
* memory ::
* The current memory object that handles deallocation.
*
* user ::
* A user-supplied field that is passed as the last argument to the
* destructor.
*
* @note:
* This function expects that all nodes added by @FT_List_Add or
* @FT_List_Insert have been dynamically allocated.
*/
FT_EXPORT
(
void
)
FT_List_Finalize
(
FT_List
list
,
FT_List_Destructor
destroy
,
FT_Memory
memory
,
void
*
user
);
/* */
FT_END_HEADER
#endif
/* FTLIST_H_ */
/* END */
CMU462/deps/freetype/include/freetype/ftlzw.h
0 → 100644
View file @
57023a55
/****************************************************************************
*
* ftlzw.h
*
* LZW-compressed stream support.
*
* Copyright (C) 2004-2019 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 FTLZW_H_
#define FTLZW_H_
#include <ft2build.h>
#include FT_FREETYPE_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
FT_BEGIN_HEADER
/**************************************************************************
*
* @section:
* lzw
*
* @title:
* LZW Streams
*
* @abstract:
* Using LZW-compressed font files.
*
* @description:
* This section contains the declaration of LZW-specific functions.
*
*/
/**************************************************************************
*
* @function:
* FT_Stream_OpenLZW
*
* @description:
* Open a new stream to parse LZW-compressed font files. This is mainly
* used to support the compressed `*.pcf.Z` fonts that come with XFree86.
*
* @input:
* stream ::
* The target embedding stream.
*
* source ::
* The source stream.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* The source stream must be opened _before_ calling this function.
*
* Calling the internal function `FT_Stream_Close` on the new stream will
* **not** call `FT_Stream_Close` on the source stream. None of the
* stream objects will be released to the heap.
*
* The stream implementation is very basic and resets the decompression
* process each time seeking backwards is needed within the stream
*
* In certain builds of the library, LZW compression recognition is
* automatically handled when calling @FT_New_Face or @FT_Open_Face.
* This means that if no font driver is capable of handling the raw
* compressed file, the library will try to open a LZW stream from it and
* re-open the face with it.
*
* This function may return `FT_Err_Unimplemented_Feature` if your build
* of FreeType was not compiled with LZW support.
*/
FT_EXPORT
(
FT_Error
)
FT_Stream_OpenLZW
(
FT_Stream
stream
,
FT_Stream
source
);
/* */
FT_END_HEADER
#endif
/* FTLZW_H_ */
/* END */
CMU462/deps/freetype/include/freetype/ftmac.h
0 → 100644
View file @
57023a55
/****************************************************************************
*
* ftmac.h
*
* Additional Mac-specific API.
*
* Copyright (C) 1996-2019 by
* Just van Rossum, 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.
*
*/
/****************************************************************************
*
* NOTE: Include this file after `FT_FREETYPE_H` and after any
* Mac-specific headers (because this header uses Mac types such as
* 'Handle', 'FSSpec', 'FSRef', etc.)
*
*/
#ifndef FTMAC_H_
#define FTMAC_H_
#include <ft2build.h>
FT_BEGIN_HEADER
/* gcc-3.1 and later can warn about functions tagged as deprecated */
#ifndef FT_DEPRECATED_ATTRIBUTE
#if defined( __GNUC__ ) && \
( ( __GNUC__ >= 4 ) || \
( ( __GNUC__ == 3 ) && ( __GNUC_MINOR__ >= 1 ) ) )
#define FT_DEPRECATED_ATTRIBUTE __attribute__(( deprecated ))
#else
#define FT_DEPRECATED_ATTRIBUTE
#endif
#endif
/**************************************************************************
*
* @section:
* mac_specific
*
* @title:
* Mac Specific Interface
*
* @abstract:
* Only available on the Macintosh.
*
* @description:
* The following definitions are only available if FreeType is compiled
* on a Macintosh.
*
*/
/**************************************************************************
*
* @function:
* FT_New_Face_From_FOND
*
* @description:
* Create a new face object from a FOND resource.
*
* @inout:
* library ::
* A handle to the library resource.
*
* @input:
* fond ::
* A FOND resource.
*
* face_index ::
* Only supported for the -1 'sanity check' special case.
*
* @output:
* aface ::
* A handle to a new face object.
*
* @return:
* FreeType error code. 0~means success.
*
* @example:
* This function can be used to create @FT_Face objects from fonts that
* are installed in the system as follows.
*
* ```
* fond = GetResource( 'FOND', fontName );
* error = FT_New_Face_From_FOND( library, fond, 0, &face );
* ```
*/
FT_EXPORT
(
FT_Error
)
FT_New_Face_From_FOND
(
FT_Library
library
,
Handle
fond
,
FT_Long
face_index
,
FT_Face
*
aface
)
FT_DEPRECATED_ATTRIBUTE
;
/**************************************************************************
*
* @function:
* FT_GetFile_From_Mac_Name
*
* @description:
* Return an FSSpec for the disk file containing the named font.
*
* @input:
* fontName ::
* Mac OS name of the font (e.g., Times New Roman Bold).
*
* @output:
* pathSpec ::
* FSSpec to the file. For passing to @FT_New_Face_From_FSSpec.
*
* face_index ::
* Index of the face. For passing to @FT_New_Face_From_FSSpec.
*
* @return:
* FreeType error code. 0~means success.
*/
FT_EXPORT
(
FT_Error
)
FT_GetFile_From_Mac_Name
(
const
char
*
fontName
,
FSSpec
*
pathSpec
,
FT_Long
*
face_index
)
FT_DEPRECATED_ATTRIBUTE
;
/**************************************************************************
*
* @function:
* FT_GetFile_From_Mac_ATS_Name
*
* @description:
* Return an FSSpec for the disk file containing the named font.
*
* @input:
* fontName ::
* Mac OS name of the font in ATS framework.
*
* @output:
* pathSpec ::
* FSSpec to the file. For passing to @FT_New_Face_From_FSSpec.
*
* face_index ::
* Index of the face. For passing to @FT_New_Face_From_FSSpec.
*
* @return:
* FreeType error code. 0~means success.
*/
FT_EXPORT
(
FT_Error
)
FT_GetFile_From_Mac_ATS_Name
(
const
char
*
fontName
,
FSSpec
*
pathSpec
,
FT_Long
*
face_index
)
FT_DEPRECATED_ATTRIBUTE
;
/**************************************************************************
*
* @function:
* FT_GetFilePath_From_Mac_ATS_Name
*
* @description:
* Return a pathname of the disk file and face index for given font name
* that is handled by ATS framework.
*
* @input:
* fontName ::
* Mac OS name of the font in ATS framework.
*
* @output:
* path ::
* Buffer to store pathname of the file. For passing to @FT_New_Face.
* The client must allocate this buffer before calling this function.
*
* maxPathSize ::
* Lengths of the buffer `path` that client allocated.
*
* face_index ::
* Index of the face. For passing to @FT_New_Face.
*
* @return:
* FreeType error code. 0~means success.
*/
FT_EXPORT
(
FT_Error
)
FT_GetFilePath_From_Mac_ATS_Name
(
const
char
*
fontName
,
UInt8
*
path
,
UInt32
maxPathSize
,
FT_Long
*
face_index
)
FT_DEPRECATED_ATTRIBUTE
;
/**************************************************************************
*
* @function:
* FT_New_Face_From_FSSpec
*
* @description:
* Create a new face object from a given resource and typeface index
* using an FSSpec to the font file.
*
* @inout:
* library ::
* A handle to the library resource.
*
* @input:
* spec ::
* FSSpec to the font file.
*
* face_index ::
* The index of the face within the resource. The first face has
* index~0.
* @output:
* aface ::
* A handle to a new face object.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* @FT_New_Face_From_FSSpec is identical to @FT_New_Face except it
* accepts an FSSpec instead of a path.
*/
FT_EXPORT
(
FT_Error
)
FT_New_Face_From_FSSpec
(
FT_Library
library
,
const
FSSpec
*
spec
,
FT_Long
face_index
,
FT_Face
*
aface
)
FT_DEPRECATED_ATTRIBUTE
;
/**************************************************************************
*
* @function:
* FT_New_Face_From_FSRef
*
* @description:
* Create a new face object from a given resource and typeface index
* using an FSRef to the font file.
*
* @inout:
* library ::
* A handle to the library resource.
*
* @input:
* spec ::
* FSRef to the font file.
*
* face_index ::
* The index of the face within the resource. The first face has
* index~0.
* @output:
* aface ::
* A handle to a new face object.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* @FT_New_Face_From_FSRef is identical to @FT_New_Face except it accepts
* an FSRef instead of a path.
*/
FT_EXPORT
(
FT_Error
)
FT_New_Face_From_FSRef
(
FT_Library
library
,
const
FSRef
*
ref
,
FT_Long
face_index
,
FT_Face
*
aface
)
FT_DEPRECATED_ATTRIBUTE
;
/* */
FT_END_HEADER
#endif
/* FTMAC_H_ */
/* END */
CMU462/deps/freetype/include/freetype/ftmm.h
0 → 100644
View file @
57023a55
/****************************************************************************
*
* ftmm.h
*
* FreeType Multiple Master font interface (specification).
*
* Copyright (C) 1996-2019 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 FTMM_H_
#define FTMM_H_
#include <ft2build.h>
#include FT_TYPE1_TABLES_H
FT_BEGIN_HEADER
/**************************************************************************
*
* @section:
* multiple_masters
*
* @title:
* Multiple Masters
*
* @abstract:
* How to manage Multiple Masters fonts.
*
* @description:
* The following types and functions are used to manage Multiple Master
* fonts, i.e., the selection of specific design instances by setting
* design axis coordinates.
*
* Besides Adobe MM fonts, the interface supports Apple's TrueType GX and
* OpenType variation fonts. Some of the routines only work with Adobe
* MM fonts, others will work with all three types. They are similar
* enough that a consistent interface makes sense.
*
*/
/**************************************************************************
*
* @struct:
* FT_MM_Axis
*
* @description:
* A structure to model a given axis in design space for Multiple Masters
* fonts.
*
* This structure can't be used for TrueType GX or OpenType variation
* fonts.
*
* @fields:
* name ::
* The axis's name.
*
* minimum ::
* The axis's minimum design coordinate.
*
* maximum ::
* The axis's maximum design coordinate.
*/
typedef
struct
FT_MM_Axis_
{
FT_String
*
name
;
FT_Long
minimum
;
FT_Long
maximum
;
}
FT_MM_Axis
;
/**************************************************************************
*
* @struct:
* FT_Multi_Master
*
* @description:
* A structure to model the axes and space of a Multiple Masters font.
*
* This structure can't be used for TrueType GX or OpenType variation
* fonts.
*
* @fields:
* num_axis ::
* Number of axes. Cannot exceed~4.
*
* num_designs ::
* Number of designs; should be normally 2^num_axis even though the
* Type~1 specification strangely allows for intermediate designs to be
* present. This number cannot exceed~16.
*
* axis ::
* A table of axis descriptors.
*/
typedef
struct
FT_Multi_Master_
{
FT_UInt
num_axis
;
FT_UInt
num_designs
;
FT_MM_Axis
axis
[
T1_MAX_MM_AXIS
];
}
FT_Multi_Master
;
/**************************************************************************
*
* @struct:
* FT_Var_Axis
*
* @description:
* A structure to model a given axis in design space for Multiple
* Masters, TrueType GX, and OpenType variation fonts.
*
* @fields:
* name ::
* The axis's name. Not always meaningful for TrueType GX or OpenType
* variation fonts.
*
* minimum ::
* The axis's minimum design coordinate.
*
* def ::
* The axis's default design coordinate. FreeType computes meaningful
* default values for Adobe MM fonts.
*
* maximum ::
* The axis's maximum design coordinate.
*
* tag ::
* The axis's tag (the equivalent to 'name' for TrueType GX and
* OpenType variation fonts). FreeType provides default values for
* Adobe MM fonts if possible.
*
* strid ::
* The axis name entry in the font's 'name' table. This is another
* (and often better) version of the 'name' field for TrueType GX or
* OpenType variation fonts. Not meaningful for Adobe MM fonts.
*
* @note:
* The fields `minimum`, `def`, and `maximum` are 16.16 fractional values
* for TrueType GX and OpenType variation fonts. For Adobe MM fonts, the
* values are integers.
*/
typedef
struct
FT_Var_Axis_
{
FT_String
*
name
;
FT_Fixed
minimum
;
FT_Fixed
def
;
FT_Fixed
maximum
;
FT_ULong
tag
;
FT_UInt
strid
;
}
FT_Var_Axis
;
/**************************************************************************
*
* @struct:
* FT_Var_Named_Style
*
* @description:
* A structure to model a named instance in a TrueType GX or OpenType
* variation font.
*
* This structure can't be used for Adobe MM fonts.
*
* @fields:
* coords ::
* The design coordinates for this instance. This is an array with one
* entry for each axis.
*
* strid ::
* The entry in 'name' table identifying this instance.
*
* psid ::
* The entry in 'name' table identifying a PostScript name for this
* instance. Value 0xFFFF indicates a missing entry.
*/
typedef
struct
FT_Var_Named_Style_
{
FT_Fixed
*
coords
;
FT_UInt
strid
;
FT_UInt
psid
;
/* since 2.7.1 */
}
FT_Var_Named_Style
;
/**************************************************************************
*
* @struct:
* FT_MM_Var
*
* @description:
* A structure to model the axes and space of an Adobe MM, TrueType GX,
* or OpenType variation font.
*
* Some fields are specific to one format and not to the others.
*
* @fields:
* num_axis ::
* The number of axes. The maximum value is~4 for Adobe MM fonts; no
* limit in TrueType GX or OpenType variation fonts.
*
* num_designs ::
* The number of designs; should be normally 2^num_axis for Adobe MM
* fonts. Not meaningful for TrueType GX or OpenType variation fonts
* (where every glyph could have a different number of designs).
*
* num_namedstyles ::
* The number of named styles; a 'named style' is a tuple of design
* coordinates that has a string ID (in the 'name' table) associated
* with it. The font can tell the user that, for example,
* [Weight=1.5,Width=1.1] is 'Bold'. Another name for 'named style' is
* 'named instance'.
*
* For Adobe Multiple Masters fonts, this value is always zero because
* the format does not support named styles.
*
* axis ::
* An axis descriptor table. TrueType GX and OpenType variation fonts
* contain slightly more data than Adobe MM fonts. Memory management
* of this pointer is done internally by FreeType.
*
* namedstyle ::
* A named style (instance) table. Only meaningful for TrueType GX and
* OpenType variation fonts. Memory management of this pointer is done
* internally by FreeType.
*/
typedef
struct
FT_MM_Var_
{
FT_UInt
num_axis
;
FT_UInt
num_designs
;
FT_UInt
num_namedstyles
;
FT_Var_Axis
*
axis
;
FT_Var_Named_Style
*
namedstyle
;
}
FT_MM_Var
;
/**************************************************************************
*
* @function:
* FT_Get_Multi_Master
*
* @description:
* Retrieve a variation descriptor of a given Adobe MM font.
*
* This function can't be used with TrueType GX or OpenType variation
* fonts.
*
* @input:
* face ::
* A handle to the source face.
*
* @output:
* amaster ::
* The Multiple Masters descriptor.
*
* @return:
* FreeType error code. 0~means success.
*/
FT_EXPORT
(
FT_Error
)
FT_Get_Multi_Master
(
FT_Face
face
,
FT_Multi_Master
*
amaster
);
/**************************************************************************
*
* @function:
* FT_Get_MM_Var
*
* @description:
* Retrieve a variation descriptor for a given font.
*
* This function works with all supported variation formats.
*
* @input:
* face ::
* A handle to the source face.
*
* @output:
* amaster ::
* The variation descriptor. Allocates a data structure, which the
* user must deallocate with a call to @FT_Done_MM_Var after use.
*
* @return:
* FreeType error code. 0~means success.
*/
FT_EXPORT
(
FT_Error
)
FT_Get_MM_Var
(
FT_Face
face
,
FT_MM_Var
*
*
amaster
);
/**************************************************************************
*
* @function:
* FT_Done_MM_Var
*
* @description:
* Free the memory allocated by @FT_Get_MM_Var.
*
* @input:
* library ::
* A handle of the face's parent library object that was used in the
* call to @FT_Get_MM_Var to create `amaster`.
*
* @return:
* FreeType error code. 0~means success.
*/
FT_EXPORT
(
FT_Error
)
FT_Done_MM_Var
(
FT_Library
library
,
FT_MM_Var
*
amaster
);
/**************************************************************************
*
* @function:
* FT_Set_MM_Design_Coordinates
*
* @description:
* For Adobe MM fonts, choose an interpolated font design through design
* coordinates.
*
* This function can't be used with TrueType GX or OpenType variation
* fonts.
*
* @inout:
* face ::
* A handle to the source face.
*
* @input:
* num_coords ::
* The number of available design coordinates. If it is larger than
* the number of axes, ignore the excess values. If it is smaller than
* the number of axes, use default values for the remaining axes.
*
* coords ::
* An array of design coordinates.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* [Since 2.8.1] To reset all axes to the default values, call the
* function with `num_coords` set to zero and `coords` set to `NULL`.
*
* [Since 2.9] If `num_coords` is larger than zero, this function sets
* the @FT_FACE_FLAG_VARIATION bit in @FT_Face's `face_flags` field
* (i.e., @FT_IS_VARIATION will return true). If `num_coords` is zero,
* this bit flag gets unset.
*/
FT_EXPORT
(
FT_Error
)
FT_Set_MM_Design_Coordinates
(
FT_Face
face
,
FT_UInt
num_coords
,
FT_Long
*
coords
);
/**************************************************************************
*
* @function:
* FT_Set_Var_Design_Coordinates
*
* @description:
* Choose an interpolated font design through design coordinates.
*
* This function works with all supported variation formats.
*
* @inout:
* face ::
* A handle to the source face.
*
* @input:
* num_coords ::
* The number of available design coordinates. If it is larger than
* the number of axes, ignore the excess values. If it is smaller than
* the number of axes, use default values for the remaining axes.
*
* coords ::
* An array of design coordinates.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* [Since 2.8.1] To reset all axes to the default values, call the
* function with `num_coords` set to zero and `coords` set to `NULL`.
* [Since 2.9] 'Default values' means the currently selected named
* instance (or the base font if no named instance is selected).
*
* [Since 2.9] If `num_coords` is larger than zero, this function sets
* the @FT_FACE_FLAG_VARIATION bit in @FT_Face's `face_flags` field
* (i.e., @FT_IS_VARIATION will return true). If `num_coords` is zero,
* this bit flag gets unset.
*/
FT_EXPORT
(
FT_Error
)
FT_Set_Var_Design_Coordinates
(
FT_Face
face
,
FT_UInt
num_coords
,
FT_Fixed
*
coords
);
/**************************************************************************
*
* @function:
* FT_Get_Var_Design_Coordinates
*
* @description:
* Get the design coordinates of the currently selected interpolated
* font.
*
* This function works with all supported variation formats.
*
* @input:
* face ::
* A handle to the source face.
*
* num_coords ::
* The number of design coordinates to retrieve. If it is larger than
* the number of axes, set the excess values to~0.
*
* @output:
* coords ::
* The design coordinates array.
*
* @return:
* FreeType error code. 0~means success.
*
* @since:
* 2.7.1
*/
FT_EXPORT
(
FT_Error
)
FT_Get_Var_Design_Coordinates
(
FT_Face
face
,
FT_UInt
num_coords
,
FT_Fixed
*
coords
);
/**************************************************************************
*
* @function:
* FT_Set_MM_Blend_Coordinates
*
* @description:
* Choose an interpolated font design through normalized blend
* coordinates.
*
* This function works with all supported variation formats.
*
* @inout:
* face ::
* A handle to the source face.
*
* @input:
* num_coords ::
* The number of available design coordinates. If it is larger than
* the number of axes, ignore the excess values. If it is smaller than
* the number of axes, use default values for the remaining axes.
*
* coords ::
* The design coordinates array (each element must be between 0 and 1.0
* for Adobe MM fonts, and between -1.0 and 1.0 for TrueType GX and
* OpenType variation fonts).
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* [Since 2.8.1] To reset all axes to the default values, call the
* function with `num_coords` set to zero and `coords` set to `NULL`.
* [Since 2.9] 'Default values' means the currently selected named
* instance (or the base font if no named instance is selected).
*
* [Since 2.9] If `num_coords` is larger than zero, this function sets
* the @FT_FACE_FLAG_VARIATION bit in @FT_Face's `face_flags` field
* (i.e., @FT_IS_VARIATION will return true). If `num_coords` is zero,
* this bit flag gets unset.
*/
FT_EXPORT
(
FT_Error
)
FT_Set_MM_Blend_Coordinates
(
FT_Face
face
,
FT_UInt
num_coords
,
FT_Fixed
*
coords
);
/**************************************************************************
*
* @function:
* FT_Get_MM_Blend_Coordinates
*
* @description:
* Get the normalized blend coordinates of the currently selected
* interpolated font.
*
* This function works with all supported variation formats.
*
* @input:
* face ::
* A handle to the source face.
*
* num_coords ::
* The number of normalized blend coordinates to retrieve. If it is
* larger than the number of axes, set the excess values to~0.5 for
* Adobe MM fonts, and to~0 for TrueType GX and OpenType variation
* fonts.
*
* @output:
* coords ::
* The normalized blend coordinates array.
*
* @return:
* FreeType error code. 0~means success.
*
* @since:
* 2.7.1
*/
FT_EXPORT
(
FT_Error
)
FT_Get_MM_Blend_Coordinates
(
FT_Face
face
,
FT_UInt
num_coords
,
FT_Fixed
*
coords
);
/**************************************************************************
*
* @function:
* FT_Set_Var_Blend_Coordinates
*
* @description:
* This is another name of @FT_Set_MM_Blend_Coordinates.
*/
FT_EXPORT
(
FT_Error
)
FT_Set_Var_Blend_Coordinates
(
FT_Face
face
,
FT_UInt
num_coords
,
FT_Fixed
*
coords
);
/**************************************************************************
*
* @function:
* FT_Get_Var_Blend_Coordinates
*
* @description:
* This is another name of @FT_Get_MM_Blend_Coordinates.
*
* @since:
* 2.7.1
*/
FT_EXPORT
(
FT_Error
)
FT_Get_Var_Blend_Coordinates
(
FT_Face
face
,
FT_UInt
num_coords
,
FT_Fixed
*
coords
);
/**************************************************************************
*
* @function:
* FT_Set_MM_WeightVector
*
* @description:
* For Adobe MM fonts, choose an interpolated font design by directly
* setting the weight vector.
*
* This function can't be used with TrueType GX or OpenType variation
* fonts.
*
* @inout:
* face ::
* A handle to the source face.
*
* @input:
* len ::
* The length of the weight vector array. If it is larger than the
* number of designs, the extra values are ignored. If it is less than
* the number of designs, the remaining values are set to zero.
*
* weightvector ::
* An array representing the weight vector.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* Adobe Multiple Master fonts limit the number of designs, and thus the
* length of the weight vector to~16.
*
* If `len` is zero and `weightvector` is `NULL`, the weight vector array
* is reset to the default values.
*
* The Adobe documentation also states that the values in the
* WeightVector array must total 1.0 +/-~0.001. In practice this does
* not seem to be enforced, so is not enforced here, either.
*
* @since:
* 2.10
*/
FT_EXPORT
(
FT_Error
)
FT_Set_MM_WeightVector
(
FT_Face
face
,
FT_UInt
len
,
FT_Fixed
*
weightvector
);
/**************************************************************************
*
* @function:
* FT_Get_MM_WeightVector
*
* @description:
* For Adobe MM fonts, retrieve the current weight vector of the font.
*
* This function can't be used with TrueType GX or OpenType variation
* fonts.
*
* @inout:
* face ::
* A handle to the source face.
*
* len ::
* A pointer to the size of the array to be filled. If the size of the
* array is less than the number of designs, `FT_Err_Invalid_Argument`
* is returned, and `len` is set to the required size (the number of
* designs). If the size of the array is greater than the number of
* designs, the remaining entries are set to~0. On successful
* completion, `len` is set to the number of designs (i.e., the number
* of values written to the array).
*
* @output:
* weightvector ::
* An array to be filled.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* Adobe Multiple Master fonts limit the number of designs, and thus the
* length of the WeightVector to~16.
*
* @since:
* 2.10
*/
FT_EXPORT
(
FT_Error
)
FT_Get_MM_WeightVector
(
FT_Face
face
,
FT_UInt
*
len
,
FT_Fixed
*
weightvector
);
/**************************************************************************
*
* @enum:
* FT_VAR_AXIS_FLAG_XXX
*
* @description:
* A list of bit flags used in the return value of
* @FT_Get_Var_Axis_Flags.
*
* @values:
* FT_VAR_AXIS_FLAG_HIDDEN ::
* The variation axis should not be exposed to user interfaces.
*
* @since:
* 2.8.1
*/
#define FT_VAR_AXIS_FLAG_HIDDEN 1
/**************************************************************************
*
* @function:
* FT_Get_Var_Axis_Flags
*
* @description:
* Get the 'flags' field of an OpenType Variation Axis Record.
*
* Not meaningful for Adobe MM fonts (`*flags` is always zero).
*
* @input:
* master ::
* The variation descriptor.
*
* axis_index ::
* The index of the requested variation axis.
*
* @output:
* flags ::
* The 'flags' field. See @FT_VAR_AXIS_FLAG_XXX for possible values.
*
* @return:
* FreeType error code. 0~means success.
*
* @since:
* 2.8.1
*/
FT_EXPORT
(
FT_Error
)
FT_Get_Var_Axis_Flags
(
FT_MM_Var
*
master
,
FT_UInt
axis_index
,
FT_UInt
*
flags
);
/**************************************************************************
*
* @function:
* FT_Set_Named_Instance
*
* @description:
* Set or change the current named instance.
*
* @input:
* face ::
* A handle to the source face.
*
* instance_index ::
* The index of the requested instance, starting with value 1. If set
* to value 0, FreeType switches to font access without a named
* instance.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* The function uses the value of `instance_index` to set bits 16-30 of
* the face's `face_index` field. It also resets any variation applied
* to the font, and the @FT_FACE_FLAG_VARIATION bit of the face's
* `face_flags` field gets reset to zero (i.e., @FT_IS_VARIATION will
* return false).
*
* For Adobe MM fonts (which don't have named instances) this function
* simply resets the current face to the default instance.
*
* @since:
* 2.9
*/
FT_EXPORT
(
FT_Error
)
FT_Set_Named_Instance
(
FT_Face
face
,
FT_UInt
instance_index
);
/* */
FT_END_HEADER
#endif
/* FTMM_H_ */
/* END */
CMU462/deps/freetype/include/freetype/ftmodapi.h
0 → 100644
View file @
57023a55
/****************************************************************************
*
* ftmodapi.h
*
* FreeType modules public interface (specification).
*
* Copyright (C) 1996-2019 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 FTMODAPI_H_
#define FTMODAPI_H_
#include <ft2build.h>
#include FT_FREETYPE_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
FT_BEGIN_HEADER
/**************************************************************************
*
* @section:
* module_management
*
* @title:
* Module Management
*
* @abstract:
* How to add, upgrade, remove, and control modules from FreeType.
*
* @description:
* The definitions below are used to manage modules within FreeType.
* Modules can be added, upgraded, and removed at runtime. Additionally,
* some module properties can be controlled also.
*
* Here is a list of possible values of the `module_name` field in the
* @FT_Module_Class structure.
*
* ```
* autofitter
* bdf
* cff
* gxvalid
* otvalid
* pcf
* pfr
* psaux
* pshinter
* psnames
* raster1
* sfnt
* smooth, smooth-lcd, smooth-lcdv
* truetype
* type1
* type42
* t1cid
* winfonts
* ```
*
* Note that the FreeType Cache sub-system is not a FreeType module.
*
* @order:
* FT_Module
* FT_Module_Constructor
* FT_Module_Destructor
* FT_Module_Requester
* FT_Module_Class
*
* FT_Add_Module
* FT_Get_Module
* FT_Remove_Module
* FT_Add_Default_Modules
*
* FT_Property_Set
* FT_Property_Get
* FT_Set_Default_Properties
*
* FT_New_Library
* FT_Done_Library
* FT_Reference_Library
*
* FT_Renderer
* FT_Renderer_Class
*
* FT_Get_Renderer
* FT_Set_Renderer
*
* FT_Set_Debug_Hook
*
*/
/* module bit flags */
#define FT_MODULE_FONT_DRIVER 1
/* this module is a font driver */
#define FT_MODULE_RENDERER 2
/* this module is a renderer */
#define FT_MODULE_HINTER 4
/* this module is a glyph hinter */
#define FT_MODULE_STYLER 8
/* this module is a styler */
#define FT_MODULE_DRIVER_SCALABLE 0x100
/* the driver supports */
/* scalable fonts */
#define FT_MODULE_DRIVER_NO_OUTLINES 0x200
/* the driver does not */
/* support vector outlines */
#define FT_MODULE_DRIVER_HAS_HINTER 0x400
/* the driver provides its */
/* own hinter */
#define FT_MODULE_DRIVER_HINTS_LIGHTLY 0x800
/* the driver's hinter */
/* produces LIGHT hints */
/* deprecated values */
#define ft_module_font_driver FT_MODULE_FONT_DRIVER
#define ft_module_renderer FT_MODULE_RENDERER
#define ft_module_hinter FT_MODULE_HINTER
#define ft_module_styler FT_MODULE_STYLER
#define ft_module_driver_scalable FT_MODULE_DRIVER_SCALABLE
#define ft_module_driver_no_outlines FT_MODULE_DRIVER_NO_OUTLINES
#define ft_module_driver_has_hinter FT_MODULE_DRIVER_HAS_HINTER
#define ft_module_driver_hints_lightly FT_MODULE_DRIVER_HINTS_LIGHTLY
typedef
FT_Pointer
FT_Module_Interface
;
/**************************************************************************
*
* @functype:
* FT_Module_Constructor
*
* @description:
* A function used to initialize (not create) a new module object.
*
* @input:
* module ::
* The module to initialize.
*/
typedef
FT_Error
(
*
FT_Module_Constructor
)(
FT_Module
module
);
/**************************************************************************
*
* @functype:
* FT_Module_Destructor
*
* @description:
* A function used to finalize (not destroy) a given module object.
*
* @input:
* module ::
* The module to finalize.
*/
typedef
void
(
*
FT_Module_Destructor
)(
FT_Module
module
);
/**************************************************************************
*
* @functype:
* FT_Module_Requester
*
* @description:
* A function used to query a given module for a specific interface.
*
* @input:
* module ::
* The module to be searched.
*
* name ::
* The name of the interface in the module.
*/
typedef
FT_Module_Interface
(
*
FT_Module_Requester
)(
FT_Module
module
,
const
char
*
name
);
/**************************************************************************
*
* @struct:
* FT_Module_Class
*
* @description:
* The module class descriptor. While being a public structure necessary
* for FreeType's module bookkeeping, most of the fields are essentially
* internal, not to be used directly by an application.
*
* @fields:
* module_flags ::
* Bit flags describing the module.
*
* module_size ::
* The size of one module object/instance in bytes.
*
* module_name ::
* The name of the module.
*
* module_version ::
* The version, as a 16.16 fixed number (major.minor).
*
* module_requires ::
* The version of FreeType this module requires, as a 16.16 fixed
* number (major.minor). Starts at version 2.0, i.e., 0x20000.
*
* module_interface ::
* A typeless pointer to a structure (which varies between different
* modules) that holds the module's interface functions. This is
* essentially what `get_interface` returns.
*
* module_init ::
* The initializing function.
*
* module_done ::
* The finalizing function.
*
* get_interface ::
* The interface requesting function.
*/
typedef
struct
FT_Module_Class_
{
FT_ULong
module_flags
;
FT_Long
module_size
;
const
FT_String
*
module_name
;
FT_Fixed
module_version
;
FT_Fixed
module_requires
;
const
void
*
module_interface
;
FT_Module_Constructor
module_init
;
FT_Module_Destructor
module_done
;
FT_Module_Requester
get_interface
;
}
FT_Module_Class
;
/**************************************************************************
*
* @function:
* FT_Add_Module
*
* @description:
* Add a new module to a given library instance.
*
* @inout:
* library ::
* A handle to the library object.
*
* @input:
* clazz ::
* A pointer to class descriptor for the module.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* An error will be returned if a module already exists by that name, or
* if the module requires a version of FreeType that is too great.
*/
FT_EXPORT
(
FT_Error
)
FT_Add_Module
(
FT_Library
library
,
const
FT_Module_Class
*
clazz
);
/**************************************************************************
*
* @function:
* FT_Get_Module
*
* @description:
* Find a module by its name.
*
* @input:
* library ::
* A handle to the library object.
*
* module_name ::
* The module's name (as an ASCII string).
*
* @return:
* A module handle. 0~if none was found.
*
* @note:
* FreeType's internal modules aren't documented very well, and you
* should look up the source code for details.
*/
FT_EXPORT
(
FT_Module
)
FT_Get_Module
(
FT_Library
library
,
const
char
*
module_name
);
/**************************************************************************
*
* @function:
* FT_Remove_Module
*
* @description:
* Remove a given module from a library instance.
*
* @inout:
* library ::
* A handle to a library object.
*
* @input:
* module ::
* A handle to a module object.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* The module object is destroyed by the function in case of success.
*/
FT_EXPORT
(
FT_Error
)
FT_Remove_Module
(
FT_Library
library
,
FT_Module
module
);
/**************************************************************************
*
* @function:
* FT_Property_Set
*
* @description:
* Set a property for a given module.
*
* @input:
* library ::
* A handle to the library the module is part of.
*
* module_name ::
* The module name.
*
* property_name ::
* The property name. Properties are described in section
* @properties.
*
* Note that only a few modules have properties.
*
* value ::
* A generic pointer to a variable or structure that gives the new
* value of the property. The exact definition of `value` is
* dependent on the property; see section @properties.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* If `module_name` isn't a valid module name, or `property_name`
* doesn't specify a valid property, or if `value` doesn't represent a
* valid value for the given property, an error is returned.
*
* The following example sets property 'bar' (a simple integer) in
* module 'foo' to value~1.
*
* ```
* FT_UInt bar;
*
*
* bar = 1;
* FT_Property_Set( library, "foo", "bar", &bar );
* ```
*
* Note that the FreeType Cache sub-system doesn't recognize module
* property changes. To avoid glyph lookup confusion within the cache
* you should call @FTC_Manager_Reset to completely flush the cache if a
* module property gets changed after @FTC_Manager_New has been called.
*
* It is not possible to set properties of the FreeType Cache sub-system
* itself with FT_Property_Set; use @FTC_Property_Set instead.
*
* @since:
* 2.4.11
*
*/
FT_EXPORT
(
FT_Error
)
FT_Property_Set
(
FT_Library
library
,
const
FT_String
*
module_name
,
const
FT_String
*
property_name
,
const
void
*
value
);
/**************************************************************************
*
* @function:
* FT_Property_Get
*
* @description:
* Get a module's property value.
*
* @input:
* library ::
* A handle to the library the module is part of.
*
* module_name ::
* The module name.
*
* property_name ::
* The property name. Properties are described in section
* @properties.
*
* @inout:
* value ::
* A generic pointer to a variable or structure that gives the value
* of the property. The exact definition of `value` is dependent on
* the property; see section @properties.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* If `module_name` isn't a valid module name, or `property_name`
* doesn't specify a valid property, or if `value` doesn't represent a
* valid value for the given property, an error is returned.
*
* The following example gets property 'baz' (a range) in module 'foo'.
*
* ```
* typedef range_
* {
* FT_Int32 min;
* FT_Int32 max;
*
* } range;
*
* range baz;
*
*
* FT_Property_Get( library, "foo", "baz", &baz );
* ```
*
* It is not possible to retrieve properties of the FreeType Cache
* sub-system with FT_Property_Get; use @FTC_Property_Get instead.
*
* @since:
* 2.4.11
*
*/
FT_EXPORT
(
FT_Error
)
FT_Property_Get
(
FT_Library
library
,
const
FT_String
*
module_name
,
const
FT_String
*
property_name
,
void
*
value
);
/**************************************************************************
*
* @function:
* FT_Set_Default_Properties
*
* @description:
* If compilation option `FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES` is
* set, this function reads the `FREETYPE_PROPERTIES` environment
* variable to control driver properties. See section @properties for
* more.
*
* If the compilation option is not set, this function does nothing.
*
* `FREETYPE_PROPERTIES` has the following syntax form (broken here into
* multiple lines for better readability).
*
* ```
* <optional whitespace>
* <module-name1> ':'
* <property-name1> '=' <property-value1>
* <whitespace>
* <module-name2> ':'
* <property-name2> '=' <property-value2>
* ...
* ```
*
* Example:
*
* ```
* FREETYPE_PROPERTIES=truetype:interpreter-version=35 \
* cff:no-stem-darkening=1 \
* autofitter:warping=1
* ```
*
* @inout:
* library ::
* A handle to a new library object.
*
* @since:
* 2.8
*/
FT_EXPORT
(
void
)
FT_Set_Default_Properties
(
FT_Library
library
);
/**************************************************************************
*
* @function:
* FT_Reference_Library
*
* @description:
* A counter gets initialized to~1 at the time an @FT_Library structure
* is created. This function increments the counter. @FT_Done_Library
* then only destroys a library if the counter is~1, otherwise it simply
* decrements the counter.
*
* This function helps in managing life-cycles of structures that
* reference @FT_Library objects.
*
* @input:
* library ::
* A handle to a target library object.
*
* @return:
* FreeType error code. 0~means success.
*
* @since:
* 2.4.2
*/
FT_EXPORT
(
FT_Error
)
FT_Reference_Library
(
FT_Library
library
);
/**************************************************************************
*
* @function:
* FT_New_Library
*
* @description:
* This function is used to create a new FreeType library instance from a
* given memory object. It is thus possible to use libraries with
* distinct memory allocators within the same program. Note, however,
* that the used @FT_Memory structure is expected to remain valid for the
* life of the @FT_Library object.
*
* Normally, you would call this function (followed by a call to
* @FT_Add_Default_Modules or a series of calls to @FT_Add_Module, and a
* call to @FT_Set_Default_Properties) instead of @FT_Init_FreeType to
* initialize the FreeType library.
*
* Don't use @FT_Done_FreeType but @FT_Done_Library to destroy a library
* instance.
*
* @input:
* memory ::
* A handle to the original memory object.
*
* @output:
* alibrary ::
* A pointer to handle of a new library object.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* See the discussion of reference counters in the description of
* @FT_Reference_Library.
*/
FT_EXPORT
(
FT_Error
)
FT_New_Library
(
FT_Memory
memory
,
FT_Library
*
alibrary
);
/**************************************************************************
*
* @function:
* FT_Done_Library
*
* @description:
* Discard a given library object. This closes all drivers and discards
* all resource objects.
*
* @input:
* library ::
* A handle to the target library.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* See the discussion of reference counters in the description of
* @FT_Reference_Library.
*/
FT_EXPORT
(
FT_Error
)
FT_Done_Library
(
FT_Library
library
);
/**************************************************************************
*
* @functype:
* FT_DebugHook_Func
*
* @description:
* A drop-in replacement (or rather a wrapper) for the bytecode or
* charstring interpreter's main loop function.
*
* Its job is essentially
*
* - to activate debug mode to enforce single-stepping,
*
* - to call the main loop function to interpret the next opcode, and
*
* - to show the changed context to the user.
*
* An example for such a main loop function is `TT_RunIns` (declared in
* FreeType's internal header file `src/truetype/ttinterp.h`).
*
* Have a look at the source code of the `ttdebug` FreeType demo program
* for an example of a drop-in replacement.
*
* @inout:
* arg ::
* A typeless pointer, to be cast to the main loop function's data
* structure (which depends on the font module). For TrueType fonts
* it is bytecode interpreter's execution context, `TT_ExecContext`,
* which is declared in FreeType's internal header file `tttypes.h`.
*/
typedef
FT_Error
(
*
FT_DebugHook_Func
)(
void
*
arg
);
/**************************************************************************
*
* @enum:
* FT_DEBUG_HOOK_XXX
*
* @description:
* A list of named debug hook indices.
*
* @values:
* FT_DEBUG_HOOK_TRUETYPE::
* This hook index identifies the TrueType bytecode debugger.
*/
#define FT_DEBUG_HOOK_TRUETYPE 0
/**************************************************************************
*
* @function:
* FT_Set_Debug_Hook
*
* @description:
* Set a debug hook function for debugging the interpreter of a font
* format.
*
* While this is a public API function, an application needs access to
* FreeType's internal header files to do something useful.
*
* Have a look at the source code of the `ttdebug` FreeType demo program
* for an example of its usage.
*
* @inout:
* library ::
* A handle to the library object.
*
* @input:
* hook_index ::
* The index of the debug hook. You should use defined enumeration
* macros like @FT_DEBUG_HOOK_TRUETYPE.
*
* debug_hook ::
* The function used to debug the interpreter.
*
* @note:
* Currently, four debug hook slots are available, but only one (for the
* TrueType interpreter) is defined.
*/
FT_EXPORT
(
void
)
FT_Set_Debug_Hook
(
FT_Library
library
,
FT_UInt
hook_index
,
FT_DebugHook_Func
debug_hook
);
/**************************************************************************
*
* @function:
* FT_Add_Default_Modules
*
* @description:
* Add the set of default drivers to a given library object. This is
* only useful when you create a library object with @FT_New_Library
* (usually to plug a custom memory manager).
*
* @inout:
* library ::
* A handle to a new library object.
*/
FT_EXPORT
(
void
)
FT_Add_Default_Modules
(
FT_Library
library
);
/**************************************************************************
*
* @section:
* truetype_engine
*
* @title:
* The TrueType Engine
*
* @abstract:
* TrueType bytecode support.
*
* @description:
* This section contains a function used to query the level of TrueType
* bytecode support compiled in this version of the library.
*
*/
/**************************************************************************
*
* @enum:
* FT_TrueTypeEngineType
*
* @description:
* A list of values describing which kind of TrueType bytecode engine is
* implemented in a given FT_Library instance. It is used by the
* @FT_Get_TrueType_Engine_Type function.
*
* @values:
* FT_TRUETYPE_ENGINE_TYPE_NONE ::
* The library doesn't implement any kind of bytecode interpreter.
*
* FT_TRUETYPE_ENGINE_TYPE_UNPATENTED ::
* Deprecated and removed.
*
* FT_TRUETYPE_ENGINE_TYPE_PATENTED ::
* The library implements a bytecode interpreter that covers the full
* instruction set of the TrueType virtual machine (this was governed
* by patents until May 2010, hence the name).
*
* @since:
* 2.2
*
*/
typedef
enum
FT_TrueTypeEngineType_
{
FT_TRUETYPE_ENGINE_TYPE_NONE
=
0
,
FT_TRUETYPE_ENGINE_TYPE_UNPATENTED
,
FT_TRUETYPE_ENGINE_TYPE_PATENTED
}
FT_TrueTypeEngineType
;
/**************************************************************************
*
* @function:
* FT_Get_TrueType_Engine_Type
*
* @description:
* Return an @FT_TrueTypeEngineType value to indicate which level of the
* TrueType virtual machine a given library instance supports.
*
* @input:
* library ::
* A library instance.
*
* @return:
* A value indicating which level is supported.
*
* @since:
* 2.2
*
*/
FT_EXPORT
(
FT_TrueTypeEngineType
)
FT_Get_TrueType_Engine_Type
(
FT_Library
library
);
/* */
FT_END_HEADER
#endif
/* FTMODAPI_H_ */
/* END */
CMU462/deps/freetype/include/
freetype2/
freetype/ftmoderr.h
→
CMU462/deps/freetype/include/freetype/ftmoderr.h
100755 → 100644
View file @
57023a55
/***************************************************************************/
/* */
/* ftmoderr.h */
/* */
/* FreeType module error offsets (specification). */
/* */
/* Copyright 2001, 2002, 2003, 2004, 2005 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 is used to define the FreeType module error offsets. */
/* */
/* The lower byte gives the error code, the higher byte gives the */
/* module. The base module has error offset 0. For example, the error */
/* `FT_Err_Invalid_File_Format' has value 0x003, the error */
/* `TT_Err_Invalid_File_Format' has value 0x1103, the error */
/* `T1_Err_Invalid_File_Format' has value 0x1203, etc. */
/* */
/* Undefine the macro FT_CONFIG_OPTION_USE_MODULE_ERRORS in ftoption.h */
/* to make the higher byte always zero (disabling the module error */
/* mechanism). */
/* */
/* It can also be used to create a module error message table easily */
/* with something like */
/* */
/* { */
/* #undef __FTMODERR_H__ */
/* #define FT_MODERRDEF( e, v, s ) { FT_Mod_Err_ ## e, s }, */
/* #define FT_MODERR_START_LIST { */
/* #define FT_MODERR_END_LIST { 0, 0 } }; */
/* */
/* const struct */
/* { */
/* int mod_err_offset; */
/* const char* mod_err_msg */
/* } ft_mod_errors[] = */
/* */
/* #include FT_MODULE_ERRORS_H */
/* } */
/* */
/* To use such a table, all errors must be ANDed with 0xFF00 to remove */
/* the error code. */
/* */
/*************************************************************************/
#ifndef __FTMODERR_H__
#define __FTMODERR_H__
/****************************************************************************
*
* ftmoderr.h
*
* FreeType module error offsets (specification).
*
* Copyright (C) 2001-2019 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 is used to define the FreeType module error codes.
*
* If the macro `FT_CONFIG_OPTION_USE_MODULE_ERRORS` in `ftoption.h` is
* set, the lower byte of an error value identifies the error code as
* usual. In addition, the higher byte identifies the module. For
* example, the error `FT_Err_Invalid_File_Format` has value 0x0003, the
* error `TT_Err_Invalid_File_Format` has value 0x1303, the error
* `T1_Err_Invalid_File_Format` has value 0x1403, etc.
*
* Note that `FT_Err_Ok`, `TT_Err_Ok`, etc. are always equal to zero,
* including the high byte.
*
* If `FT_CONFIG_OPTION_USE_MODULE_ERRORS` isn't set, the higher byte of an
* error value is set to zero.
*
* To hide the various `XXX_Err_` prefixes in the source code, FreeType
* provides some macros in `fttypes.h`.
*
* FT_ERR( err )
*
* Add current error module prefix (as defined with the `FT_ERR_PREFIX`
* macro) to `err`. For example, in the BDF module the line
*
* ```
* error = FT_ERR( Invalid_Outline );
* ```
*
* expands to
*
* ```
* error = BDF_Err_Invalid_Outline;
* ```
*
* For simplicity, you can always use `FT_Err_Ok` directly instead of
* `FT_ERR( Ok )`.
*
* FT_ERR_EQ( errcode, err )
* FT_ERR_NEQ( errcode, err )
*
* Compare error code `errcode` with the error `err` for equality and
* inequality, respectively. Example:
*
* ```
* if ( FT_ERR_EQ( error, Invalid_Outline ) )
* ...
* ```
*
* Using this macro you don't have to think about error prefixes. Of
* course, if module errors are not active, the above example is the
* same as
*
* ```
* if ( error == FT_Err_Invalid_Outline )
* ...
* ```
*
* FT_ERROR_BASE( errcode )
* FT_ERROR_MODULE( errcode )
*
* Get base error and module error code, respectively.
*
* It can also be used to create a module error message table easily with
* something like
*
* ```
* #undef FTMODERR_H_
* #define FT_MODERRDEF( e, v, s ) { FT_Mod_Err_ ## e, s },
* #define FT_MODERR_START_LIST {
* #define FT_MODERR_END_LIST { 0, 0 } };
*
* const struct
* {
* int mod_err_offset;
* const char* mod_err_msg
* } ft_mod_errors[] =
*
* #include FT_MODULE_ERRORS_H
* ```
*
*/
#ifndef FTMODERR_H_
#define FTMODERR_H_
/*******************************************************************/
...
...
@@ -105,24 +151,26 @@
FT_MODERRDEF
(
Base
,
0x000
,
"base module"
)
FT_MODERRDEF
(
Autofit
,
0x100
,
"autofitter module"
)
FT_MODERRDEF
(
BDF
,
0x200
,
"BDF module"
)
FT_MODERRDEF
(
Cache
,
0x300
,
"cache module"
)
FT_MODERRDEF
(
CFF
,
0x400
,
"CFF module"
)
FT_MODERRDEF
(
CID
,
0x500
,
"CID module"
)
FT_MODERRDEF
(
Gzip
,
0x600
,
"Gzip module"
)
FT_MODERRDEF
(
LZW
,
0x700
,
"LZW module"
)
FT_MODERRDEF
(
OTvalid
,
0x800
,
"OpenType validation module"
)
FT_MODERRDEF
(
PCF
,
0x900
,
"PCF module"
)
FT_MODERRDEF
(
PFR
,
0xA00
,
"PFR module"
)
FT_MODERRDEF
(
PSaux
,
0xB00
,
"PS auxiliary module"
)
FT_MODERRDEF
(
PShinter
,
0xC00
,
"PS hinter module"
)
FT_MODERRDEF
(
PSnames
,
0xD00
,
"PS names module"
)
FT_MODERRDEF
(
Raster
,
0xE00
,
"raster module"
)
FT_MODERRDEF
(
SFNT
,
0xF00
,
"SFNT module"
)
FT_MODERRDEF
(
Smooth
,
0x1000
,
"smooth raster module"
)
FT_MODERRDEF
(
TrueType
,
0x1100
,
"TrueType module"
)
FT_MODERRDEF
(
Type1
,
0x1200
,
"Type 1 module"
)
FT_MODERRDEF
(
Type42
,
0x1300
,
"Type 42 module"
)
FT_MODERRDEF
(
Winfonts
,
0x1400
,
"Windows FON/FNT module"
)
FT_MODERRDEF
(
Bzip2
,
0x300
,
"Bzip2 module"
)
FT_MODERRDEF
(
Cache
,
0x400
,
"cache module"
)
FT_MODERRDEF
(
CFF
,
0x500
,
"CFF module"
)
FT_MODERRDEF
(
CID
,
0x600
,
"CID module"
)
FT_MODERRDEF
(
Gzip
,
0x700
,
"Gzip module"
)
FT_MODERRDEF
(
LZW
,
0x800
,
"LZW module"
)
FT_MODERRDEF
(
OTvalid
,
0x900
,
"OpenType validation module"
)
FT_MODERRDEF
(
PCF
,
0xA00
,
"PCF module"
)
FT_MODERRDEF
(
PFR
,
0xB00
,
"PFR module"
)
FT_MODERRDEF
(
PSaux
,
0xC00
,
"PS auxiliary module"
)
FT_MODERRDEF
(
PShinter
,
0xD00
,
"PS hinter module"
)
FT_MODERRDEF
(
PSnames
,
0xE00
,
"PS names module"
)
FT_MODERRDEF
(
Raster
,
0xF00
,
"raster module"
)
FT_MODERRDEF
(
SFNT
,
0x1000
,
"SFNT module"
)
FT_MODERRDEF
(
Smooth
,
0x1100
,
"smooth raster module"
)
FT_MODERRDEF
(
TrueType
,
0x1200
,
"TrueType module"
)
FT_MODERRDEF
(
Type1
,
0x1300
,
"Type 1 module"
)
FT_MODERRDEF
(
Type42
,
0x1400
,
"Type 42 module"
)
FT_MODERRDEF
(
Winfonts
,
0x1500
,
"Windows FON/FNT module"
)
FT_MODERRDEF
(
GXvalid
,
0x1600
,
"GX validation module"
)
#ifdef FT_MODERR_END_LIST
...
...
@@ -149,7 +197,7 @@
#undef FT_NEED_EXTERN_C
#endif
/*
__
FTMODERR_H_
_
*/
#endif
/* FTMODERR_H_ */
/* END */
CMU462/deps/freetype/include/freetype/ftotval.h
0 → 100644
View file @
57023a55
/****************************************************************************
*
* ftotval.h
*
* FreeType API for validating OpenType tables (specification).
*
* Copyright (C) 2004-2019 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.
*
*/
/****************************************************************************
*
*
* Warning: This module might be moved to a different library in the
* future to avoid a tight dependency between FreeType and the
* OpenType specification.
*
*
*/
#ifndef FTOTVAL_H_
#define FTOTVAL_H_
#include <ft2build.h>
#include FT_FREETYPE_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
FT_BEGIN_HEADER
/**************************************************************************
*
* @section:
* ot_validation
*
* @title:
* OpenType Validation
*
* @abstract:
* An API to validate OpenType tables.
*
* @description:
* This section contains the declaration of functions to validate some
* OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH).
*
* @order:
* FT_OpenType_Validate
* FT_OpenType_Free
*
* FT_VALIDATE_OTXXX
*
*/
/**************************************************************************
*
* @enum:
* FT_VALIDATE_OTXXX
*
* @description:
* A list of bit-field constants used with @FT_OpenType_Validate to
* indicate which OpenType tables should be validated.
*
* @values:
* FT_VALIDATE_BASE ::
* Validate BASE table.
*
* FT_VALIDATE_GDEF ::
* Validate GDEF table.
*
* FT_VALIDATE_GPOS ::
* Validate GPOS table.
*
* FT_VALIDATE_GSUB ::
* Validate GSUB table.
*
* FT_VALIDATE_JSTF ::
* Validate JSTF table.
*
* FT_VALIDATE_MATH ::
* Validate MATH table.
*
* FT_VALIDATE_OT ::
* Validate all OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH).
*
*/
#define FT_VALIDATE_BASE 0x0100
#define FT_VALIDATE_GDEF 0x0200
#define FT_VALIDATE_GPOS 0x0400
#define FT_VALIDATE_GSUB 0x0800
#define FT_VALIDATE_JSTF 0x1000
#define FT_VALIDATE_MATH 0x2000
#define FT_VALIDATE_OT ( FT_VALIDATE_BASE | \
FT_VALIDATE_GDEF | \
FT_VALIDATE_GPOS | \
FT_VALIDATE_GSUB | \
FT_VALIDATE_JSTF | \
FT_VALIDATE_MATH )
/**************************************************************************
*
* @function:
* FT_OpenType_Validate
*
* @description:
* Validate various OpenType tables to assure that all offsets and
* indices are valid. The idea is that a higher-level library that
* actually does the text layout can access those tables without error
* checking (which can be quite time consuming).
*
* @input:
* face ::
* A handle to the input face.
*
* validation_flags ::
* A bit field that specifies the tables to be validated. See
* @FT_VALIDATE_OTXXX for possible values.
*
* @output:
* BASE_table ::
* A pointer to the BASE table.
*
* GDEF_table ::
* A pointer to the GDEF table.
*
* GPOS_table ::
* A pointer to the GPOS table.
*
* GSUB_table ::
* A pointer to the GSUB table.
*
* JSTF_table ::
* A pointer to the JSTF table.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* This function only works with OpenType fonts, returning an error
* otherwise.
*
* After use, the application should deallocate the five tables with
* @FT_OpenType_Free. A `NULL` value indicates that the table either
* doesn't exist in the font, or the application hasn't asked for
* validation.
*/
FT_EXPORT
(
FT_Error
)
FT_OpenType_Validate
(
FT_Face
face
,
FT_UInt
validation_flags
,
FT_Bytes
*
BASE_table
,
FT_Bytes
*
GDEF_table
,
FT_Bytes
*
GPOS_table
,
FT_Bytes
*
GSUB_table
,
FT_Bytes
*
JSTF_table
);
/**************************************************************************
*
* @function:
* FT_OpenType_Free
*
* @description:
* Free the buffer allocated by OpenType validator.
*
* @input:
* face ::
* A handle to the input face.
*
* table ::
* The pointer to the buffer that is allocated by
* @FT_OpenType_Validate.
*
* @note:
* This function must be used to free the buffer allocated by
* @FT_OpenType_Validate only.
*/
FT_EXPORT
(
void
)
FT_OpenType_Free
(
FT_Face
face
,
FT_Bytes
table
);
/* */
FT_END_HEADER
#endif
/* FTOTVAL_H_ */
/* END */
CMU462/deps/freetype/include/freetype/ftoutln.h
0 → 100644
View file @
57023a55
/****************************************************************************
*
* ftoutln.h
*
* Support for the FT_Outline type used to store glyph shapes of
* most scalable font formats (specification).
*
* Copyright (C) 1996-2019 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 FTOUTLN_H_
#define FTOUTLN_H_
#include <ft2build.h>
#include FT_FREETYPE_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
FT_BEGIN_HEADER
/**************************************************************************
*
* @section:
* outline_processing
*
* @title:
* Outline Processing
*
* @abstract:
* Functions to create, transform, and render vectorial glyph images.
*
* @description:
* This section contains routines used to create and destroy scalable
* glyph images known as 'outlines'. These can also be measured,
* transformed, and converted into bitmaps and pixmaps.
*
* @order:
* FT_Outline
* FT_Outline_New
* FT_Outline_Done
* FT_Outline_Copy
* FT_Outline_Translate
* FT_Outline_Transform
* FT_Outline_Embolden
* FT_Outline_EmboldenXY
* FT_Outline_Reverse
* FT_Outline_Check
*
* FT_Outline_Get_CBox
* FT_Outline_Get_BBox
*
* FT_Outline_Get_Bitmap
* FT_Outline_Render
* FT_Outline_Decompose
* FT_Outline_Funcs
* FT_Outline_MoveToFunc
* FT_Outline_LineToFunc
* FT_Outline_ConicToFunc
* FT_Outline_CubicToFunc
*
* FT_Orientation
* FT_Outline_Get_Orientation
*
* FT_OUTLINE_XXX
*
*/
/**************************************************************************
*
* @function:
* FT_Outline_Decompose
*
* @description:
* Walk over an outline's structure to decompose it into individual
* segments and Bezier arcs. This function also emits 'move to'
* operations to indicate the start of new contours in the outline.
*
* @input:
* outline ::
* A pointer to the source target.
*
* func_interface ::
* A table of 'emitters', i.e., function pointers called during
* decomposition to indicate path operations.
*
* @inout:
* user ::
* A typeless pointer that is passed to each emitter during the
* decomposition. It can be used to store the state during the
* decomposition.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* A contour that contains a single point only is represented by a 'move
* to' operation followed by 'line to' to the same point. In most cases,
* it is best to filter this out before using the outline for stroking
* purposes (otherwise it would result in a visible dot when round caps
* are used).
*
* Similarly, the function returns success for an empty outline also
* (doing nothing, this is, not calling any emitter); if necessary, you
* should filter this out, too.
*/
FT_EXPORT
(
FT_Error
)
FT_Outline_Decompose
(
FT_Outline
*
outline
,
const
FT_Outline_Funcs
*
func_interface
,
void
*
user
);
/**************************************************************************
*
* @function:
* FT_Outline_New
*
* @description:
* Create a new outline of a given size.
*
* @input:
* library ::
* A handle to the library object from where the outline is allocated.
* Note however that the new outline will **not** necessarily be
* **freed**, when destroying the library, by @FT_Done_FreeType.
*
* numPoints ::
* The maximum number of points within the outline. Must be smaller
* than or equal to 0xFFFF (65535).
*
* numContours ::
* The maximum number of contours within the outline. This value must
* be in the range 0 to `numPoints`.
*
* @output:
* anoutline ::
* A handle to the new outline.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* The reason why this function takes a `library` parameter is simply to
* use the library's memory allocator.
*/
FT_EXPORT
(
FT_Error
)
FT_Outline_New
(
FT_Library
library
,
FT_UInt
numPoints
,
FT_Int
numContours
,
FT_Outline
*
anoutline
);
/**************************************************************************
*
* @function:
* FT_Outline_Done
*
* @description:
* Destroy an outline created with @FT_Outline_New.
*
* @input:
* library ::
* A handle of the library object used to allocate the outline.
*
* outline ::
* A pointer to the outline object to be discarded.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* If the outline's 'owner' field is not set, only the outline descriptor
* will be released.
*/
FT_EXPORT
(
FT_Error
)
FT_Outline_Done
(
FT_Library
library
,
FT_Outline
*
outline
);
/**************************************************************************
*
* @function:
* FT_Outline_Check
*
* @description:
* Check the contents of an outline descriptor.
*
* @input:
* outline ::
* A handle to a source outline.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* An empty outline, or an outline with a single point only is also
* valid.
*/
FT_EXPORT
(
FT_Error
)
FT_Outline_Check
(
FT_Outline
*
outline
);
/**************************************************************************
*
* @function:
* FT_Outline_Get_CBox
*
* @description:
* Return an outline's 'control box'. The control box encloses all the
* outline's points, including Bezier control points. Though it
* coincides with the exact bounding box for most glyphs, it can be
* slightly larger in some situations (like when rotating an outline that
* contains Bezier outside arcs).
*
* Computing the control box is very fast, while getting the bounding box
* can take much more time as it needs to walk over all segments and arcs
* in the outline. To get the latter, you can use the 'ftbbox'
* component, which is dedicated to this single task.
*
* @input:
* outline ::
* A pointer to the source outline descriptor.
*
* @output:
* acbox ::
* The outline's control box.
*
* @note:
* See @FT_Glyph_Get_CBox for a discussion of tricky fonts.
*/
FT_EXPORT
(
void
)
FT_Outline_Get_CBox
(
const
FT_Outline
*
outline
,
FT_BBox
*
acbox
);
/**************************************************************************
*
* @function:
* FT_Outline_Translate
*
* @description:
* Apply a simple translation to the points of an outline.
*
* @inout:
* outline ::
* A pointer to the target outline descriptor.
*
* @input:
* xOffset ::
* The horizontal offset.
*
* yOffset ::
* The vertical offset.
*/
FT_EXPORT
(
void
)
FT_Outline_Translate
(
const
FT_Outline
*
outline
,
FT_Pos
xOffset
,
FT_Pos
yOffset
);
/**************************************************************************
*
* @function:
* FT_Outline_Copy
*
* @description:
* Copy an outline into another one. Both objects must have the same
* sizes (number of points & number of contours) when this function is
* called.
*
* @input:
* source ::
* A handle to the source outline.
*
* @output:
* target ::
* A handle to the target outline.
*
* @return:
* FreeType error code. 0~means success.
*/
FT_EXPORT
(
FT_Error
)
FT_Outline_Copy
(
const
FT_Outline
*
source
,
FT_Outline
*
target
);
/**************************************************************************
*
* @function:
* FT_Outline_Transform
*
* @description:
* Apply a simple 2x2 matrix to all of an outline's points. Useful for
* applying rotations, slanting, flipping, etc.
*
* @inout:
* outline ::
* A pointer to the target outline descriptor.
*
* @input:
* matrix ::
* A pointer to the transformation matrix.
*
* @note:
* You can use @FT_Outline_Translate if you need to translate the
* outline's points.
*/
FT_EXPORT
(
void
)
FT_Outline_Transform
(
const
FT_Outline
*
outline
,
const
FT_Matrix
*
matrix
);
/**************************************************************************
*
* @function:
* FT_Outline_Embolden
*
* @description:
* Embolden an outline. The new outline will be at most 4~times
* `strength` pixels wider and higher. You may think of the left and
* bottom borders as unchanged.
*
* Negative `strength` values to reduce the outline thickness are
* possible also.
*
* @inout:
* outline ::
* A handle to the target outline.
*
* @input:
* strength ::
* How strong the glyph is emboldened. Expressed in 26.6 pixel format.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* The used algorithm to increase or decrease the thickness of the glyph
* doesn't change the number of points; this means that certain
* situations like acute angles or intersections are sometimes handled
* incorrectly.
*
* If you need 'better' metrics values you should call
* @FT_Outline_Get_CBox or @FT_Outline_Get_BBox.
*
* To get meaningful results, font scaling values must be set with
* functions like @FT_Set_Char_Size before calling FT_Render_Glyph.
*
* @example:
* ```
* FT_Load_Glyph( face, index, FT_LOAD_DEFAULT );
*
* if ( face->glyph->format == FT_GLYPH_FORMAT_OUTLINE )
* FT_Outline_Embolden( &face->glyph->outline, strength );
* ```
*
*/
FT_EXPORT
(
FT_Error
)
FT_Outline_Embolden
(
FT_Outline
*
outline
,
FT_Pos
strength
);
/**************************************************************************
*
* @function:
* FT_Outline_EmboldenXY
*
* @description:
* Embolden an outline. The new outline will be `xstrength` pixels wider
* and `ystrength` pixels higher. Otherwise, it is similar to
* @FT_Outline_Embolden, which uses the same strength in both directions.
*
* @since:
* 2.4.10
*/
FT_EXPORT
(
FT_Error
)
FT_Outline_EmboldenXY
(
FT_Outline
*
outline
,
FT_Pos
xstrength
,
FT_Pos
ystrength
);
/**************************************************************************
*
* @function:
* FT_Outline_Reverse
*
* @description:
* Reverse the drawing direction of an outline. This is used to ensure
* consistent fill conventions for mirrored glyphs.
*
* @inout:
* outline ::
* A pointer to the target outline descriptor.
*
* @note:
* This function toggles the bit flag @FT_OUTLINE_REVERSE_FILL in the
* outline's `flags` field.
*
* It shouldn't be used by a normal client application, unless it knows
* what it is doing.
*/
FT_EXPORT
(
void
)
FT_Outline_Reverse
(
FT_Outline
*
outline
);
/**************************************************************************
*
* @function:
* FT_Outline_Get_Bitmap
*
* @description:
* Render an outline within a bitmap. The outline's image is simply
* OR-ed to the target bitmap.
*
* @input:
* library ::
* A handle to a FreeType library object.
*
* outline ::
* A pointer to the source outline descriptor.
*
* @inout:
* abitmap ::
* A pointer to the target bitmap descriptor.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* This function does **not create** the bitmap, it only renders an
* outline image within the one you pass to it! Consequently, the
* various fields in `abitmap` should be set accordingly.
*
* It will use the raster corresponding to the default glyph format.
*
* The value of the `num_grays` field in `abitmap` is ignored. If you
* select the gray-level rasterizer, and you want less than 256 gray
* levels, you have to use @FT_Outline_Render directly.
*/
FT_EXPORT
(
FT_Error
)
FT_Outline_Get_Bitmap
(
FT_Library
library
,
FT_Outline
*
outline
,
const
FT_Bitmap
*
abitmap
);
/**************************************************************************
*
* @function:
* FT_Outline_Render
*
* @description:
* Render an outline within a bitmap using the current scan-convert.
*
* @input:
* library ::
* A handle to a FreeType library object.
*
* outline ::
* A pointer to the source outline descriptor.
*
* @inout:
* params ::
* A pointer to an @FT_Raster_Params structure used to describe the
* rendering operation.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* This advanced function uses @FT_Raster_Params as an argument,
* allowing FreeType rasterizer to be used for direct composition,
* translucency, etc. You should know how to set up @FT_Raster_Params
* for this function to work.
*
* The field `params.source` will be set to `outline` before the scan
* converter is called, which means that the value you give to it is
* actually ignored.
*
* The gray-level rasterizer always uses 256 gray levels. If you want
* less gray levels, you have to provide your own span callback. See the
* @FT_RASTER_FLAG_DIRECT value of the `flags` field in the
* @FT_Raster_Params structure for more details.
*/
FT_EXPORT
(
FT_Error
)
FT_Outline_Render
(
FT_Library
library
,
FT_Outline
*
outline
,
FT_Raster_Params
*
params
);
/**************************************************************************
*
* @enum:
* FT_Orientation
*
* @description:
* A list of values used to describe an outline's contour orientation.
*
* The TrueType and PostScript specifications use different conventions
* to determine whether outline contours should be filled or unfilled.
*
* @values:
* FT_ORIENTATION_TRUETYPE ::
* According to the TrueType specification, clockwise contours must be
* filled, and counter-clockwise ones must be unfilled.
*
* FT_ORIENTATION_POSTSCRIPT ::
* According to the PostScript specification, counter-clockwise
* contours must be filled, and clockwise ones must be unfilled.
*
* FT_ORIENTATION_FILL_RIGHT ::
* This is identical to @FT_ORIENTATION_TRUETYPE, but is used to
* remember that in TrueType, everything that is to the right of the
* drawing direction of a contour must be filled.
*
* FT_ORIENTATION_FILL_LEFT ::
* This is identical to @FT_ORIENTATION_POSTSCRIPT, but is used to
* remember that in PostScript, everything that is to the left of the
* drawing direction of a contour must be filled.
*
* FT_ORIENTATION_NONE ::
* The orientation cannot be determined. That is, different parts of
* the glyph have different orientation.
*
*/
typedef
enum
FT_Orientation_
{
FT_ORIENTATION_TRUETYPE
=
0
,
FT_ORIENTATION_POSTSCRIPT
=
1
,
FT_ORIENTATION_FILL_RIGHT
=
FT_ORIENTATION_TRUETYPE
,
FT_ORIENTATION_FILL_LEFT
=
FT_ORIENTATION_POSTSCRIPT
,
FT_ORIENTATION_NONE
}
FT_Orientation
;
/**************************************************************************
*
* @function:
* FT_Outline_Get_Orientation
*
* @description:
* This function analyzes a glyph outline and tries to compute its fill
* orientation (see @FT_Orientation). This is done by integrating the
* total area covered by the outline. The positive integral corresponds
* to the clockwise orientation and @FT_ORIENTATION_POSTSCRIPT is
* returned. The negative integral corresponds to the counter-clockwise
* orientation and @FT_ORIENTATION_TRUETYPE is returned.
*
* Note that this will return @FT_ORIENTATION_TRUETYPE for empty
* outlines.
*
* @input:
* outline ::
* A handle to the source outline.
*
* @return:
* The orientation.
*
*/
FT_EXPORT
(
FT_Orientation
)
FT_Outline_Get_Orientation
(
FT_Outline
*
outline
);
/* */
FT_END_HEADER
#endif
/* FTOUTLN_H_ */
/* END */
/* Local Variables: */
/* coding: utf-8 */
/* End: */
CMU462/deps/freetype/include/freetype/ftparams.h
0 → 100644
View file @
57023a55
/****************************************************************************
*
* ftparams.h
*
* FreeType API for possible FT_Parameter tags (specification only).
*
* Copyright (C) 2017-2019 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 FTPARAMS_H_
#define FTPARAMS_H_
#include <ft2build.h>
#include FT_FREETYPE_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
FT_BEGIN_HEADER
/**************************************************************************
*
* @section:
* parameter_tags
*
* @title:
* Parameter Tags
*
* @abstract:
* Macros for driver property and font loading parameter tags.
*
* @description:
* This section contains macros for the @FT_Parameter structure that are
* used with various functions to activate some special functionality or
* different behaviour of various components of FreeType.
*
*/
/**************************************************************************
*
* @enum:
* FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY
*
* @description:
* A tag for @FT_Parameter to make @FT_Open_Face ignore typographic
* family names in the 'name' table (introduced in OpenType version 1.4).
* Use this for backward compatibility with legacy systems that have a
* four-faces-per-family restriction.
*
* @since:
* 2.8
*
*/
#define FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY \
FT_MAKE_TAG( 'i', 'g', 'p', 'f' )
/* this constant is deprecated */
#define FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY \
FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY
/**************************************************************************
*
* @enum:
* FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY
*
* @description:
* A tag for @FT_Parameter to make @FT_Open_Face ignore typographic
* subfamily names in the 'name' table (introduced in OpenType version
* 1.4). Use this for backward compatibility with legacy systems that
* have a four-faces-per-family restriction.
*
* @since:
* 2.8
*
*/
#define FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY \
FT_MAKE_TAG( 'i', 'g', 'p', 's' )
/* this constant is deprecated */
#define FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY \
FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY
/**************************************************************************
*
* @enum:
* FT_PARAM_TAG_INCREMENTAL
*
* @description:
* An @FT_Parameter tag to be used with @FT_Open_Face to indicate
* incremental glyph loading.
*
*/
#define FT_PARAM_TAG_INCREMENTAL \
FT_MAKE_TAG( 'i', 'n', 'c', 'r' )
/**************************************************************************
*
* @enum:
* FT_PARAM_TAG_LCD_FILTER_WEIGHTS
*
* @description:
* An @FT_Parameter tag to be used with @FT_Face_Properties. The
* corresponding argument specifies the five LCD filter weights for a
* given face (if using @FT_LOAD_TARGET_LCD, for example), overriding the
* global default values or the values set up with
* @FT_Library_SetLcdFilterWeights.
*
* @since:
* 2.8
*
*/
#define FT_PARAM_TAG_LCD_FILTER_WEIGHTS \
FT_MAKE_TAG( 'l', 'c', 'd', 'f' )
/**************************************************************************
*
* @enum:
* FT_PARAM_TAG_RANDOM_SEED
*
* @description:
* An @FT_Parameter tag to be used with @FT_Face_Properties. The
* corresponding 32bit signed integer argument overrides the font
* driver's random seed value with a face-specific one; see @random-seed.
*
* @since:
* 2.8
*
*/
#define FT_PARAM_TAG_RANDOM_SEED \
FT_MAKE_TAG( 's', 'e', 'e', 'd' )
/**************************************************************************
*
* @enum:
* FT_PARAM_TAG_STEM_DARKENING
*
* @description:
* An @FT_Parameter tag to be used with @FT_Face_Properties. The
* corresponding Boolean argument specifies whether to apply stem
* darkening, overriding the global default values or the values set up
* with @FT_Property_Set (see @no-stem-darkening).
*
* This is a passive setting that only takes effect if the font driver or
* autohinter honors it, which the CFF, Type~1, and CID drivers always
* do, but the autohinter only in 'light' hinting mode (as of version
* 2.9).
*
* @since:
* 2.8
*
*/
#define FT_PARAM_TAG_STEM_DARKENING \
FT_MAKE_TAG( 'd', 'a', 'r', 'k' )
/**************************************************************************
*
* @enum:
* FT_PARAM_TAG_UNPATENTED_HINTING
*
* @description:
* Deprecated, no effect.
*
* Previously: A constant used as the tag of an @FT_Parameter structure
* to indicate that unpatented methods only should be used by the
* TrueType bytecode interpreter for a typeface opened by @FT_Open_Face.
*
*/
#define FT_PARAM_TAG_UNPATENTED_HINTING \
FT_MAKE_TAG( 'u', 'n', 'p', 'a' )
/* */
FT_END_HEADER
#endif
/* FTPARAMS_H_ */
/* END */
CMU462/deps/freetype/include/freetype/ftpfr.h
0 → 100644
View file @
57023a55
/****************************************************************************
*
* ftpfr.h
*
* FreeType API for accessing PFR-specific data (specification only).
*
* Copyright (C) 2002-2019 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 FTPFR_H_
#define FTPFR_H_
#include <ft2build.h>
#include FT_FREETYPE_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
FT_BEGIN_HEADER
/**************************************************************************
*
* @section:
* pfr_fonts
*
* @title:
* PFR Fonts
*
* @abstract:
* PFR/TrueDoc-specific API.
*
* @description:
* This section contains the declaration of PFR-specific functions.
*
*/
/**************************************************************************
*
* @function:
* FT_Get_PFR_Metrics
*
* @description:
* Return the outline and metrics resolutions of a given PFR face.
*
* @input:
* face ::
* Handle to the input face. It can be a non-PFR face.
*
* @output:
* aoutline_resolution ::
* Outline resolution. This is equivalent to `face->units_per_EM` for
* non-PFR fonts. Optional (parameter can be `NULL`).
*
* ametrics_resolution ::
* Metrics resolution. This is equivalent to `outline_resolution` for
* non-PFR fonts. Optional (parameter can be `NULL`).
*
* ametrics_x_scale ::
* A 16.16 fixed-point number used to scale distance expressed in
* metrics units to device subpixels. This is equivalent to
* `face->size->x_scale`, but for metrics only. Optional (parameter
* can be `NULL`).
*
* ametrics_y_scale ::
* Same as `ametrics_x_scale` but for the vertical direction.
* optional (parameter can be `NULL`).
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* If the input face is not a PFR, this function will return an error.
* However, in all cases, it will return valid values.
*/
FT_EXPORT
(
FT_Error
)
FT_Get_PFR_Metrics
(
FT_Face
face
,
FT_UInt
*
aoutline_resolution
,
FT_UInt
*
ametrics_resolution
,
FT_Fixed
*
ametrics_x_scale
,
FT_Fixed
*
ametrics_y_scale
);
/**************************************************************************
*
* @function:
* FT_Get_PFR_Kerning
*
* @description:
* Return the kerning pair corresponding to two glyphs in a PFR face.
* The distance is expressed in metrics units, unlike the result of
* @FT_Get_Kerning.
*
* @input:
* face ::
* A handle to the input face.
*
* left ::
* Index of the left glyph.
*
* right ::
* Index of the right glyph.
*
* @output:
* avector ::
* A kerning vector.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* This function always return distances in original PFR metrics units.
* This is unlike @FT_Get_Kerning with the @FT_KERNING_UNSCALED mode,
* which always returns distances converted to outline units.
*
* You can use the value of the `x_scale` and `y_scale` parameters
* returned by @FT_Get_PFR_Metrics to scale these to device subpixels.
*/
FT_EXPORT
(
FT_Error
)
FT_Get_PFR_Kerning
(
FT_Face
face
,
FT_UInt
left
,
FT_UInt
right
,
FT_Vector
*
avector
);
/**************************************************************************
*
* @function:
* FT_Get_PFR_Advance
*
* @description:
* Return a given glyph advance, expressed in original metrics units,
* from a PFR font.
*
* @input:
* face ::
* A handle to the input face.
*
* gindex ::
* The glyph index.
*
* @output:
* aadvance ::
* The glyph advance in metrics units.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* You can use the `x_scale` or `y_scale` results of @FT_Get_PFR_Metrics
* to convert the advance to device subpixels (i.e., 1/64th of pixels).
*/
FT_EXPORT
(
FT_Error
)
FT_Get_PFR_Advance
(
FT_Face
face
,
FT_UInt
gindex
,
FT_Pos
*
aadvance
);
/* */
FT_END_HEADER
#endif
/* FTPFR_H_ */
/* END */
CMU462/deps/freetype/include/
freetype2/
freetype/ftrender.h
→
CMU462/deps/freetype/include/freetype/ftrender.h
100755 → 100644
View file @
57023a55
/***************************************************************************
/
/*
*
/
/*
ftrender.h
*/
/*
*
/
/*
FreeType renderer modules public interface (specification).
*/
/*
*
/
/*
Copyright 1996-20
0
1
, 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
__
FTRENDER_H_
_
#define
__
FTRENDER_H_
_
/***************************************************************************
*
*
*
ftrender.h
*
*
FreeType renderer modules public interface (specification).
*
*
Copyright
(C)
1996-201
9 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 FTRENDER_H_
#define FTRENDER_H_
#include <ft2build.h>
...
...
@@ -28,12 +28,12 @@
FT_BEGIN_HEADER
/*************************************************************************
/
/*
*
/
/
*
<S
ection
> */
/*
module_management
*/
/*
*
/
/************************************************************************
*/
/*************************************************************************
*
*
*
@s
ection
:
*
module_management
*
*/
/* create a new glyph object */
...
...
@@ -75,6 +75,7 @@ FT_BEGIN_HEADER
{
FT_Long
glyph_size
;
FT_Glyph_Format
glyph_format
;
FT_Glyph_InitFunc
glyph_init
;
FT_Glyph_DoneFunc
glyph_done
;
FT_Glyph_CopyFunc
glyph_copy
;
...
...
@@ -87,7 +88,7 @@ FT_BEGIN_HEADER
typedef
FT_Error
(
*
FT_Renderer_RenderFunc
)(
FT_Renderer
renderer
,
FT_GlyphSlot
slot
,
FT_
UInt
mode
,
FT_
Render_Mode
mode
,
const
FT_Vector
*
origin
);
typedef
FT_Error
...
...
@@ -115,36 +116,43 @@ FT_BEGIN_HEADER
#define FTRenderer_setMode FT_Renderer_SetModeFunc
/*************************************************************************/
/* */
/* <Struct> */
/* FT_Renderer_Class */
/* */
/* <Description> */
/* The renderer module class descriptor. */
/* */
/* <Fields> */
/* root :: The root @FT_Module_Class fields. */
/* */
/* glyph_format :: The glyph image format this renderer handles. */
/* */
/* render_glyph :: A method used to render the image that is in a */
/* given glyph slot into a bitmap. */
/* */
/* set_mode :: A method used to pass additional parameters. */
/* */
/* raster_class :: For @FT_GLYPH_FORMAT_OUTLINE renderers only. This */
/* is a pointer to its raster's class. */
/* */
/* raster :: For @FT_GLYPH_FORMAT_OUTLINE renderers only. This */
/* is a pointer to the corresponding raster object, */
/* if any. */
/* */
/**************************************************************************
*
* @struct:
* FT_Renderer_Class
*
* @description:
* The renderer module class descriptor.
*
* @fields:
* root ::
* The root @FT_Module_Class fields.
*
* glyph_format ::
* The glyph image format this renderer handles.
*
* render_glyph ::
* A method used to render the image that is in a given glyph slot into
* a bitmap.
*
* transform_glyph ::
* A method used to transform the image that is in a given glyph slot.
*
* get_glyph_cbox ::
* A method used to access the glyph's cbox.
*
* set_mode ::
* A method used to pass additional parameters.
*
* raster_class ::
* For @FT_GLYPH_FORMAT_OUTLINE renderers only. This is a pointer to
* its raster's class.
*/
typedef
struct
FT_Renderer_Class_
{
FT_Module_Class
root
;
FT_Module_Class
root
;
FT_Glyph_Format
glyph_format
;
FT_Glyph_Format
glyph_format
;
FT_Renderer_RenderFunc
render_glyph
;
FT_Renderer_TransformFunc
transform_glyph
;
...
...
@@ -156,74 +164,82 @@ FT_BEGIN_HEADER
}
FT_Renderer_Class
;
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_Renderer */
/* */
/* <Description> */
/* Retrieves the current renderer for a given glyph format. */
/* */
/* <Input> */
/* library :: A handle to the library object. */
/* */
/* format :: The glyph format. */
/* */
/* <Return> */
/* A renderer handle. 0 if none found. */
/* */
/* <Note> */
/* An error will be returned if a module already exists by that name, */
/* or if the module requires a version of FreeType that is too great. */
/* */
/* To add a new renderer, simply use @FT_Add_Module. To retrieve a */
/* renderer by its name, use @FT_Get_Module. */
/* */
/**************************************************************************
*
* @function:
* FT_Get_Renderer
*
* @description:
* Retrieve the current renderer for a given glyph format.
*
* @input:
* library ::
* A handle to the library object.
*
* format ::
* The glyph format.
*
* @return:
* A renderer handle. 0~if none found.
*
* @note:
* An error will be returned if a module already exists by that name, or
* if the module requires a version of FreeType that is too great.
*
* To add a new renderer, simply use @FT_Add_Module. To retrieve a
* renderer by its name, use @FT_Get_Module.
*/
FT_EXPORT
(
FT_Renderer
)
FT_Get_Renderer
(
FT_Library
library
,
FT_Glyph_Format
format
);
/*************************************************************************/
/* */
/* <Function> */
/* FT_Set_Renderer */
/* */
/* <Description> */
/* Sets the current renderer to use, and set additional mode. */
/* */
/* <InOut> */
/* library :: A handle to the library object. */
/* */
/* <Input> */
/* renderer :: A handle to the renderer object. */
/* */
/* num_params :: The number of additional parameters. */
/* */
/* parameters :: Additional parameters. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
/* <Note> */
/* In case of success, the renderer will be used to convert glyph */
/* images in the renderer's known format into bitmaps. */
/* */
/* This doesn't change the current renderer for other formats. */
/* */
/**************************************************************************
*
* @function:
* FT_Set_Renderer
*
* @description:
* Set the current renderer to use, and set additional mode.
*
* @inout:
* library ::
* A handle to the library object.
*
* @input:
* renderer ::
* A handle to the renderer object.
*
* num_params ::
* The number of additional parameters.
*
* parameters ::
* Additional parameters.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* In case of success, the renderer will be used to convert glyph images
* in the renderer's known format into bitmaps.
*
* This doesn't change the current renderer for other formats.
*
* Currently, no FreeType renderer module uses `parameters`; you should
* thus always pass `NULL` as the value.
*/
FT_EXPORT
(
FT_Error
)
FT_Set_Renderer
(
FT_Library
library
,
FT_Renderer
renderer
,
FT_UInt
num_params
,
FT_Parameter
*
parameters
);
/* */
FT_END_HEADER
#endif
/*
__
FTRENDER_H_
_
*/
#endif
/* FTRENDER_H_ */
/* END */
CMU462/deps/freetype/include/freetype/ftsizes.h
0 → 100644
View file @
57023a55
/****************************************************************************
*
* ftsizes.h
*
* FreeType size objects management (specification).
*
* Copyright (C) 1996-2019 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.
*
*/
/**************************************************************************
*
* Typical application would normally not need to use these functions.
* However, they have been placed in a public API for the rare cases where
* they are needed.
*
*/
#ifndef FTSIZES_H_
#define FTSIZES_H_
#include <ft2build.h>
#include FT_FREETYPE_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
FT_BEGIN_HEADER
/**************************************************************************
*
* @section:
* sizes_management
*
* @title:
* Size Management
*
* @abstract:
* Managing multiple sizes per face.
*
* @description:
* When creating a new face object (e.g., with @FT_New_Face), an @FT_Size
* object is automatically created and used to store all pixel-size
* dependent information, available in the `face->size` field.
*
* It is however possible to create more sizes for a given face, mostly
* in order to manage several character pixel sizes of the same font
* family and style. See @FT_New_Size and @FT_Done_Size.
*
* Note that @FT_Set_Pixel_Sizes and @FT_Set_Char_Size only modify the
* contents of the current 'active' size; you thus need to use
* @FT_Activate_Size to change it.
*
* 99% of applications won't need the functions provided here, especially
* if they use the caching sub-system, so be cautious when using these.
*
*/
/**************************************************************************
*
* @function:
* FT_New_Size
*
* @description:
* Create a new size object from a given face object.
*
* @input:
* face ::
* A handle to a parent face object.
*
* @output:
* asize ::
* A handle to a new size object.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* You need to call @FT_Activate_Size in order to select the new size for
* upcoming calls to @FT_Set_Pixel_Sizes, @FT_Set_Char_Size,
* @FT_Load_Glyph, @FT_Load_Char, etc.
*/
FT_EXPORT
(
FT_Error
)
FT_New_Size
(
FT_Face
face
,
FT_Size
*
size
);
/**************************************************************************
*
* @function:
* FT_Done_Size
*
* @description:
* Discard a given size object. Note that @FT_Done_Face automatically
* discards all size objects allocated with @FT_New_Size.
*
* @input:
* size ::
* A handle to a target size object.
*
* @return:
* FreeType error code. 0~means success.
*/
FT_EXPORT
(
FT_Error
)
FT_Done_Size
(
FT_Size
size
);
/**************************************************************************
*
* @function:
* FT_Activate_Size
*
* @description:
* Even though it is possible to create several size objects for a given
* face (see @FT_New_Size for details), functions like @FT_Load_Glyph or
* @FT_Load_Char only use the one that has been activated last to
* determine the 'current character pixel size'.
*
* This function can be used to 'activate' a previously created size
* object.
*
* @input:
* size ::
* A handle to a target size object.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* If `face` is the size's parent face object, this function changes the
* value of `face->size` to the input size handle.
*/
FT_EXPORT
(
FT_Error
)
FT_Activate_Size
(
FT_Size
size
);
/* */
FT_END_HEADER
#endif
/* FTSIZES_H_ */
/* END */
CMU462/deps/freetype/include/freetype/ftsnames.h
0 → 100644
View file @
57023a55
/****************************************************************************
*
* ftsnames.h
*
* Simple interface to access SFNT 'name' tables (which are used
* to hold font names, copyright info, notices, etc.) (specification).
*
* This is _not_ used to retrieve glyph names!
*
* Copyright (C) 1996-2019 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 FTSNAMES_H_
#define FTSNAMES_H_
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_PARAMETER_TAGS_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
FT_BEGIN_HEADER
/**************************************************************************
*
* @section:
* sfnt_names
*
* @title:
* SFNT Names
*
* @abstract:
* Access the names embedded in TrueType and OpenType files.
*
* @description:
* The TrueType and OpenType specifications allow the inclusion of a
* special names table ('name') in font files. This table contains
* textual (and internationalized) information regarding the font, like
* family name, copyright, version, etc.
*
* The definitions below are used to access them if available.
*
* Note that this has nothing to do with glyph names!
*
*/
/**************************************************************************
*
* @struct:
* FT_SfntName
*
* @description:
* A structure used to model an SFNT 'name' table entry.
*
* @fields:
* platform_id ::
* The platform ID for `string`. See @TT_PLATFORM_XXX for possible
* values.
*
* encoding_id ::
* The encoding ID for `string`. See @TT_APPLE_ID_XXX, @TT_MAC_ID_XXX,
* @TT_ISO_ID_XXX, @TT_MS_ID_XXX, and @TT_ADOBE_ID_XXX for possible
* values.
*
* language_id ::
* The language ID for `string`. See @TT_MAC_LANGID_XXX and
* @TT_MS_LANGID_XXX for possible values.
*
* Registered OpenType values for `language_id` are always smaller than
* 0x8000; values equal or larger than 0x8000 usually indicate a
* language tag string (introduced in OpenType version 1.6). Use
* function @FT_Get_Sfnt_LangTag with `language_id` as its argument to
* retrieve the associated language tag.
*
* name_id ::
* An identifier for `string`. See @TT_NAME_ID_XXX for possible
* values.
*
* string ::
* The 'name' string. Note that its format differs depending on the
* (platform,encoding) pair, being either a string of bytes (without a
* terminating `NULL` byte) or containing UTF-16BE entities.
*
* string_len ::
* The length of `string` in bytes.
*
* @note:
* Please refer to the TrueType or OpenType specification for more
* details.
*/
typedef
struct
FT_SfntName_
{
FT_UShort
platform_id
;
FT_UShort
encoding_id
;
FT_UShort
language_id
;
FT_UShort
name_id
;
FT_Byte
*
string
;
/* this string is *not* null-terminated! */
FT_UInt
string_len
;
/* in bytes */
}
FT_SfntName
;
/**************************************************************************
*
* @function:
* FT_Get_Sfnt_Name_Count
*
* @description:
* Retrieve the number of name strings in the SFNT 'name' table.
*
* @input:
* face ::
* A handle to the source face.
*
* @return:
* The number of strings in the 'name' table.
*
* @note:
* This function always returns an error if the config macro
* `TT_CONFIG_OPTION_SFNT_NAMES` is not defined in `ftoption.h`.
*/
FT_EXPORT
(
FT_UInt
)
FT_Get_Sfnt_Name_Count
(
FT_Face
face
);
/**************************************************************************
*
* @function:
* FT_Get_Sfnt_Name
*
* @description:
* Retrieve a string of the SFNT 'name' table for a given index.
*
* @input:
* face ::
* A handle to the source face.
*
* idx ::
* The index of the 'name' string.
*
* @output:
* aname ::
* The indexed @FT_SfntName structure.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* The `string` array returned in the `aname` structure is not
* null-terminated. Note that you don't have to deallocate `string` by
* yourself; FreeType takes care of it if you call @FT_Done_Face.
*
* Use @FT_Get_Sfnt_Name_Count to get the total number of available
* 'name' table entries, then do a loop until you get the right platform,
* encoding, and name ID.
*
* 'name' table format~1 entries can use language tags also, see
* @FT_Get_Sfnt_LangTag.
*
* This function always returns an error if the config macro
* `TT_CONFIG_OPTION_SFNT_NAMES` is not defined in `ftoption.h`.
*/
FT_EXPORT
(
FT_Error
)
FT_Get_Sfnt_Name
(
FT_Face
face
,
FT_UInt
idx
,
FT_SfntName
*
aname
);
/**************************************************************************
*
* @struct:
* FT_SfntLangTag
*
* @description:
* A structure to model a language tag entry from an SFNT 'name' table.
*
* @fields:
* string ::
* The language tag string, encoded in UTF-16BE (without trailing
* `NULL` bytes).
*
* string_len ::
* The length of `string` in **bytes**.
*
* @note:
* Please refer to the TrueType or OpenType specification for more
* details.
*
* @since:
* 2.8
*/
typedef
struct
FT_SfntLangTag_
{
FT_Byte
*
string
;
/* this string is *not* null-terminated! */
FT_UInt
string_len
;
/* in bytes */
}
FT_SfntLangTag
;
/**************************************************************************
*
* @function:
* FT_Get_Sfnt_LangTag
*
* @description:
* Retrieve the language tag associated with a language ID of an SFNT
* 'name' table entry.
*
* @input:
* face ::
* A handle to the source face.
*
* langID ::
* The language ID, as returned by @FT_Get_Sfnt_Name. This is always a
* value larger than 0x8000.
*
* @output:
* alangTag ::
* The language tag associated with the 'name' table entry's language
* ID.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* The `string` array returned in the `alangTag` structure is not
* null-terminated. Note that you don't have to deallocate `string` by
* yourself; FreeType takes care of it if you call @FT_Done_Face.
*
* Only 'name' table format~1 supports language tags. For format~0
* tables, this function always returns FT_Err_Invalid_Table. For
* invalid format~1 language ID values, FT_Err_Invalid_Argument is
* returned.
*
* This function always returns an error if the config macro
* `TT_CONFIG_OPTION_SFNT_NAMES` is not defined in `ftoption.h`.
*
* @since:
* 2.8
*/
FT_EXPORT
(
FT_Error
)
FT_Get_Sfnt_LangTag
(
FT_Face
face
,
FT_UInt
langID
,
FT_SfntLangTag
*
alangTag
);
/* */
FT_END_HEADER
#endif
/* FTSNAMES_H_ */
/* END */
CMU462/deps/freetype/include/
freetype2/
freetype/ftstroke.h
→
CMU462/deps/freetype/include/freetype/ftstroke.h
100755 → 100644
View file @
57023a55
/***************************************************************************
/
/*
*
/
/*
ftstroke.h
*/
/*
*
/
/*
FreeType path stroker (specification).
*/
/*
*
/
/*
Copyright
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
__
FT
_
STROKE_H_
_
#define
__
FT
_
STROKE_H_
_
/***************************************************************************
*
*
*
ftstroke.h
*
*
FreeType path stroker (specification).
*
*
Copyright
(C) 2002-2019 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 FTSTROKE_H_
#define FTSTROKE_H_
#include <ft2build.h>
#include FT_OUTLINE_H
...
...
@@ -27,95 +27,146 @@
FT_BEGIN_HEADER
/************************************************************************
*
* @section:
* glyph_stroker
*
* @title:
* Glyph Stroker
*
* @abstract:
* Generating bordered and stroked glyphs.
*
* @description:
* This component generates stroked outlines of a given vectorial
* glyph. It also allows you to retrieve the `outside' and/or the
* `inside' borders of the stroke.
*
* This can be useful to generate `bordered' glyph, i.e., glyphs
* displayed with a coloured (and anti-aliased) border around their
* shape.
*/
/**************************************************************
*
* @type:
* FT_Stroker
*
* @description:
* Opaque handler to a path stroker object.
*/
/**************************************************************************
*
* @section:
* glyph_stroker
*
* @title:
* Glyph Stroker
*
* @abstract:
* Generating bordered and stroked glyphs.
*
* @description:
* This component generates stroked outlines of a given vectorial glyph.
* It also allows you to retrieve the 'outside' and/or the 'inside'
* borders of the stroke.
*
* This can be useful to generate 'bordered' glyph, i.e., glyphs
* displayed with a coloured (and anti-aliased) border around their
* shape.
*
* @order:
* FT_Stroker
*
* FT_Stroker_LineJoin
* FT_Stroker_LineCap
* FT_StrokerBorder
*
* FT_Outline_GetInsideBorder
* FT_Outline_GetOutsideBorder
*
* FT_Glyph_Stroke
* FT_Glyph_StrokeBorder
*
* FT_Stroker_New
* FT_Stroker_Set
* FT_Stroker_Rewind
* FT_Stroker_ParseOutline
* FT_Stroker_Done
*
* FT_Stroker_BeginSubPath
* FT_Stroker_EndSubPath
*
* FT_Stroker_LineTo
* FT_Stroker_ConicTo
* FT_Stroker_CubicTo
*
* FT_Stroker_GetBorderCounts
* FT_Stroker_ExportBorder
* FT_Stroker_GetCounts
* FT_Stroker_Export
*
*/
/**************************************************************************
*
* @type:
* FT_Stroker
*
* @description:
* Opaque handle to a path stroker object.
*/
typedef
struct
FT_StrokerRec_
*
FT_Stroker
;
/**************************************************************
/**************************************************************
************
*
* @enum:
* FT_Stroker_LineJoin
*
* @description:
* These values determine how two joining lines are rendered
*
in a
stroker.
* These values determine how two joining lines are rendered
in a
* stroker.
*
* @values:
* FT_STROKER_LINEJOIN_ROUND ::
* Used to render rounded line joins. Circular arcs are used
*
to join
two lines smoothly.
* Used to render rounded line joins. Circular arcs are used
to join
* two lines smoothly.
*
* FT_STROKER_LINEJOIN_BEVEL ::
* Used to render beveled line joins; i.e., the two joining lines
* are extended until they intersect.
*
* Used to render beveled line joins. The outer corner of the joined
* lines is filled by enclosing the triangular region of the corner
* with a straight line between the outer corners of each stroke.
*
* FT_STROKER_LINEJOIN_MITER_FIXED ::
* Used to render mitered line joins, with fixed bevels if the miter
* limit is exceeded. The outer edges of the strokes for the two
* segments are extended until they meet at an angle. If the segments
* meet at too sharp an angle (such that the miter would extend from
* the intersection of the segments a distance greater than the product
* of the miter limit value and the border radius), then a bevel join
* (see above) is used instead. This prevents long spikes being
* created. `FT_STROKER_LINEJOIN_MITER_FIXED` generates a miter line
* join as used in PostScript and PDF.
*
* FT_STROKER_LINEJOIN_MITER_VARIABLE ::
* FT_STROKER_LINEJOIN_MITER ::
* Same as beveled rendering, except that an additional line
* break is added if the angle between the two joining lines
* is too closed (this is useful to avoid unpleasant spikes
* in beveled rendering).
* Used to render mitered line joins, with variable bevels if the miter
* limit is exceeded. The intersection of the strokes is clipped at a
* line perpendicular to the bisector of the angle between the strokes,
* at the distance from the intersection of the segments equal to the
* product of the miter limit value and the border radius. This
* prevents long spikes being created.
* `FT_STROKER_LINEJOIN_MITER_VARIABLE` generates a mitered line join
* as used in XPS. `FT_STROKER_LINEJOIN_MITER` is an alias for
* `FT_STROKER_LINEJOIN_MITER_VARIABLE`, retained for backward
* compatibility.
*/
typedef
enum
typedef
enum
FT_Stroker_LineJoin_
{
FT_STROKER_LINEJOIN_ROUND
=
0
,
FT_STROKER_LINEJOIN_BEVEL
,
FT_STROKER_LINEJOIN_MITER
FT_STROKER_LINEJOIN_ROUND
=
0
,
FT_STROKER_LINEJOIN_BEVEL
=
1
,
FT_STROKER_LINEJOIN_MITER_VARIABLE
=
2
,
FT_STROKER_LINEJOIN_MITER
=
FT_STROKER_LINEJOIN_MITER_VARIABLE
,
FT_STROKER_LINEJOIN_MITER_FIXED
=
3
}
FT_Stroker_LineJoin
;
/**************************************************************
/**************************************************************
************
*
* @enum:
* FT_Stroker_LineCap
*
* @description:
* These values determine how the end of opened sub-paths are
*
rendered in
a stroke.
* These values determine how the end of opened sub-paths are
rendered in
* a stroke.
*
* @values:
* FT_STROKER_LINECAP_BUTT ::
* The end of lines is rendered as a full stop on the last
*
point
itself.
* The end of lines is rendered as a full stop on the last
point
* itself.
*
* FT_STROKER_LINECAP_ROUND ::
* The end of lines is rendered as a half-circle around the
* last point.
* The end of lines is rendered as a half-circle around the last point.
*
* FT_STROKER_LINECAP_SQUARE ::
* The end of lines is rendered as a square around the
* last point.
* The end of lines is rendered as a square around the last point.
*/
typedef
enum
typedef
enum
FT_Stroker_LineCap_
{
FT_STROKER_LINECAP_BUTT
=
0
,
FT_STROKER_LINECAP_ROUND
,
...
...
@@ -124,14 +175,14 @@ FT_BEGIN_HEADER
}
FT_Stroker_LineCap
;
/**************************************************************
/**************************************************************
************
*
* @enum:
* FT_StrokerBorder
*
* @description:
* These values are used to select a given stroke border
*
in
@FT_Stroker_GetBorderCounts and @FT_Stroker_ExportBorder.
* These values are used to select a given stroke border
in
* @FT_Stroker_GetBorderCounts and @FT_Stroker_ExportBorder.
*
* @values:
* FT_STROKER_BORDER_LEFT ::
...
...
@@ -141,15 +192,15 @@ FT_BEGIN_HEADER
* Select the right border, relative to the drawing direction.
*
* @note:
* Applications are generally interested in the
`
inside' and
`
outside'
* Applications are generally interested in the
'
inside' and
'
outside'
* borders. However, there is no direct mapping between these and the
*
`
left' and
`
right' ones, since this really depends on the glyph's
*
'
left' and
'
right' ones, since this really depends on the glyph's
* drawing orientation, which varies between font formats.
*
* You can however use @FT_Outline_GetInsideBorder and
* @FT_Outline_GetOutsideBorder to get these.
*/
typedef
enum
typedef
enum
FT_StrokerBorder_
{
FT_STROKER_BORDER_LEFT
=
0
,
FT_STROKER_BORDER_RIGHT
...
...
@@ -157,35 +208,35 @@ FT_BEGIN_HEADER
}
FT_StrokerBorder
;
/**************************************************************
/**************************************************************
************
*
* @function:
* FT_Outline_GetInsideBorder
*
* @description:
* Retrieve the @FT_StrokerBorder value corresponding to the
*
`inside'
borders of a given outline.
* Retrieve the @FT_StrokerBorder value corresponding to the
'inside'
* borders of a given outline.
*
* @input:
* outline ::
* The source outline handle.
*
* @return:
* The border index. @FT_STROKER_BORDER_
LEF
T for empty or invalid
* The border index. @FT_STROKER_BORDER_
RIGH
T for empty or invalid
* outlines.
*/
FT_EXPORT
(
FT_StrokerBorder
)
FT_Outline_GetInsideBorder
(
FT_Outline
*
outline
);
/**************************************************************
/**************************************************************
************
*
* @function:
* FT_Outline_GetOutsideBorder
*
* @description:
* Retrieve the @FT_StrokerBorder value corresponding to the
*
`outside'
borders of a given outline.
* Retrieve the @FT_StrokerBorder value corresponding to the
'outside'
* borders of a given outline.
*
* @input:
* outline ::
...
...
@@ -199,7 +250,7 @@ FT_BEGIN_HEADER
FT_Outline_GetOutsideBorder
(
FT_Outline
*
outline
);
/**************************************************************
/**************************************************************
************
*
* @function:
* FT_Stroker_New
...
...
@@ -213,17 +264,17 @@ FT_BEGIN_HEADER
*
* @output:
* astroker ::
* A new stroker object handle. NULL in case of error.
* A new stroker object handle.
`
NULL
`
in case of error.
*
* @return:
* FreeType error code. 0
means success.
* FreeType error code. 0
~
means success.
*/
FT_EXPORT
(
FT_Error
)
FT_Stroker_New
(
FT_Library
library
,
FT_Stroker
*
astroker
);
/**************************************************************
/**************************************************************
************
*
* @function:
* FT_Stroker_Set
...
...
@@ -245,12 +296,14 @@ FT_BEGIN_HEADER
* The line join style.
*
* miter_limit ::
* The miter limit for the FT_STROKER_LINEJOIN_MITER style,
* expressed as 16.16 fixed point value.
* The miter limit for the `FT_STROKER_LINEJOIN_MITER_FIXED` and
* `FT_STROKER_LINEJOIN_MITER_VARIABLE` line join styles, expressed as
* 16.16 fixed-point value.
*
* @note:
* The radius is expressed in the same units that the outline
* coordinates.
* The radius is expressed in the same units as the outline coordinates.
*
* This function calls @FT_Stroker_Rewind automatically.
*/
FT_EXPORT
(
void
)
FT_Stroker_Set
(
FT_Stroker
stroker
,
...
...
@@ -260,16 +313,15 @@ FT_BEGIN_HEADER
FT_Fixed
miter_limit
);
/**************************************************************
/**************************************************************
************
*
* @function:
* FT_Stroker_Rewind
*
* @description:
* Reset a stroker object without changing its attributes.
* You should call this function before beginning a new
* series of calls to @FT_Stroker_BeginSubPath or
* @FT_Stroker_EndSubPath.
* Reset a stroker object without changing its attributes. You should
* call this function before beginning a new series of calls to
* @FT_Stroker_BeginSubPath or @FT_Stroker_EndSubPath.
*
* @input:
* stroker ::
...
...
@@ -279,15 +331,15 @@ FT_BEGIN_HEADER
FT_Stroker_Rewind
(
FT_Stroker
stroker
);
/**************************************************************
/**************************************************************
************
*
* @function:
* FT_Stroker_ParseOutline
*
* @description:
* A convenience function used to parse a whole outline with
*
the stroker.
The resulting outline(s) can be retrieved
*
later by functions like
@FT_Stroker_GetCounts and @FT_Stroker_Export.
* A convenience function used to parse a whole outline with
the stroker.
* The resulting outline(s) can be retrieved
later by functions like
* @FT_Stroker_GetCounts and @FT_Stroker_Export.
*
* @input:
* stroker ::
...
...
@@ -297,18 +349,18 @@ FT_BEGIN_HEADER
* The source outline.
*
* opened ::
* A boolean. If
1, the outline is treated as an open path instead
*
of
a closed one.
* A boolean. If
~
1, the outline is treated as an open path instead
of
* a closed one.
*
* @return:
* FreeType error code. 0
means success.
* FreeType error code. 0
~
means success.
*
* @note:
* If `opened
'
is
0 (the default), the outline is treated as a closed
* path, and the stroker
will
generate two distinct
`
border' outlines.
* If `opened
`
is
~
0 (the default), the outline is treated as a closed
* path, and the stroker generate
s
two distinct
'
border' outlines.
*
* If `opened
'
is
1, the outline is processed as an open path, and the
* stroker
will
generate a single
`
stroke' outline.
* If `opened
`
is
~
1, the outline is processed as an open path, and the
* stroker generate
s
a single
'
stroke' outline.
*
* This function calls @FT_Stroker_Rewind automatically.
*/
...
...
@@ -318,7 +370,7 @@ FT_BEGIN_HEADER
FT_Bool
opened
);
/**************************************************************
/**************************************************************
************
*
* @function:
* FT_Stroker_BeginSubPath
...
...
@@ -334,14 +386,14 @@ FT_BEGIN_HEADER
* A pointer to the start vector.
*
* open ::
* A boolean. If
1, the sub-path is treated as an open one.
* A boolean. If
~
1, the sub-path is treated as an open one.
*
* @return:
* FreeType error code. 0
means success.
* FreeType error code. 0
~
means success.
*
* @note:
* This function is useful when you need to stroke a path that is
*
not
stored as an @FT_Outline object.
* This function is useful when you need to stroke a path that is
not
* stored as an @FT_Outline object.
*/
FT_EXPORT
(
FT_Error
)
FT_Stroker_BeginSubPath
(
FT_Stroker
stroker
,
...
...
@@ -349,7 +401,7 @@ FT_BEGIN_HEADER
FT_Bool
open
);
/**************************************************************
/**************************************************************
************
*
* @function:
* FT_Stroker_EndSubPath
...
...
@@ -362,25 +414,25 @@ FT_BEGIN_HEADER
* The target stroker handle.
*
* @return:
* FreeType error code. 0
means success.
* FreeType error code. 0
~
means success.
*
* @note:
* You should call this function after @FT_Stroker_BeginSubPath.
*
If the
subpath was not
`
opened', this function
will `
draw' a
*
single line segment
to the start position when needed.
* You should call this function after @FT_Stroker_BeginSubPath.
If the
* subpath was not
'
opened', this function
'
draw
s
' a
single line segment
* to the start position when needed.
*/
FT_EXPORT
(
FT_Error
)
FT_Stroker_EndSubPath
(
FT_Stroker
stroker
);
/**************************************************************
/**************************************************************
************
*
* @function:
* FT_Stroker_LineTo
*
* @description:
*
`
Draw' a single line segment in the stroker's current sub-path,
*
from
the last position.
*
'
Draw' a single line segment in the stroker's current sub-path,
from
* the last position.
*
* @input:
* stroker ::
...
...
@@ -390,7 +442,7 @@ FT_BEGIN_HEADER
* A pointer to the destination point.
*
* @return:
* FreeType error code. 0
means success.
* FreeType error code. 0
~
means success.
*
* @note:
* You should call this function between @FT_Stroker_BeginSubPath and
...
...
@@ -401,13 +453,13 @@ FT_BEGIN_HEADER
FT_Vector
*
to
);
/**************************************************************
/**************************************************************
************
*
* @function:
* FT_Stroker_ConicTo
*
* @description:
*
`
Draw' a single quadratic B
é
zier in the stroker's current sub-path,
*
'
Draw' a single quadratic B
e
zier in the stroker's current sub-path,
* from the last position.
*
* @input:
...
...
@@ -415,13 +467,13 @@ FT_BEGIN_HEADER
* The target stroker handle.
*
* control ::
* A pointer to a B
é
zier control point.
* A pointer to a B
e
zier control point.
*
* to ::
* A pointer to the destination point.
*
* @return:
* FreeType error code. 0
means success.
* FreeType error code. 0
~
means success.
*
* @note:
* You should call this function between @FT_Stroker_BeginSubPath and
...
...
@@ -433,30 +485,30 @@ FT_BEGIN_HEADER
FT_Vector
*
to
);
/**************************************************************
/**************************************************************
************
*
* @function:
* FT_Stroker_CubicTo
*
* @description:
*
`
Draw' a single cubic B
é
zier in the stroker's current sub-path,
*
from
the last position.
*
'
Draw' a single cubic B
e
zier in the stroker's current sub-path,
from
* the last position.
*
* @input:
* stroker ::
* The target stroker handle.
*
* control1 ::
* A pointer to the first B
é
zier control point.
* A pointer to the first B
e
zier control point.
*
* control2 ::
* A pointer to second B
é
zier control point.
* A pointer to second B
e
zier control point.
*
* to ::
* A pointer to the destination point.
*
* @return:
* FreeType error code. 0
means success.
* FreeType error code. 0
~
means success.
*
* @note:
* You should call this function between @FT_Stroker_BeginSubPath and
...
...
@@ -469,16 +521,16 @@ FT_BEGIN_HEADER
FT_Vector
*
to
);
/**************************************************************
/**************************************************************
************
*
* @function:
* FT_Stroker_GetBorderCounts
*
* @description:
* Call this function once you have finished parsing your paths
*
with the
stroker. It
will
return the number of points and
*
contours necessary to
export one of the
`
border' or
`
stroke'
*
outlines generated by the
stroker.
* Call this function once you have finished parsing your paths
with the
* stroker. It return
s
the number of points and
contours necessary to
* export one of the
'
border' or
'
stroke'
outlines generated by the
* stroker.
*
* @input:
* stroker ::
...
...
@@ -495,18 +547,18 @@ FT_BEGIN_HEADER
* The number of contours.
*
* @return:
* FreeType error code. 0
means success.
* FreeType error code. 0
~
means success.
*
* @note:
* When an outline, or a sub-path, is
`
closed', the stroker generates
*
two
independent
`
border' outlines, named
`
left' and
`
right'.
* When an outline, or a sub-path, is
'
closed', the stroker generates
two
* independent
'
border' outlines, named
'
left' and
'
right'.
*
* When the outline, or a sub-path, is
`
opened', the stroker merges
*
the `
border' outlines with caps. The
`
left' border receives all
*
points,
while the
`
right' border becomes empty.
* When the outline, or a sub-path, is
'
opened', the stroker merges
the
*
'
border' outlines with caps. The
'
left' border receives all
points,
* while the
'
right' border becomes empty.
*
* Use the function @FT_Stroker_GetCounts instead if you want to
*
retrieve
the counts associated to both borders.
* Use the function @FT_Stroker_GetCounts instead if you want to
retrieve
* the counts associated to both borders.
*/
FT_EXPORT
(
FT_Error
)
FT_Stroker_GetBorderCounts
(
FT_Stroker
stroker
,
...
...
@@ -515,19 +567,17 @@ FT_BEGIN_HEADER
FT_UInt
*
anum_contours
);
/**************************************************************
/**************************************************************
************
*
* @function:
* FT_Stroker_ExportBorder
*
* @description:
* Call this function after @FT_Stroker_GetBorderCounts to
* export the corresponding border to your own @FT_Outline
* structure.
* Call this function after @FT_Stroker_GetBorderCounts to export the
* corresponding border to your own @FT_Outline structure.
*
* Note that this function will append the border points and
* contours to your outline, but will not try to resize its
* arrays.
* Note that this function appends the border points and contours to your
* outline, but does not try to resize its arrays.
*
* @input:
* stroker ::
...
...
@@ -540,19 +590,19 @@ FT_BEGIN_HEADER
* The target outline handle.
*
* @note:
* Always call this function after @FT_Stroker_GetBorderCounts to
*
get
sure that there is enough room in your @FT_Outline object to
*
receive
all new data.
* Always call this function after @FT_Stroker_GetBorderCounts to
get
* sure that there is enough room in your @FT_Outline object to
receive
* all new data.
*
* When an outline, or a sub-path, is
`
closed', the stroker generates
*
two
independent
`
border' outlines, named
`
left' and
`
right'
* When an outline, or a sub-path, is
'
closed', the stroker generates
two
* independent
'
border' outlines, named
'
left' and
'
right'
.
*
* When the outline, or a sub-path, is
`
opened', the stroker merges
*
the `
border' outlines with caps. The
`
left' border receives all
*
points,
while the
`
right' border becomes empty.
* When the outline, or a sub-path, is
'
opened', the stroker merges
the
*
'
border' outlines with caps.
The
'
left' border receives all
points,
* while the
'
right' border becomes empty.
*
* Use the function @FT_Stroker_Export instead if you want to
*
retrieve
all borders at once.
* Use the function @FT_Stroker_Export instead if you want to
retrieve
* all borders at once.
*/
FT_EXPORT
(
void
)
FT_Stroker_ExportBorder
(
FT_Stroker
stroker
,
...
...
@@ -560,16 +610,15 @@ FT_BEGIN_HEADER
FT_Outline
*
outline
);
/**************************************************************
/**************************************************************
************
*
* @function:
* FT_Stroker_GetCounts
*
* @description:
* Call this function once you have finished parsing your paths
* with the stroker. It returns the number of points and
* contours necessary to export all points/borders from the stroked
* outline/path.
* Call this function once you have finished parsing your paths with the
* stroker. It returns the number of points and contours necessary to
* export all points/borders from the stroked outline/path.
*
* @input:
* stroker ::
...
...
@@ -583,7 +632,7 @@ FT_BEGIN_HEADER
* The number of contours.
*
* @return:
* FreeType error code. 0
means success.
* FreeType error code. 0
~
means success.
*/
FT_EXPORT
(
FT_Error
)
FT_Stroker_GetCounts
(
FT_Stroker
stroker
,
...
...
@@ -591,18 +640,17 @@ FT_BEGIN_HEADER
FT_UInt
*
anum_contours
);
/**************************************************************
/**************************************************************
************
*
* @function:
* FT_Stroker_Export
*
* @description:
* Call this function after @FT_Stroker_GetBorderCounts to
*
export the all
borders to your own @FT_Outline structure.
* Call this function after @FT_Stroker_GetBorderCounts to
export all
* borders to your own @FT_Outline structure.
*
* Note that this function will append the border points and
* contours to your outline, but will not try to resize its
* arrays.
* Note that this function appends the border points and contours to your
* outline, but does not try to resize its arrays.
*
* @input:
* stroker ::
...
...
@@ -616,7 +664,7 @@ FT_BEGIN_HEADER
FT_Outline
*
outline
);
/**************************************************************
/**************************************************************
************
*
* @function:
* FT_Stroker_Done
...
...
@@ -626,13 +674,13 @@ FT_BEGIN_HEADER
*
* @input:
* stroker ::
* A stroker handle. Can be NULL.
* A stroker handle. Can be
`
NULL
`
.
*/
FT_EXPORT
(
void
)
FT_Stroker_Done
(
FT_Stroker
stroker
);
/**************************************************************
/**************************************************************
************
*
* @function:
* FT_Glyph_Stroke
...
...
@@ -649,14 +697,18 @@ FT_BEGIN_HEADER
* A stroker handle.
*
* destroy ::
* A Boolean. If 1, the source glyph object is destroyed
* on success.
* A Boolean. If~1, the source glyph object is destroyed on success.
*
* @return:
* FreeType error code. 0
means success.
* FreeType error code. 0
~
means success.
*
* @note:
* The source glyph is untouched in case of error.
*
* Adding stroke may yield a significantly wider and taller glyph
* depending on how large of a radius was used to stroke the glyph. You
* may need to manually adjust horizontal and vertical advance amounts to
* account for this added size.
*/
FT_EXPORT
(
FT_Error
)
FT_Glyph_Stroke
(
FT_Glyph
*
pglyph
,
...
...
@@ -664,14 +716,14 @@ FT_BEGIN_HEADER
FT_Bool
destroy
);
/**************************************************************
/**************************************************************
************
*
* @function:
* FT_Glyph_StrokeBorder
*
* @description:
* Stroke a given outline glyph object with a given stroker, but
*
only
return either its inside or outside border.
* Stroke a given outline glyph object with a given stroker, but
only
* return either its inside or outside border.
*
* @inout:
* pglyph ::
...
...
@@ -682,18 +734,22 @@ FT_BEGIN_HEADER
* A stroker handle.
*
* inside ::
* A Boolean. If
1, return the inside border, otherwise
*
the outside
border.
* A Boolean. If
~
1, return the inside border, otherwise
the outside
* border.
*
* destroy ::
* A Boolean. If 1, the source glyph object is destroyed
* on success.
* A Boolean. If~1, the source glyph object is destroyed on success.
*
* @return:
* FreeType error code. 0
means success.
* FreeType error code. 0
~
means success.
*
* @note:
* The source glyph is untouched in case of error.
*
* Adding stroke may yield a significantly wider and taller glyph
* depending on how large of a radius was used to stroke the glyph. You
* may need to manually adjust horizontal and vertical advance amounts to
* account for this added size.
*/
FT_EXPORT
(
FT_Error
)
FT_Glyph_StrokeBorder
(
FT_Glyph
*
pglyph
,
...
...
@@ -701,11 +757,11 @@ FT_BEGIN_HEADER
FT_Bool
inside
,
FT_Bool
destroy
);
/* */
/* */
FT_END_HEADER
#endif
/*
__
FT
_
STROKE_H_
_
*/
#endif
/* FTSTROKE_H_ */
/* END */
...
...
CMU462/deps/freetype/include/
freetype2/
freetype/ftsynth.h
→
CMU462/deps/freetype/include/freetype/ftsynth.h
100755 → 100644
View file @
57023a55
/***************************************************************************
/
/*
*
/
/*
ftsynth.h
*/
/*
*
/
/*
FreeType synthesizing code for emboldening and slanting
*/
/*
(specification).
*/
/*
*
/
/*
Copyright 2000-20
0
1
, 2003, 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.
*/
/*
*
/
/**************************************************************************
*/
/***************************************************************************
*
*
*
ftsynth.h
*
*
FreeType synthesizing code for emboldening and slanting
*
(specification).
*
*
Copyright
(C)
2000-201
9 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.
*
*/
/*************************************************************************/
...
...
@@ -23,7 +23,7 @@
/*************************************************************************/
/*************************************************************************/
/********* *********/
/********* WARNING, THIS IS ALPHA CODE
,
THIS API
*********/
/********* WARNING, THIS IS ALPHA CODE
!
THIS API *********/
/********* IS DUE TO CHANGE UNTIL STRICTLY NOTIFIED BY THE *********/
/********* FREETYPE DEVELOPMENT TEAM *********/
/********* *********/
...
...
@@ -34,8 +34,15 @@
/*************************************************************************/
#ifndef __FTSYNTH_H__
#define __FTSYNTH_H__
/* Main reason for not lifting the functions in this module to a */
/* 'standard' API is that the used parameters for emboldening and */
/* slanting are not configurable. Consider the functions as a */
/* code resource that should be copied into the application and */
/* adapted to the particular needs. */
#ifndef FTSYNTH_H_
#define FTSYNTH_H_
#include <ft2build.h>
...
...
@@ -50,24 +57,28 @@
FT_BEGIN_HEADER
/* Make sure slot owns slot->bitmap. */
FT_EXPORT
(
FT_Error
)
FT_GlyphSlot_Own_Bitmap
(
FT_GlyphSlot
slot
);
/* Do not use this function directly! Copy the code to */
/* your application and modify it to suit your need. */
/* Embolden a glyph by a 'reasonable' value (which is highly a matter of */
/* taste). This function is actually a convenience function, providing */
/* a wrapper for @FT_Outline_Embolden and @FT_Bitmap_Embolden. */
/* */
/* For emboldened outlines the height, width, and advance metrics are */
/* increased by the strength of the emboldening -- this even affects */
/* mono-width fonts! */
/* */
/* You can also call @FT_Outline_Get_CBox to get precise values. */
FT_EXPORT
(
void
)
FT_GlyphSlot_Embolden
(
FT_GlyphSlot
slot
);
/* Slant an outline glyph to the right by about 12 degrees. */
FT_EXPORT
(
void
)
FT_GlyphSlot_Oblique
(
FT_GlyphSlot
slot
);
/* */
/* */
FT_END_HEADER
#endif
/*
__
FTSYNTH_H_
_
*/
#endif
/* FTSYNTH_H_ */
/* END */
Prev
1
2
3
4
5
6
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment