1999-12-17 00:11:37 +01:00
|
|
|
/***************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* ttobjs.h */
|
|
|
|
/* */
|
|
|
|
/* Objects manager (specification). */
|
|
|
|
/* */
|
2017-01-04 20:16:34 +01:00
|
|
|
/* Copyright 1996-2017 by */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
|
|
|
/* */
|
2000-06-12 21:36:41 +02:00
|
|
|
/* This file is part of the FreeType project, and may only be used, */
|
|
|
|
/* modified, and distributed under the terms of the FreeType project */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* 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. */
|
|
|
|
/* */
|
|
|
|
/***************************************************************************/
|
|
|
|
|
|
|
|
|
2016-01-12 21:37:13 +01:00
|
|
|
#ifndef TTOBJS_H_
|
|
|
|
#define TTOBJS_H_
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2000-12-08 17:17:16 +01:00
|
|
|
|
2000-12-08 03:42:29 +01:00
|
|
|
#include <ft2build.h>
|
|
|
|
#include FT_INTERNAL_OBJECTS_H
|
|
|
|
#include FT_INTERNAL_TRUETYPE_TYPES_H
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2000-12-08 17:17:16 +01:00
|
|
|
|
2000-12-08 03:42:29 +01:00
|
|
|
FT_BEGIN_HEADER
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Type> */
|
|
|
|
/* TT_Driver */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A handle to a TrueType driver object. */
|
|
|
|
/* */
|
|
|
|
typedef struct TT_DriverRec_* TT_Driver;
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Type> */
|
|
|
|
/* TT_GlyphSlot */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A handle to a TrueType glyph slot object. */
|
|
|
|
/* */
|
|
|
|
/* <Note> */
|
|
|
|
/* This is a direct typedef of FT_GlyphSlot, as there is nothing */
|
|
|
|
/* specific about the TrueType glyph slot. */
|
|
|
|
/* */
|
|
|
|
typedef FT_GlyphSlot TT_GlyphSlot;
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Struct> */
|
|
|
|
/* TT_GraphicsState */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* The TrueType graphics state used during bytecode interpretation. */
|
|
|
|
/* */
|
|
|
|
typedef struct TT_GraphicsState_
|
|
|
|
{
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_UShort rp0;
|
|
|
|
FT_UShort rp1;
|
|
|
|
FT_UShort rp2;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_UnitVector dualVector;
|
|
|
|
FT_UnitVector projVector;
|
|
|
|
FT_UnitVector freeVector;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_Long loop;
|
|
|
|
FT_F26Dot6 minimum_distance;
|
|
|
|
FT_Int round_state;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_Bool auto_flip;
|
|
|
|
FT_F26Dot6 control_value_cutin;
|
|
|
|
FT_F26Dot6 single_width_cutin;
|
|
|
|
FT_F26Dot6 single_width_value;
|
2014-10-15 05:03:56 +02:00
|
|
|
FT_UShort delta_base;
|
|
|
|
FT_UShort delta_shift;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_Byte instruct_control;
|
2008-11-15 11:35:51 +01:00
|
|
|
/* According to Greg Hitchcock from Microsoft, the `scan_control' */
|
|
|
|
/* variable as documented in the TrueType specification is a 32-bit */
|
|
|
|
/* integer; the high-word part holds the SCANTYPE value, the low-word */
|
|
|
|
/* part the SCANCTRL value. We separate it into two fields. */
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_Bool scan_control;
|
|
|
|
FT_Int scan_type;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_UShort gep0;
|
|
|
|
FT_UShort gep1;
|
|
|
|
FT_UShort gep2;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
} TT_GraphicsState;
|
|
|
|
|
2000-07-02 15:53:16 +02:00
|
|
|
|
2006-08-26 00:45:13 +02:00
|
|
|
#ifdef TT_USE_BYTECODE_INTERPRETER
|
2000-07-27 13:20:20 +02:00
|
|
|
|
2002-03-01 03:26:22 +01:00
|
|
|
FT_LOCAL( void )
|
* massive re-formatting changes to many, many source files. I don't
want to list them all here. The operations performed were all logical
transformations of the sources:
- trying to convert all enums and constants to CAPITALIZED_STYLE, with
#define definitions like
#define my_old_constants MY_NEW_CONSTANT
- big, big update of the documentation comments
* include/freetype/freetype.h, src/base/ftobjs.c, src/smooth/ftsmooth.c,
include/freetype/ftimage.h: adding support for LCD-optimized rendering
though the new constants/enums:
FT_RENDER_MODE_LCD, FT_RENDER_MODE_LCD_V
FT_PIXEL_MODE_LCD, FT_PIXEL_MODE_LCD_V
this is still work in progress, don't expect everything to work correctly
though most of the features have been implemented.
* adding new FT_LOAD_XXX flags, used to specify both hinting and rendering
targets:
FT_LOAD_TARGET_NORMAL :: anti-aliased hinting & rendering
FT_LOAD_TARGET_MONO :: monochrome bitmaps
FT_LOAD_TARGET_LCD :: horizontal RGB/BGR decimated hinting & rendering
FT_LOAD_TARGET_LCD_V :: vertical RGB/BGR decimated hinting & rendering
note that FT_LOAD_TARGET_NORMAL is 0, which means that the default
behaviour of the font engine is _unchanged_.
2002-08-27 22:20:29 +02:00
|
|
|
tt_glyphzone_done( TT_GlyphZone zone );
|
2000-11-04 09:33:38 +01:00
|
|
|
|
2002-03-01 03:26:22 +01:00
|
|
|
FT_LOCAL( FT_Error )
|
* massive re-formatting changes to many, many source files. I don't
want to list them all here. The operations performed were all logical
transformations of the sources:
- trying to convert all enums and constants to CAPITALIZED_STYLE, with
#define definitions like
#define my_old_constants MY_NEW_CONSTANT
- big, big update of the documentation comments
* include/freetype/freetype.h, src/base/ftobjs.c, src/smooth/ftsmooth.c,
include/freetype/ftimage.h: adding support for LCD-optimized rendering
though the new constants/enums:
FT_RENDER_MODE_LCD, FT_RENDER_MODE_LCD_V
FT_PIXEL_MODE_LCD, FT_PIXEL_MODE_LCD_V
this is still work in progress, don't expect everything to work correctly
though most of the features have been implemented.
* adding new FT_LOAD_XXX flags, used to specify both hinting and rendering
targets:
FT_LOAD_TARGET_NORMAL :: anti-aliased hinting & rendering
FT_LOAD_TARGET_MONO :: monochrome bitmaps
FT_LOAD_TARGET_LCD :: horizontal RGB/BGR decimated hinting & rendering
FT_LOAD_TARGET_LCD_V :: vertical RGB/BGR decimated hinting & rendering
note that FT_LOAD_TARGET_NORMAL is 0, which means that the default
behaviour of the font engine is _unchanged_.
2002-08-27 22:20:29 +02:00
|
|
|
tt_glyphzone_new( FT_Memory memory,
|
2002-04-01 16:25:28 +02:00
|
|
|
FT_UShort maxPoints,
|
|
|
|
FT_Short maxContours,
|
|
|
|
TT_GlyphZone zone );
|
2000-06-16 21:34:52 +02:00
|
|
|
|
2006-08-26 00:45:13 +02:00
|
|
|
#endif /* TT_USE_BYTECODE_INTERPRETER */
|
2000-07-27 13:20:20 +02:00
|
|
|
|
2000-07-02 15:53:16 +02:00
|
|
|
|
2000-07-27 23:40:22 +02:00
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* EXECUTION SUBTABLES */
|
|
|
|
/* */
|
|
|
|
/* These sub-tables relate to instruction execution. */
|
|
|
|
/* */
|
|
|
|
/*************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
#define TT_MAX_CODE_RANGES 3
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* There can only be 3 active code ranges at once: */
|
|
|
|
/* - the Font Program */
|
|
|
|
/* - the CVT Program */
|
|
|
|
/* - a glyph's instructions set */
|
|
|
|
/* */
|
|
|
|
typedef enum TT_CodeRange_Tag_
|
|
|
|
{
|
|
|
|
tt_coderange_none = 0,
|
|
|
|
tt_coderange_font,
|
|
|
|
tt_coderange_cvt,
|
|
|
|
tt_coderange_glyph
|
|
|
|
|
|
|
|
} TT_CodeRange_Tag;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct TT_CodeRange_
|
|
|
|
{
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_Byte* base;
|
2015-02-17 09:21:26 +01:00
|
|
|
FT_Long size;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
} TT_CodeRange;
|
|
|
|
|
|
|
|
typedef TT_CodeRange TT_CodeRangeTable[TT_MAX_CODE_RANGES];
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* Defines a function/instruction definition record. */
|
|
|
|
/* */
|
|
|
|
typedef struct TT_DefRecord_
|
|
|
|
{
|
2013-01-28 13:56:23 +01:00
|
|
|
FT_Int range; /* in which code range is it located? */
|
|
|
|
FT_Long start; /* where does it start? */
|
|
|
|
FT_Long end; /* where does it end? */
|
|
|
|
FT_UInt opc; /* function #, or instruction code */
|
|
|
|
FT_Bool active; /* is it active? */
|
|
|
|
FT_Bool inline_delta; /* is function that defines inline delta? */
|
|
|
|
FT_ULong sph_fdef_flags; /* flags to identify special functions */
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
} TT_DefRecord, *TT_DefArray;
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* Subglyph transformation record. */
|
|
|
|
/* */
|
|
|
|
typedef struct TT_Transform_
|
|
|
|
{
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_Fixed xx, xy; /* transformation matrix coefficients */
|
|
|
|
FT_Fixed yx, yy;
|
[truetype] Support subpixel hinting.
This is the large, famous `Infinality' patch to support ClearType
bytecode which has been available from
http://www.infinality.net/blog/ for some time, and which has been
refined over the last years. While still experimental, it is now
mature enough to be included directly into FreeType.
Most of the code is based on the ClearType whitepaper written by
Greg Hitchcock
http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx
which gives a detailed overview of the necessary changes to the
Microsoft rasterizer so that older fonts are supported. However, a
lot of details are still missing, and this patches provides a
framework to easily handle rendering issues down to the glyph level
of certain fonts.
Note that ClearType support is not completely implemented! In
particular, full support for the options `compatible_widths',
`symmetrical_smoothing, and `bgr' (via the GETINFO bytecode
instruction) is missing.
* src/truetype/ttsubpix.c: New file, providing code to handle
`tweaks', this is, rules for certain glyphs in certain fonts
(including wildcards) which need a special treatment.
* src/truetype/ttsubpix.h: New file, holding the tweaking rules.
* include/freetype/config/ftoption.h, src/devel/ftoption.h
(TT_CONFIG_OPTION_SUBPIXEL_HINTING): New macro.
* include/freetype/internal/ftobjs.h (FT_PIX_FLOOR_GRID,
FT_PIX_ROUND_GRID, FT_PIX_CEIL_GRID): New macros.
* src/truetype/truetype.c [TT_USE_BYTECODE_INTERPRETER]: Include
`ttsubpix.c'.
* src/truetype/ttgload.c: Include `ttsubpix.h'.
[All changes below are guarded by TT_CONFIG_OPTION_SUBPIXEL_HINTING.]
(tt_get_metrics): Set tweak flags.
(TT_Hint_Glyph): Call `FT_Outline_EmboldenXY' if necessary.
(TT_Process_Simple_Glyph): Compensate emboldening if necessary.
(compute_glyph_metrics): Handle `compatible widths' option.
(tt_loader_init): Handle ClearType GETINFO information bits.
* src/truetype/rules.mk (TT_DRC_SRC): Updated.
* src/truetype/ttinterp.c: Include `ttsubpix.h'.
[Where necessary, changes below are guarded by
TT_CONFIG_OPTION_SUBPIXEL_HINTING.]
(Direct_Move, Direct_Move_X): Extended.
(Round_None, Round_To_Grid, Round_To_Half_Grid, Round_Down_To_Grid,
Round_Up_To_Grid, Round_To_Double_Grid, Round_Super, Round_Super_45,
SetSuperRound): Add parameter to handle the number of grid lines per
pixel.
(SET_SuperRound, ROUND_None, CUR_Func_round): Updated.
(DO_SROUND, DOS45ROUND, DO_ODD, DO_EVEN): Updated.
(DO_ROUND, DO_NROUND): Updated.
(DO_RS): Take care of `Typeman' bytecode patterns.
(Ins_FDEF): Add some debugging code. Commented out.
(Ins_ENDF): Restore state.
(Ins_CALL, Ins_LOOPCALL): Handle inline delta functions.
(Ins_MD): Handle `Vacuform' rounds.
(Move_Zp2_Point, Ins_SHPIX, Ins_MSIRP, Ins_MDAP, Ins_MIAP,
Ins_MDRP, Ins_MIRP): Handle tweaks.
(Ins_ALIGNRP): Add tweak guard.
(Ins_IUP, Ins_DELTAP): Handle tweaks.
(Ins_GETINFO): Handle new ClearType bits.
(TT_RunIns): Handle tweaks.
* src/truetype/ttinterp.h: Updated.
(SPH_TweakRule, SPH_ScaleRule): New structures for tweaks.
(TT_ExecContextRec): Add members for subpixel hinting support.
* src/truetype/ttobjs.h (TT_DefRecord): Add `inline_delta' member.
2012-06-18 10:36:06 +02:00
|
|
|
FT_F26Dot6 ox, oy; /* offsets */
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
} TT_Transform;
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* A note regarding non-squared pixels: */
|
|
|
|
/* */
|
2000-06-12 21:36:41 +02:00
|
|
|
/* (This text will probably go into some docs at some time; for now, it */
|
2009-06-16 22:41:46 +02:00
|
|
|
/* is kept here to explain some definitions in the TT_Size_Metrics */
|
|
|
|
/* record). */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
|
|
|
/* The CVT is a one-dimensional array containing values that control */
|
|
|
|
/* certain important characteristics in a font, like the height of all */
|
|
|
|
/* capitals, all lowercase letter, default spacing or stem width/height. */
|
|
|
|
/* */
|
|
|
|
/* These values are found in FUnits in the font file, and must be scaled */
|
|
|
|
/* to pixel coordinates before being used by the CVT and glyph programs. */
|
|
|
|
/* Unfortunately, when using distinct x and y resolutions (or distinct x */
|
|
|
|
/* and y pointsizes), there are two possible scalings. */
|
|
|
|
/* */
|
|
|
|
/* A first try was to implement a `lazy' scheme where all values were */
|
|
|
|
/* scaled when first used. However, while some values are always used */
|
|
|
|
/* in the same direction, some others are used under many different */
|
|
|
|
/* circumstances and orientations. */
|
|
|
|
/* */
|
|
|
|
/* I have found a simpler way to do the same, and it even seems to work */
|
|
|
|
/* in most of the cases: */
|
|
|
|
/* */
|
|
|
|
/* - All CVT values are scaled to the maximum ppem size. */
|
|
|
|
/* */
|
|
|
|
/* - When performing a read or write in the CVT, a ratio factor is used */
|
|
|
|
/* to perform adequate scaling. Example: */
|
|
|
|
/* */
|
|
|
|
/* x_ppem = 14 */
|
|
|
|
/* y_ppem = 10 */
|
|
|
|
/* */
|
|
|
|
/* We choose ppem = x_ppem = 14 as the CVT scaling size. All cvt */
|
|
|
|
/* entries are scaled to it. */
|
|
|
|
/* */
|
|
|
|
/* x_ratio = 1.0 */
|
|
|
|
/* y_ratio = y_ppem/ppem (< 1.0) */
|
|
|
|
/* */
|
|
|
|
/* We compute the current ratio like: */
|
|
|
|
/* */
|
|
|
|
/* - If projVector is horizontal, */
|
|
|
|
/* ratio = x_ratio = 1.0 */
|
|
|
|
/* */
|
|
|
|
/* - if projVector is vertical, */
|
|
|
|
/* ratio = y_ratio */
|
|
|
|
/* */
|
|
|
|
/* - else, */
|
|
|
|
/* ratio = sqrt( (proj.x * x_ratio) ^ 2 + (proj.y * y_ratio) ^ 2 ) */
|
|
|
|
/* */
|
|
|
|
/* Reading a cvt value returns */
|
|
|
|
/* ratio * cvt[index] */
|
|
|
|
/* */
|
|
|
|
/* Writing a cvt value in pixels: */
|
|
|
|
/* cvt[index] / ratio */
|
|
|
|
/* */
|
|
|
|
/* The current ppem is simply */
|
|
|
|
/* ratio * ppem */
|
|
|
|
/* */
|
|
|
|
/*************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* Metrics used by the TrueType size and context objects. */
|
|
|
|
/* */
|
|
|
|
typedef struct TT_Size_Metrics_
|
|
|
|
{
|
|
|
|
/* for non-square pixels */
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_Long x_ratio;
|
|
|
|
FT_Long y_ratio;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_UShort ppem; /* maximum ppem size */
|
|
|
|
FT_Long ratio; /* current ratio */
|
|
|
|
FT_Fixed scale;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_F26Dot6 compensations[4]; /* device-specific compensations */
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_Bool valid;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_Bool rotated; /* `is the glyph rotated?'-flag */
|
|
|
|
FT_Bool stretched; /* `is the glyph stretched?'-flag */
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
} TT_Size_Metrics;
|
|
|
|
|
|
|
|
|
2000-07-02 15:53:16 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* TrueType size class. */
|
|
|
|
/* */
|
1999-12-17 00:11:37 +01:00
|
|
|
typedef struct TT_SizeRec_
|
|
|
|
{
|
|
|
|
FT_SizeRec root;
|
|
|
|
|
2005-07-26 10:14:03 +02:00
|
|
|
/* we have our own copy of metrics so that we can modify */
|
|
|
|
/* it without affecting auto-hinting (when used) */
|
2017-04-22 23:02:21 +02:00
|
|
|
FT_Size_Metrics* metrics; /* for the current rendering mode */
|
|
|
|
FT_Size_Metrics hinted_metrics; /* for the hinted rendering mode */
|
2005-07-26 10:14:03 +02:00
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
TT_Size_Metrics ttmetrics;
|
|
|
|
|
2006-01-13 15:53:28 +01:00
|
|
|
FT_ULong strike_index; /* 0xFFFFFFFF to indicate invalid */
|
2000-11-07 00:07:51 +01:00
|
|
|
|
2006-08-26 00:45:13 +02:00
|
|
|
#ifdef TT_USE_BYTECODE_INTERPRETER
|
2000-06-12 21:36:41 +02:00
|
|
|
|
2016-08-22 19:32:34 +02:00
|
|
|
FT_Long point_size; /* for the `MPS' bytecode instruction */
|
|
|
|
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_UInt num_function_defs; /* number of function definitions */
|
|
|
|
FT_UInt max_function_defs;
|
1999-12-17 00:11:37 +01:00
|
|
|
TT_DefArray function_defs; /* table of function definitions */
|
|
|
|
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_UInt num_instruction_defs; /* number of ins. definitions */
|
|
|
|
FT_UInt max_instruction_defs;
|
1999-12-17 00:11:37 +01:00
|
|
|
TT_DefArray instruction_defs; /* table of ins. definitions */
|
|
|
|
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_UInt max_func;
|
|
|
|
FT_UInt max_ins;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
TT_CodeRangeTable codeRangeTable;
|
|
|
|
|
|
|
|
TT_GraphicsState GS;
|
|
|
|
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_ULong cvt_size; /* the scaled control value table */
|
|
|
|
FT_Long* cvt;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_UShort storage_size; /* The storage area is now part of */
|
|
|
|
FT_Long* storage; /* the instance */
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2002-04-01 16:25:28 +02:00
|
|
|
TT_GlyphZoneRec twilight; /* The instance's twilight zone */
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
TT_ExecContext context;
|
|
|
|
|
2014-07-12 19:28:14 +02:00
|
|
|
/* if negative, `fpgm' (resp. `prep'), wasn't executed yet; */
|
|
|
|
/* otherwise it is the returned error code */
|
|
|
|
FT_Error bytecode_ready;
|
|
|
|
FT_Error cvt_ready;
|
2007-01-05 16:32:01 +01:00
|
|
|
|
2006-08-26 00:45:13 +02:00
|
|
|
#endif /* TT_USE_BYTECODE_INTERPRETER */
|
2000-02-02 13:16:19 +01:00
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
} TT_SizeRec;
|
|
|
|
|
|
|
|
|
2000-07-02 15:53:16 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* TrueType driver class. */
|
|
|
|
/* */
|
1999-12-17 00:11:37 +01:00
|
|
|
typedef struct TT_DriverRec_
|
|
|
|
{
|
2013-05-17 13:51:07 +02:00
|
|
|
FT_DriverRec root;
|
|
|
|
|
2002-04-01 16:25:28 +02:00
|
|
|
TT_GlyphZoneRec zone; /* glyph loader points zone */
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2013-05-17 13:51:07 +02:00
|
|
|
FT_UInt interpreter_version;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
} TT_DriverRec;
|
|
|
|
|
|
|
|
|
* src/truetype/ttobjs.h, src/truetype/ttobjs.c (tt_face_init,
tt_face_done, tt_size_init, tt_size_done, tt_driver_init,
tt_driver_done): Don't use TT_XXX but FT_XXX arguments which are
typecast to the proper TT_XXX within the function.
Update code accordingly.
* src/truetype/ttdriver.c (Get_Kerning, Set_Char_Sizes,
Set_Pixel_Sizes, Load_Glyph, tt_get_interface): Don't use TT_XXX but
FT_XXX arguments which are typecast to the proper TT_XXX within the
function.
Update code accordingly.
(tt_driver_class): Remove casts.
2004-05-04 18:53:45 +02:00
|
|
|
/* Note: All of the functions below (except tt_size_reset()) are used */
|
|
|
|
/* as function pointers in a FT_Driver_ClassRec. Therefore their */
|
|
|
|
/* parameters are of types FT_Face, FT_Size, etc., rather than TT_Face, */
|
|
|
|
/* TT_Size, etc., so that the compiler can confirm that the types and */
|
|
|
|
/* number of parameters are correct. In all cases the FT_xxx types are */
|
|
|
|
/* cast to their TT_xxx counterparts inside the functions since FreeType */
|
|
|
|
/* will always use the TT driver to create them. */
|
|
|
|
|
|
|
|
|
2000-06-12 21:36:41 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* Face functions */
|
|
|
|
/* */
|
2002-03-01 03:26:22 +01:00
|
|
|
FT_LOCAL( FT_Error )
|
* massive re-formatting changes to many, many source files. I don't
want to list them all here. The operations performed were all logical
transformations of the sources:
- trying to convert all enums and constants to CAPITALIZED_STYLE, with
#define definitions like
#define my_old_constants MY_NEW_CONSTANT
- big, big update of the documentation comments
* include/freetype/freetype.h, src/base/ftobjs.c, src/smooth/ftsmooth.c,
include/freetype/ftimage.h: adding support for LCD-optimized rendering
though the new constants/enums:
FT_RENDER_MODE_LCD, FT_RENDER_MODE_LCD_V
FT_PIXEL_MODE_LCD, FT_PIXEL_MODE_LCD_V
this is still work in progress, don't expect everything to work correctly
though most of the features have been implemented.
* adding new FT_LOAD_XXX flags, used to specify both hinting and rendering
targets:
FT_LOAD_TARGET_NORMAL :: anti-aliased hinting & rendering
FT_LOAD_TARGET_MONO :: monochrome bitmaps
FT_LOAD_TARGET_LCD :: horizontal RGB/BGR decimated hinting & rendering
FT_LOAD_TARGET_LCD_V :: vertical RGB/BGR decimated hinting & rendering
note that FT_LOAD_TARGET_NORMAL is 0, which means that the default
behaviour of the font engine is _unchanged_.
2002-08-27 22:20:29 +02:00
|
|
|
tt_face_init( FT_Stream stream,
|
* src/truetype/ttobjs.h, src/truetype/ttobjs.c (tt_face_init,
tt_face_done, tt_size_init, tt_size_done, tt_driver_init,
tt_driver_done): Don't use TT_XXX but FT_XXX arguments which are
typecast to the proper TT_XXX within the function.
Update code accordingly.
* src/truetype/ttdriver.c (Get_Kerning, Set_Char_Sizes,
Set_Pixel_Sizes, Load_Glyph, tt_get_interface): Don't use TT_XXX but
FT_XXX arguments which are typecast to the proper TT_XXX within the
function.
Update code accordingly.
(tt_driver_class): Remove casts.
2004-05-04 18:53:45 +02:00
|
|
|
FT_Face ttface, /* TT_Face */
|
2001-06-28 09:17:51 +02:00
|
|
|
FT_Int face_index,
|
|
|
|
FT_Int num_params,
|
|
|
|
FT_Parameter* params );
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2002-03-01 03:26:22 +01:00
|
|
|
FT_LOCAL( void )
|
* src/truetype/ttobjs.h, src/truetype/ttobjs.c (tt_face_init,
tt_face_done, tt_size_init, tt_size_done, tt_driver_init,
tt_driver_done): Don't use TT_XXX but FT_XXX arguments which are
typecast to the proper TT_XXX within the function.
Update code accordingly.
* src/truetype/ttdriver.c (Get_Kerning, Set_Char_Sizes,
Set_Pixel_Sizes, Load_Glyph, tt_get_interface): Don't use TT_XXX but
FT_XXX arguments which are typecast to the proper TT_XXX within the
function.
Update code accordingly.
(tt_driver_class): Remove casts.
2004-05-04 18:53:45 +02:00
|
|
|
tt_face_done( FT_Face ttface ); /* TT_Face */
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
|
2000-06-12 21:36:41 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* Size functions */
|
|
|
|
/* */
|
2002-03-01 03:26:22 +01:00
|
|
|
FT_LOCAL( FT_Error )
|
* src/truetype/ttobjs.h, src/truetype/ttobjs.c (tt_face_init,
tt_face_done, tt_size_init, tt_size_done, tt_driver_init,
tt_driver_done): Don't use TT_XXX but FT_XXX arguments which are
typecast to the proper TT_XXX within the function.
Update code accordingly.
* src/truetype/ttdriver.c (Get_Kerning, Set_Char_Sizes,
Set_Pixel_Sizes, Load_Glyph, tt_get_interface): Don't use TT_XXX but
FT_XXX arguments which are typecast to the proper TT_XXX within the
function.
Update code accordingly.
(tt_driver_class): Remove casts.
2004-05-04 18:53:45 +02:00
|
|
|
tt_size_init( FT_Size ttsize ); /* TT_Size */
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2002-03-01 03:26:22 +01:00
|
|
|
FT_LOCAL( void )
|
* src/truetype/ttobjs.h, src/truetype/ttobjs.c (tt_face_init,
tt_face_done, tt_size_init, tt_size_done, tt_driver_init,
tt_driver_done): Don't use TT_XXX but FT_XXX arguments which are
typecast to the proper TT_XXX within the function.
Update code accordingly.
* src/truetype/ttdriver.c (Get_Kerning, Set_Char_Sizes,
Set_Pixel_Sizes, Load_Glyph, tt_get_interface): Don't use TT_XXX but
FT_XXX arguments which are typecast to the proper TT_XXX within the
function.
Update code accordingly.
(tt_driver_class): Remove casts.
2004-05-04 18:53:45 +02:00
|
|
|
tt_size_done( FT_Size ttsize ); /* TT_Size */
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2006-08-26 00:45:13 +02:00
|
|
|
#ifdef TT_USE_BYTECODE_INTERPRETER
|
2005-08-03 23:17:53 +02:00
|
|
|
|
2005-07-31 13:41:54 +02:00
|
|
|
FT_LOCAL( FT_Error )
|
2011-02-01 07:08:43 +01:00
|
|
|
tt_size_run_fpgm( TT_Size size,
|
|
|
|
FT_Bool pedantic );
|
2005-07-31 13:41:54 +02:00
|
|
|
|
|
|
|
FT_LOCAL( FT_Error )
|
2011-02-01 07:08:43 +01:00
|
|
|
tt_size_run_prep( TT_Size size,
|
|
|
|
FT_Bool pedantic );
|
2005-08-03 23:17:53 +02:00
|
|
|
|
2007-05-24 21:39:14 +02:00
|
|
|
FT_LOCAL( FT_Error )
|
2011-02-01 07:08:43 +01:00
|
|
|
tt_size_ready_bytecode( TT_Size size,
|
|
|
|
FT_Bool pedantic );
|
2007-05-24 21:39:14 +02:00
|
|
|
|
2006-08-26 00:45:13 +02:00
|
|
|
#endif /* TT_USE_BYTECODE_INTERPRETER */
|
2005-07-31 13:41:54 +02:00
|
|
|
|
2002-03-01 03:26:22 +01:00
|
|
|
FT_LOCAL( FT_Error )
|
2017-01-11 10:05:27 +01:00
|
|
|
tt_size_reset( TT_Size size,
|
|
|
|
FT_Bool only_height );
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
|
2000-06-12 21:36:41 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* Driver functions */
|
|
|
|
/* */
|
2002-03-01 03:26:22 +01:00
|
|
|
FT_LOCAL( FT_Error )
|
* src/truetype/ttobjs.h, src/truetype/ttobjs.c (tt_face_init,
tt_face_done, tt_size_init, tt_size_done, tt_driver_init,
tt_driver_done): Don't use TT_XXX but FT_XXX arguments which are
typecast to the proper TT_XXX within the function.
Update code accordingly.
* src/truetype/ttdriver.c (Get_Kerning, Set_Char_Sizes,
Set_Pixel_Sizes, Load_Glyph, tt_get_interface): Don't use TT_XXX but
FT_XXX arguments which are typecast to the proper TT_XXX within the
function.
Update code accordingly.
(tt_driver_class): Remove casts.
2004-05-04 18:53:45 +02:00
|
|
|
tt_driver_init( FT_Module ttdriver ); /* TT_Driver */
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2002-03-01 03:26:22 +01:00
|
|
|
FT_LOCAL( void )
|
* src/truetype/ttobjs.h, src/truetype/ttobjs.c (tt_face_init,
tt_face_done, tt_size_init, tt_size_done, tt_driver_init,
tt_driver_done): Don't use TT_XXX but FT_XXX arguments which are
typecast to the proper TT_XXX within the function.
Update code accordingly.
* src/truetype/ttdriver.c (Get_Kerning, Set_Char_Sizes,
Set_Pixel_Sizes, Load_Glyph, tt_get_interface): Don't use TT_XXX but
FT_XXX arguments which are typecast to the proper TT_XXX within the
function.
Update code accordingly.
(tt_driver_class): Remove casts.
2004-05-04 18:53:45 +02:00
|
|
|
tt_driver_done( FT_Module ttdriver ); /* TT_Driver */
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2000-07-02 15:53:16 +02:00
|
|
|
|
2005-08-16 03:54:59 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
2005-08-19 10:56:29 +02:00
|
|
|
/* Slot functions */
|
2005-08-16 03:54:59 +02:00
|
|
|
/* */
|
|
|
|
FT_LOCAL( FT_Error )
|
|
|
|
tt_slot_init( FT_GlyphSlot slot );
|
|
|
|
|
|
|
|
|
2012-08-27 09:35:22 +02:00
|
|
|
/* auxiliary */
|
|
|
|
#define IS_HINTED( flags ) ( ( flags & FT_LOAD_NO_HINTING ) == 0 )
|
|
|
|
|
|
|
|
|
2000-12-08 03:42:29 +01:00
|
|
|
FT_END_HEADER
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2016-01-12 21:37:13 +01:00
|
|
|
#endif /* TTOBJS_H_ */
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
|
|
|
|
/* END */
|