Commit 57023a55 authored by Adrian Biagioli's avatar Adrian Biagioli
Browse files

Update freetype and drawsvg_ref.dll so on Win64 DrawSVG builds correctly

parent ab7caec5
/*
* This file registers the FreeType modules compiled into the library.
*
* If you use GNU make, this file IS NOT USED! Instead, it is created in
* the objects directory (normally `<topdir>/objs/`) based on information
* from `<topdir>/modules.cfg`.
*
* Please read `docs/INSTALL.ANY` and `docs/CUSTOMIZE` how to compile
* FreeType without GNU make.
*
*/
FT_USE_MODULE( FT_Module_Class, autofit_module_class )
FT_USE_MODULE( FT_Driver_ClassRec, tt_driver_class )
FT_USE_MODULE( FT_Driver_ClassRec, t1_driver_class )
FT_USE_MODULE( FT_Driver_ClassRec, cff_driver_class )
FT_USE_MODULE( FT_Driver_ClassRec, t1cid_driver_class )
FT_USE_MODULE( FT_Driver_ClassRec, pfr_driver_class )
FT_USE_MODULE( FT_Driver_ClassRec, t42_driver_class )
FT_USE_MODULE( FT_Driver_ClassRec, winfnt_driver_class )
FT_USE_MODULE( FT_Driver_ClassRec, pcf_driver_class )
FT_USE_MODULE( FT_Module_Class, psaux_module_class )
FT_USE_MODULE( FT_Module_Class, psnames_module_class )
FT_USE_MODULE( FT_Module_Class, pshinter_module_class )
FT_USE_MODULE( FT_Renderer_Class, ft_raster1_renderer_class )
FT_USE_MODULE( FT_Module_Class, sfnt_module_class )
FT_USE_MODULE( FT_Renderer_Class, ft_smooth_renderer_class )
FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcd_renderer_class )
FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcdv_renderer_class )
FT_USE_MODULE( FT_Driver_ClassRec, bdf_driver_class )
/* EOF */
This diff is collapsed.
/****************************************************************************
*
* ftstdlib.h
*
* ANSI-specific library and header configuration file (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.
*
*/
/**************************************************************************
*
* This file is used to group all `#includes` to the ANSI~C library that
* FreeType normally requires. It also defines macros to rename the
* standard functions within the FreeType source code.
*
* Load a file which defines `FTSTDLIB_H_` before this one to override it.
*
*/
#ifndef FTSTDLIB_H_
#define FTSTDLIB_H_
#include <stddef.h>
#define ft_ptrdiff_t ptrdiff_t
/**************************************************************************
*
* integer limits
*
* `UINT_MAX` and `ULONG_MAX` are used to automatically compute the size of
* `int` and `long` in bytes at compile-time. So far, this works for all
* platforms the library has been tested on.
*
* Note that on the extremely rare platforms that do not provide integer
* types that are _exactly_ 16 and 32~bits wide (e.g., some old Crays where
* `int` is 36~bits), we do not make any guarantee about the correct
* behaviour of FreeType~2 with all fonts.
*
* In these cases, `ftconfig.h` will refuse to compile anyway with a
* message like 'couldn't find 32-bit type' or something similar.
*
*/
#include <limits.h>
#define FT_CHAR_BIT CHAR_BIT
#define FT_USHORT_MAX USHRT_MAX
#define FT_INT_MAX INT_MAX
#define FT_INT_MIN INT_MIN
#define FT_UINT_MAX UINT_MAX
#define FT_LONG_MIN LONG_MIN
#define FT_LONG_MAX LONG_MAX
#define FT_ULONG_MAX ULONG_MAX
/**************************************************************************
*
* character and string processing
*
*/
#include <string.h>
#define ft_memchr memchr
#define ft_memcmp memcmp
#define ft_memcpy memcpy
#define ft_memmove memmove
#define ft_memset memset
#define ft_strcat strcat
#define ft_strcmp strcmp
#define ft_strcpy strcpy
#define ft_strlen strlen
#define ft_strncmp strncmp
#define ft_strncpy strncpy
#define ft_strrchr strrchr
#define ft_strstr strstr
/**************************************************************************
*
* file handling
*
*/
#include <stdio.h>
#define FT_FILE FILE
#define ft_fclose fclose
#define ft_fopen fopen
#define ft_fread fread
#define ft_fseek fseek
#define ft_ftell ftell
#define ft_sprintf sprintf
/**************************************************************************
*
* sorting
*
*/
#include <stdlib.h>
#define ft_qsort qsort
/**************************************************************************
*
* memory allocation
*
*/
#define ft_scalloc calloc
#define ft_sfree free
#define ft_smalloc malloc
#define ft_srealloc realloc
/**************************************************************************
*
* miscellaneous
*
*/
#define ft_strtol strtol
#define ft_getenv getenv
/**************************************************************************
*
* execution control
*
*/
#include <setjmp.h>
#define ft_jmp_buf jmp_buf /* note: this cannot be a typedef since */
/* `jmp_buf` is defined as a macro */
/* on certain platforms */
#define ft_longjmp longjmp
#define ft_setjmp( b ) setjmp( *(ft_jmp_buf*) &(b) ) /* same thing here */
/* The following is only used for debugging purposes, i.e., if */
/* `FT_DEBUG_LEVEL_ERROR` or `FT_DEBUG_LEVEL_TRACE` are defined. */
#include <stdarg.h>
#endif /* FTSTDLIB_H_ */
/* END */
This diff is collapsed.
/****************************************************************************
*
* ftadvanc.h
*
* Quick computation of advance widths (specification only).
*
* Copyright (C) 2008-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 FTADVANC_H_
#define FTADVANC_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:
* quick_advance
*
* @title:
* Quick retrieval of advance values
*
* @abstract:
* Retrieve horizontal and vertical advance values without processing
* glyph outlines, if possible.
*
* @description:
* This section contains functions to quickly extract advance values
* without handling glyph outlines, if possible.
*
* @order:
* FT_Get_Advance
* FT_Get_Advances
*
*/
/**************************************************************************
*
* @enum:
* FT_ADVANCE_FLAG_FAST_ONLY
*
* @description:
* A bit-flag to be OR-ed with the `flags` parameter of the
* @FT_Get_Advance and @FT_Get_Advances functions.
*
* If set, it indicates that you want these functions to fail if the
* corresponding hinting mode or font driver doesn't allow for very quick
* advance computation.
*
* Typically, glyphs that are either unscaled, unhinted, bitmapped, or
* light-hinted can have their advance width computed very quickly.
*
* Normal and bytecode hinted modes that require loading, scaling, and
* hinting of the glyph outline, are extremely slow by comparison.
*/
#define FT_ADVANCE_FLAG_FAST_ONLY 0x20000000L
/**************************************************************************
*
* @function:
* FT_Get_Advance
*
* @description:
* Retrieve the advance value of a given glyph outline in an @FT_Face.
*
* @input:
* face ::
* The source @FT_Face handle.
*
* gindex ::
* The glyph index.
*
* load_flags ::
* A set of bit flags similar to those used when calling
* @FT_Load_Glyph, used to determine what kind of advances you need.
* @output:
* padvance ::
* The advance value. If scaling is performed (based on the value of
* `load_flags`), the advance value is in 16.16 format. Otherwise, it
* is in font units.
*
* If @FT_LOAD_VERTICAL_LAYOUT is set, this is the vertical advance
* corresponding to a vertical layout. Otherwise, it is the horizontal
* advance in a horizontal layout.
*
* @return:
* FreeType error code. 0 means success.
*
* @note:
* This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and if
* the corresponding font backend doesn't have a quick way to retrieve
* the advances.
*
* A scaled advance is returned in 16.16 format but isn't transformed by
* the affine transformation specified by @FT_Set_Transform.
*/
FT_EXPORT( FT_Error )
FT_Get_Advance( FT_Face face,
FT_UInt gindex,
FT_Int32 load_flags,
FT_Fixed *padvance );
/**************************************************************************
*
* @function:
* FT_Get_Advances
*
* @description:
* Retrieve the advance values of several glyph outlines in an @FT_Face.
*
* @input:
* face ::
* The source @FT_Face handle.
*
* start ::
* The first glyph index.
*
* count ::
* The number of advance values you want to retrieve.
*
* load_flags ::
* A set of bit flags similar to those used when calling
* @FT_Load_Glyph.
*
* @output:
* padvance ::
* The advance values. This array, to be provided by the caller, must
* contain at least `count` elements.
*
* If scaling is performed (based on the value of `load_flags`), the
* advance values are in 16.16 format. Otherwise, they are in font
* units.
*
* If @FT_LOAD_VERTICAL_LAYOUT is set, these are the vertical advances
* corresponding to a vertical layout. Otherwise, they are the
* horizontal advances in a horizontal layout.
*
* @return:
* FreeType error code. 0 means success.
*
* @note:
* This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and if
* the corresponding font backend doesn't have a quick way to retrieve
* the advances.
*
* Scaled advances are returned in 16.16 format but aren't transformed by
* the affine transformation specified by @FT_Set_Transform.
*/
FT_EXPORT( FT_Error )
FT_Get_Advances( FT_Face face,
FT_UInt start,
FT_UInt count,
FT_Int32 load_flags,
FT_Fixed *padvances );
/* */
FT_END_HEADER
#endif /* FTADVANC_H_ */
/* END */
/****************************************************************************
*
* ftbbox.h
*
* FreeType exact bbox computation (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 component has a _single_ role: to compute exact outline bounding
* boxes.
*
* It is separated from the rest of the engine for various technical
* reasons. It may well be integrated in 'ftoutln' later.
*
*/
#ifndef FTBBOX_H_
#define FTBBOX_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
*
*/
/**************************************************************************
*
* @function:
* FT_Outline_Get_BBox
*
* @description:
* Compute the exact bounding box of an outline. This is slower than
* computing the control box. However, it uses an advanced algorithm
* that returns _very_ quickly when the two boxes coincide. Otherwise,
* the outline Bezier arcs are traversed to extract their extrema.
*
* @input:
* outline ::
* A pointer to the source outline.
*
* @output:
* abbox ::
* The outline's exact bounding box.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* If the font is tricky and the glyph has been loaded with
* @FT_LOAD_NO_SCALE, the resulting BBox is meaningless. To get
* reasonable values for the BBox it is necessary to load the glyph at a
* large ppem value (so that the hinting instructions can properly shift
* and scale the subglyphs), then extracting the BBox, which can be
* eventually converted back to font units.
*/
FT_EXPORT( FT_Error )
FT_Outline_Get_BBox( FT_Outline* outline,
FT_BBox *abbox );
/* */
FT_END_HEADER
#endif /* FTBBOX_H_ */
/* END */
/* Local Variables: */
/* coding: utf-8 */
/* End: */
/****************************************************************************
*
* ftbdf.h
*
* FreeType API for accessing BDF-specific strings (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 FTBDF_H_
#define FTBDF_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:
* bdf_fonts
*
* @title:
* BDF and PCF Files
*
* @abstract:
* BDF and PCF specific API.
*
* @description:
* This section contains the declaration of functions specific to BDF and
* PCF fonts.
*
*/
/**************************************************************************
*
* @enum:
* BDF_PropertyType
*
* @description:
* A list of BDF property types.
*
* @values:
* BDF_PROPERTY_TYPE_NONE ::
* Value~0 is used to indicate a missing property.
*
* BDF_PROPERTY_TYPE_ATOM ::
* Property is a string atom.
*
* BDF_PROPERTY_TYPE_INTEGER ::
* Property is a 32-bit signed integer.
*
* BDF_PROPERTY_TYPE_CARDINAL ::
* Property is a 32-bit unsigned integer.
*/
typedef enum BDF_PropertyType_
{
BDF_PROPERTY_TYPE_NONE = 0,
BDF_PROPERTY_TYPE_ATOM = 1,
BDF_PROPERTY_TYPE_INTEGER = 2,
BDF_PROPERTY_TYPE_CARDINAL = 3
} BDF_PropertyType;
/**************************************************************************
*
* @type:
* BDF_Property
*
* @description:
* A handle to a @BDF_PropertyRec structure to model a given BDF/PCF
* property.
*/
typedef struct BDF_PropertyRec_* BDF_Property;
/**************************************************************************
*
* @struct:
* BDF_PropertyRec
*
* @description:
* This structure models a given BDF/PCF property.
*
* @fields:
* type ::
* The property type.
*
* u.atom ::
* The atom string, if type is @BDF_PROPERTY_TYPE_ATOM. May be
* `NULL`, indicating an empty string.
*
* u.integer ::
* A signed integer, if type is @BDF_PROPERTY_TYPE_INTEGER.
*
* u.cardinal ::
* An unsigned integer, if type is @BDF_PROPERTY_TYPE_CARDINAL.
*/
typedef struct BDF_PropertyRec_
{
BDF_PropertyType type;
union {
const char* atom;
FT_Int32 integer;
FT_UInt32 cardinal;
} u;
} BDF_PropertyRec;
/**************************************************************************
*
* @function:
* FT_Get_BDF_Charset_ID
*
* @description:
* Retrieve a BDF font character set identity, according to the BDF
* specification.
*
* @input:
* face ::
* A handle to the input face.
*
* @output:
* acharset_encoding ::
* Charset encoding, as a C~string, owned by the face.
*
* acharset_registry ::
* Charset registry, as a C~string, owned by the face.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* This function only works with BDF faces, returning an error otherwise.
*/
FT_EXPORT( FT_Error )
FT_Get_BDF_Charset_ID( FT_Face face,
const char* *acharset_encoding,
const char* *acharset_registry );
/**************************************************************************
*
* @function:
* FT_Get_BDF_Property
*
* @description:
* Retrieve a BDF property from a BDF or PCF font file.
*
* @input:
* face ::
* A handle to the input face.
*
* name ::
* The property name.
*
* @output:
* aproperty ::
* The property.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* This function works with BDF _and_ PCF fonts. It returns an error
* otherwise. It also returns an error if the property is not in the
* font.
*
* A 'property' is a either key-value pair within the STARTPROPERTIES
* ... ENDPROPERTIES block of a BDF font or a key-value pair from the
* `info->props` array within a `FontRec` structure of a PCF font.
*
* Integer properties are always stored as 'signed' within PCF fonts;
* consequently, @BDF_PROPERTY_TYPE_CARDINAL is a possible return value
* for BDF fonts only.
*
* In case of error, `aproperty->type` is always set to
* @BDF_PROPERTY_TYPE_NONE.
*/
FT_EXPORT( FT_Error )
FT_Get_BDF_Property( FT_Face face,
const char* prop_name,
BDF_PropertyRec *aproperty );
/* */
FT_END_HEADER
#endif /* FTBDF_H_ */
/* END */
/****************************************************************************
*
* ftbitmap.h
*
* FreeType utility functions for bitmaps (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.
*
*/
#ifndef FTBITMAP_H_
#define FTBITMAP_H_
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_COLOR_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:
* bitmap_handling
*
* @title:
* Bitmap Handling
*
* @abstract:
* Handling FT_Bitmap objects.
*
* @description:
* This section contains functions for handling @FT_Bitmap objects,
* automatically adjusting the target's bitmap buffer size as needed.
*
* Note that none of the functions changes the bitmap's 'flow' (as
* indicated by the sign of the `pitch` field in @FT_Bitmap).
*
* To set the flow, assign an appropriate positive or negative value to
* the `pitch` field of the target @FT_Bitmap object after calling
* @FT_Bitmap_Init but before calling any of the other functions
* described here.
*/
/**************************************************************************
*
* @function:
* FT_Bitmap_Init
*
* @description:
* Initialize a pointer to an @FT_Bitmap structure.
*
* @inout:
* abitmap ::
* A pointer to the bitmap structure.
*
* @note:
* A deprecated name for the same function is `FT_Bitmap_New`.
*/
FT_EXPORT( void )
FT_Bitmap_Init( FT_Bitmap *abitmap );
/* deprecated */
FT_EXPORT( void )
FT_Bitmap_New( FT_Bitmap *abitmap );
/**************************************************************************
*
* @function:
* FT_Bitmap_Copy
*
* @description:
* Copy a bitmap into another one.
*
* @input:
* library ::
* A handle to a library object.
*
* source ::
* A handle to the source bitmap.
*
* @output:
* target ::
* A handle to the target bitmap.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* `source->buffer` and `target->buffer` must neither be equal nor
* overlap.
*/
FT_EXPORT( FT_Error )
FT_Bitmap_Copy( FT_Library library,
const FT_Bitmap *source,
FT_Bitmap *target );
/**************************************************************************
*
* @function:
* FT_Bitmap_Embolden
*
* @description:
* Embolden a bitmap. The new bitmap will be about `xStrength` pixels
* wider and `yStrength` pixels higher. The left and bottom borders are
* kept unchanged.
*
* @input:
* library ::
* A handle to a library object.
*
* xStrength ::
* How strong the glyph is emboldened horizontally. Expressed in 26.6
* pixel format.
*
* yStrength ::
* How strong the glyph is emboldened vertically. Expressed in 26.6
* pixel format.
*
* @inout:
* bitmap ::
* A handle to the target bitmap.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* The current implementation restricts `xStrength` to be less than or
* equal to~8 if bitmap is of pixel_mode @FT_PIXEL_MODE_MONO.
*
* If you want to embolden the bitmap owned by a @FT_GlyphSlotRec, you
* should call @FT_GlyphSlot_Own_Bitmap on the slot first.
*
* Bitmaps in @FT_PIXEL_MODE_GRAY2 and @FT_PIXEL_MODE_GRAY@ format are
* converted to @FT_PIXEL_MODE_GRAY format (i.e., 8bpp).
*/
FT_EXPORT( FT_Error )
FT_Bitmap_Embolden( FT_Library library,
FT_Bitmap* bitmap,
FT_Pos xStrength,
FT_Pos yStrength );
/**************************************************************************
*
* @function:
* FT_Bitmap_Convert
*
* @description:
* Convert a bitmap object with depth 1bpp, 2bpp, 4bpp, 8bpp or 32bpp to
* a bitmap object with depth 8bpp, making the number of used bytes per
* line (a.k.a. the 'pitch') a multiple of `alignment`.
*
* @input:
* library ::
* A handle to a library object.
*
* source ::
* The source bitmap.
*
* alignment ::
* The pitch of the bitmap is a multiple of this argument. Common
* values are 1, 2, or 4.
*
* @output:
* target ::
* The target bitmap.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* It is possible to call @FT_Bitmap_Convert multiple times without
* calling @FT_Bitmap_Done (the memory is simply reallocated).
*
* Use @FT_Bitmap_Done to finally remove the bitmap object.
*
* The `library` argument is taken to have access to FreeType's memory
* handling functions.
*
* `source->buffer` and `target->buffer` must neither be equal nor
* overlap.
*/
FT_EXPORT( FT_Error )
FT_Bitmap_Convert( FT_Library library,
const FT_Bitmap *source,
FT_Bitmap *target,
FT_Int alignment );
/**************************************************************************
*
* @function:
* FT_Bitmap_Blend
*
* @description:
* Blend a bitmap onto another bitmap, using a given color.
*
* @input:
* library ::
* A handle to a library object.
*
* source ::
* The source bitmap, which can have any @FT_Pixel_Mode format.
*
* source_offset ::
* The offset vector to the upper left corner of the source bitmap in
* 26.6 pixel format. It should represent an integer offset; the
* function will set the lowest six bits to zero to enforce that.
*
* color ::
* The color used to draw `source` onto `target`.
*
* @inout:
* target ::
* A handle to an `FT_Bitmap` object. It should be either initialized
* as empty with a call to @FT_Bitmap_Init, or it should be of type
* @FT_PIXEL_MODE_BGRA.
*
* atarget_offset ::
* The offset vector to the upper left corner of the target bitmap in
* 26.6 pixel format. It should represent an integer offset; the
* function will set the lowest six bits to zero to enforce that.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* This function doesn't perform clipping.
*
* The bitmap in `target` gets allocated or reallocated as needed; the
* vector `atarget_offset` is updated accordingly.
*
* In case of allocation or reallocation, the bitmap's pitch is set to
* `4 * width`. Both `source` and `target` must have the same bitmap
* flow (as indicated by the sign of the `pitch` field).
*
* `source->buffer` and `target->buffer` must neither be equal nor
* overlap.
*
* @since:
* 2.10
*/
FT_EXPORT( FT_Error )
FT_Bitmap_Blend( FT_Library library,
const FT_Bitmap* source,
const FT_Vector source_offset,
FT_Bitmap* target,
FT_Vector *atarget_offset,
FT_Color color );
/**************************************************************************
*
* @function:
* FT_GlyphSlot_Own_Bitmap
*
* @description:
* Make sure that a glyph slot owns `slot->bitmap`.
*
* @input:
* slot ::
* The glyph slot.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* This function is to be used in combination with @FT_Bitmap_Embolden.
*/
FT_EXPORT( FT_Error )
FT_GlyphSlot_Own_Bitmap( FT_GlyphSlot slot );
/**************************************************************************
*
* @function:
* FT_Bitmap_Done
*
* @description:
* Destroy a bitmap object initialized with @FT_Bitmap_Init.
*
* @input:
* library ::
* A handle to a library object.
*
* bitmap ::
* The bitmap object to be freed.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* The `library` argument is taken to have access to FreeType's memory
* handling functions.
*/
FT_EXPORT( FT_Error )
FT_Bitmap_Done( FT_Library library,
FT_Bitmap *bitmap );
/* */
FT_END_HEADER
#endif /* FTBITMAP_H_ */
/* END */
/****************************************************************************
*
* ftbzip2.h
*
* Bzip2-compressed stream support.
*
* Copyright (C) 2010-2019 by
* Joel Klinghed.
*
* 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 FTBZIP2_H_
#define FTBZIP2_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:
* bzip2
*
* @title:
* BZIP2 Streams
*
* @abstract:
* Using bzip2-compressed font files.
*
* @description:
* This section contains the declaration of Bzip2-specific functions.
*
*/
/**************************************************************************
*
* @function:
* FT_Stream_OpenBzip2
*
* @description:
* Open a new stream to parse bzip2-compressed font files. This is
* mainly used to support the compressed `*.pcf.bz2` 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, bzip2 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 bzip2 compressed
* 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 bzip2 support.
*/
FT_EXPORT( FT_Error )
FT_Stream_OpenBzip2( FT_Stream stream,
FT_Stream source );
/* */
FT_END_HEADER
#endif /* FTBZIP2_H_ */
/* END */
This diff is collapsed.
/****************************************************************************
*
* This file defines the structure of the FreeType reference.
* It is used by the python script that generates the HTML files.
*
*/
/**************************************************************************
*
* @chapter:
* general_remarks
*
* @title:
* General Remarks
*
* @sections:
* header_inclusion
* user_allocation
*
*/
/**************************************************************************
*
* @chapter:
* core_api
*
* @title:
* Core API
*
* @sections:
* version
* basic_types
* base_interface
* glyph_variants
* color_management
* layer_management
* glyph_management
* mac_specific
* sizes_management
* header_file_macros
*
*/
/**************************************************************************
*
* @chapter:
* format_specific
*
* @title:
* Format-Specific API
*
* @sections:
* multiple_masters
* truetype_tables
* type1_tables
* sfnt_names
* bdf_fonts
* cid_fonts
* pfr_fonts
* winfnt_fonts
* font_formats
* gasp_table
*
*/
/**************************************************************************
*
* @chapter:
* module_specific
*
* @title:
* Controlling FreeType Modules
*
* @sections:
* auto_hinter
* cff_driver
* t1_cid_driver
* tt_driver
* pcf_driver
* properties
* parameter_tags
* lcd_rendering
*
*/
/**************************************************************************
*
* @chapter:
* cache_subsystem
*
* @title:
* Cache Sub-System
*
* @sections:
* cache_subsystem
*
*/
/**************************************************************************
*
* @chapter:
* support_api
*
* @title:
* Support API
*
* @sections:
* computations
* list_processing
* outline_processing
* quick_advance
* bitmap_handling
* raster
* glyph_stroker
* system_interface
* module_management
* gzip
* lzw
* bzip2
*
*/
/**************************************************************************
*
* @chapter:
* error_codes
*
* @title:
* Error Codes
*
* @sections:
* error_enumerations
* error_code_values
*
*/
/* END */
/****************************************************************************
*
* ftcid.h
*
* FreeType API for accessing CID font information (specification).
*
* Copyright (C) 2007-2019 by
* Dereg Clegg and Michael Toftdal.
*
* 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 FTCID_H_
#define FTCID_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:
* cid_fonts
*
* @title:
* CID Fonts
*
* @abstract:
* CID-keyed font-specific API.
*
* @description:
* This section contains the declaration of CID-keyed font-specific
* functions.
*
*/
/**************************************************************************
*
* @function:
* FT_Get_CID_Registry_Ordering_Supplement
*
* @description:
* Retrieve the Registry/Ordering/Supplement triple (also known as the
* "R/O/S") from a CID-keyed font.
*
* @input:
* face ::
* A handle to the input face.
*
* @output:
* registry ::
* The registry, as a C~string, owned by the face.
*
* ordering ::
* The ordering, as a C~string, owned by the face.
*
* supplement ::
* The supplement.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* This function only works with CID faces, returning an error
* otherwise.
*
* @since:
* 2.3.6
*/
FT_EXPORT( FT_Error )
FT_Get_CID_Registry_Ordering_Supplement( FT_Face face,
const char* *registry,
const char* *ordering,
FT_Int *supplement );
/**************************************************************************
*
* @function:
* FT_Get_CID_Is_Internally_CID_Keyed
*
* @description:
* Retrieve the type of the input face, CID keyed or not. In contrast
* to the @FT_IS_CID_KEYED macro this function returns successfully also
* for CID-keyed fonts in an SFNT wrapper.
*
* @input:
* face ::
* A handle to the input face.
*
* @output:
* is_cid ::
* The type of the face as an @FT_Bool.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* This function only works with CID faces and OpenType fonts, returning
* an error otherwise.
*
* @since:
* 2.3.9
*/
FT_EXPORT( FT_Error )
FT_Get_CID_Is_Internally_CID_Keyed( FT_Face face,
FT_Bool *is_cid );
/**************************************************************************
*
* @function:
* FT_Get_CID_From_Glyph_Index
*
* @description:
* Retrieve the CID of the input glyph index.
*
* @input:
* face ::
* A handle to the input face.
*
* glyph_index ::
* The input glyph index.
*
* @output:
* cid ::
* The CID as an @FT_UInt.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* This function only works with CID faces and OpenType fonts, returning
* an error otherwise.
*
* @since:
* 2.3.9
*/
FT_EXPORT( FT_Error )
FT_Get_CID_From_Glyph_Index( FT_Face face,
FT_UInt glyph_index,
FT_UInt *cid );
/* */
FT_END_HEADER
#endif /* FTCID_H_ */
/* END */
/****************************************************************************
*
* ftcolor.h
*
* FreeType's glyph color management (specification).
*
* Copyright (C) 2018-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 FTCOLOR_H_
#define FTCOLOR_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:
* color_management
*
* @title:
* Glyph Color Management
*
* @abstract:
* Retrieving and manipulating OpenType's 'CPAL' table data.
*
* @description:
* The functions described here allow access and manipulation of color
* palette entries in OpenType's 'CPAL' tables.
*/
/**************************************************************************
*
* @struct:
* FT_Color
*
* @description:
* This structure models a BGRA color value of a 'CPAL' palette entry.
*
* The used color space is sRGB; the colors are not pre-multiplied, and
* alpha values must be explicitly set.
*
* @fields:
* blue ::
* Blue value.
*
* green ::
* Green value.
*
* red ::
* Red value.
*
* alpha ::
* Alpha value, giving the red, green, and blue color's opacity.
*
* @since:
* 2.10
*/
typedef struct FT_Color_
{
FT_Byte blue;
FT_Byte green;
FT_Byte red;
FT_Byte alpha;
} FT_Color;
/**************************************************************************
*
* @enum:
* FT_PALETTE_XXX
*
* @description:
* A list of bit field constants used in the `palette_flags` array of the
* @FT_Palette_Data structure to indicate for which background a palette
* with a given index is usable.
*
* @values:
* FT_PALETTE_FOR_LIGHT_BACKGROUND ::
* The palette is appropriate to use when displaying the font on a
* light background such as white.
*
* FT_PALETTE_FOR_DARK_BACKGROUND ::
* The palette is appropriate to use when displaying the font on a dark
* background such as black.
*
* @since:
* 2.10
*/
#define FT_PALETTE_FOR_LIGHT_BACKGROUND 0x01
#define FT_PALETTE_FOR_DARK_BACKGROUND 0x02
/**************************************************************************
*
* @struct:
* FT_Palette_Data
*
* @description:
* This structure holds the data of the 'CPAL' table.
*
* @fields:
* num_palettes ::
* The number of palettes.
*
* palette_name_ids ::
* A read-only array of palette name IDs with `num_palettes` elements,
* corresponding to entries like 'dark' or 'light' in the font's 'name'
* table.
*
* An empty name ID in the 'CPAL' table gets represented as value
* 0xFFFF.
*
* `NULL` if the font's 'CPAL' table doesn't contain appropriate data.
*
* palette_flags ::
* A read-only array of palette flags with `num_palettes` elements.
* Possible values are an ORed combination of
* @FT_PALETTE_FOR_LIGHT_BACKGROUND and
* @FT_PALETTE_FOR_DARK_BACKGROUND.
*
* `NULL` if the font's 'CPAL' table doesn't contain appropriate data.
*
* num_palette_entries ::
* The number of entries in a single palette. All palettes have the
* same size.
*
* palette_entry_name_ids ::
* A read-only array of palette entry name IDs with
* `num_palette_entries`. In each palette, entries with the same index
* have the same function. For example, index~0 might correspond to
* string 'outline' in the font's 'name' table to indicate that this
* palette entry is used for outlines, index~1 might correspond to
* 'fill' to indicate the filling color palette entry, etc.
*
* An empty entry name ID in the 'CPAL' table gets represented as value
* 0xFFFF.
*
* `NULL` if the font's 'CPAL' table doesn't contain appropriate data.
*
* @note:
* Use function @FT_Get_Sfnt_Name to map name IDs and entry name IDs to
* name strings.
*
* @since:
* 2.10
*/
typedef struct FT_Palette_Data_ {
FT_UShort num_palettes;
const FT_UShort* palette_name_ids;
const FT_UShort* palette_flags;
FT_UShort num_palette_entries;
const FT_UShort* palette_entry_name_ids;
} FT_Palette_Data;
/**************************************************************************
*
* @function:
* FT_Palette_Data_Get
*
* @description:
* Retrieve the face's color palette data.
*
* @input:
* face ::
* The source face handle.
*
* @output:
* apalette ::
* A pointer to an @FT_Palette_Data structure.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* All arrays in the returned @FT_Palette_Data structure are read-only.
*
* This function always returns an error if the config macro
* `TT_CONFIG_OPTION_COLOR_LAYERS` is not defined in `ftoption.h`.
*
* @since:
* 2.10
*/
FT_EXPORT( FT_Error )
FT_Palette_Data_Get( FT_Face face,
FT_Palette_Data *apalette );
/**************************************************************************
*
* @function:
* FT_Palette_Select
*
* @description:
* This function has two purposes.
*
* (1) It activates a palette for rendering color glyphs, and
*
* (2) it retrieves all (unmodified) color entries of this palette. This
* function returns a read-write array, which means that a calling
* application can modify the palette entries on demand.
*
* A corollary of (2) is that calling the function, then modifying some
* values, then calling the function again with the same arguments resets
* all color entries to the original 'CPAL' values; all user modifications
* are lost.
*
* @input:
* face ::
* The source face handle.
*
* palette_index ::
* The palette index.
*
* @output:
* apalette ::
* An array of color entries for a palette with index `palette_index`,
* having `num_palette_entries` elements (as found in the
* `FT_Palette_Data` structure). If `apalette` is set to `NULL`, no
* array gets returned (and no color entries can be modified).
*
* In case the font doesn't support color palettes, `NULL` is returned.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* The array pointed to by `apalette_entries` is owned and managed by
* FreeType.
*
* This function always returns an error if the config macro
* `TT_CONFIG_OPTION_COLOR_LAYERS` is not defined in `ftoption.h`.
*
* @since:
* 2.10
*/
FT_EXPORT( FT_Error )
FT_Palette_Select( FT_Face face,
FT_UShort palette_index,
FT_Color* *apalette );
/**************************************************************************
*
* @function:
* FT_Palette_Set_Foreground_Color
*
* @description:
* 'COLR' uses palette index 0xFFFF to indicate a 'text foreground
* color'. This function sets this value.
*
* @input:
* face ::
* The source face handle.
*
* foreground_color ::
* An `FT_Color` structure to define the text foreground color.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* If this function isn't called, the text foreground color is set to
* white opaque (BGRA value 0xFFFFFFFF) if
* @FT_PALETTE_FOR_DARK_BACKGROUND is present for the current palette,
* and black opaque (BGRA value 0x000000FF) otherwise, including the case
* that no palette types are available in the 'CPAL' table.
*
* This function always returns an error if the config macro
* `TT_CONFIG_OPTION_COLOR_LAYERS` is not defined in `ftoption.h`.
*
* @since:
* 2.10
*/
FT_EXPORT( FT_Error )
FT_Palette_Set_Foreground_Color( FT_Face face,
FT_Color foreground_color );
/* */
FT_END_HEADER
#endif /* FTCOLOR_H_ */
/* END */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment