< prev index next >
src/java.desktop/share/native/libfreetype/src/truetype/ttobjs.h
Print this page
*** 1,21 ****
! /***************************************************************************/
! /* */
! /* ttobjs.h */
! /* */
! /* Objects manager (specification). */
! /* */
! /* Copyright 1996-2018 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 TTOBJS_H_
#define TTOBJS_H_
--- 1,21 ----
! /****************************************************************************
! *
! * ttobjs.h
! *
! * Objects manager (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 TTOBJS_H_
#define TTOBJS_H_
*** 26,69 ****
FT_BEGIN_HEADER
! /*************************************************************************/
! /* */
! /* <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_
{
FT_UShort rp0;
FT_UShort rp1;
FT_UShort rp2;
--- 26,69 ----
FT_BEGIN_HEADER
! /**************************************************************************
! *
! * @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_
{
FT_UShort rp0;
FT_UShort rp1;
FT_UShort rp2;
*** 111,139 ****
#endif /* TT_USE_BYTECODE_INTERPRETER */
! /*************************************************************************/
! /* */
! /* 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,
--- 111,139 ----
#endif /* TT_USE_BYTECODE_INTERPRETER */
! /**************************************************************************
! *
! * 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,
*** 150,163 ****
} TT_CodeRange;
typedef TT_CodeRange TT_CodeRangeTable[TT_MAX_CODE_RANGES];
! /*************************************************************************/
! /* */
! /* Defines a function/instruction definition record. */
! /* */
typedef struct TT_DefRecord_
{
FT_Int range; /* in which code range is it located? */
FT_Long start; /* where does it start? */
FT_Long end; /* where does it end? */
--- 150,163 ----
} TT_CodeRange;
typedef TT_CodeRange TT_CodeRangeTable[TT_MAX_CODE_RANGES];
! /**************************************************************************
! *
! * Defines a function/instruction definition record.
! */
typedef struct TT_DefRecord_
{
FT_Int range; /* in which code range is it located? */
FT_Long start; /* where does it start? */
FT_Long end; /* where does it end? */
*** 167,255 ****
FT_ULong sph_fdef_flags; /* flags to identify special functions */
} TT_DefRecord, *TT_DefArray;
! /*************************************************************************/
! /* */
! /* Subglyph transformation record. */
! /* */
typedef struct TT_Transform_
{
FT_Fixed xx, xy; /* transformation matrix coefficients */
FT_Fixed yx, yy;
FT_F26Dot6 ox, oy; /* offsets */
} TT_Transform;
! /*************************************************************************/
! /* */
! /* A note regarding non-squared pixels: */
! /* */
! /* (This text will probably go into some docs at some time; for now, it */
! /* is kept here to explain some definitions in the TT_Size_Metrics */
! /* record). */
! /* */
! /* 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 */
FT_Long x_ratio;
FT_Long y_ratio;
--- 167,255 ----
FT_ULong sph_fdef_flags; /* flags to identify special functions */
} TT_DefRecord, *TT_DefArray;
! /**************************************************************************
! *
! * Subglyph transformation record.
! */
typedef struct TT_Transform_
{
FT_Fixed xx, xy; /* transformation matrix coefficients */
FT_Fixed yx, yy;
FT_F26Dot6 ox, oy; /* offsets */
} TT_Transform;
! /**************************************************************************
! *
! * A note regarding non-squared pixels:
! *
! * (This text will probably go into some docs at some time; for now, it
! * is kept here to explain some definitions in the TT_Size_Metrics
! * record).
! *
! * 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 */
FT_Long x_ratio;
FT_Long y_ratio;
*** 266,279 ****
FT_Bool stretched; /* `is the glyph stretched?'-flag */
} TT_Size_Metrics;
! /*************************************************************************/
! /* */
! /* TrueType size class. */
! /* */
typedef struct TT_SizeRec_
{
FT_SizeRec root;
/* we have our own copy of metrics so that we can modify */
--- 266,279 ----
FT_Bool stretched; /* `is the glyph stretched?'-flag */
} TT_Size_Metrics;
! /**************************************************************************
! *
! * TrueType size class.
! */
typedef struct TT_SizeRec_
{
FT_SizeRec root;
/* we have our own copy of metrics so that we can modify */
*** 322,335 ****
#endif /* TT_USE_BYTECODE_INTERPRETER */
} TT_SizeRec;
! /*************************************************************************/
! /* */
! /* TrueType driver class. */
! /* */
typedef struct TT_DriverRec_
{
FT_DriverRec root;
TT_GlyphZoneRec zone; /* glyph loader points zone */
--- 322,335 ----
#endif /* TT_USE_BYTECODE_INTERPRETER */
} TT_SizeRec;
! /**************************************************************************
! *
! * TrueType driver class.
! */
typedef struct TT_DriverRec_
{
FT_DriverRec root;
TT_GlyphZoneRec zone; /* glyph loader points zone */
*** 346,359 ****
/* 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. */
! /*************************************************************************/
! /* */
! /* Face functions */
! /* */
FT_LOCAL( FT_Error )
tt_face_init( FT_Stream stream,
FT_Face ttface, /* TT_Face */
FT_Int face_index,
FT_Int num_params,
--- 346,359 ----
/* 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. */
! /**************************************************************************
! *
! * Face functions
! */
FT_LOCAL( FT_Error )
tt_face_init( FT_Stream stream,
FT_Face ttface, /* TT_Face */
FT_Int face_index,
FT_Int num_params,
*** 361,374 ****
FT_LOCAL( void )
tt_face_done( FT_Face ttface ); /* TT_Face */
! /*************************************************************************/
! /* */
! /* Size functions */
! /* */
FT_LOCAL( FT_Error )
tt_size_init( FT_Size ttsize ); /* TT_Size */
FT_LOCAL( void )
tt_size_done( FT_Size ttsize ); /* TT_Size */
--- 361,374 ----
FT_LOCAL( void )
tt_face_done( FT_Face ttface ); /* TT_Face */
! /**************************************************************************
! *
! * Size functions
! */
FT_LOCAL( FT_Error )
tt_size_init( FT_Size ttsize ); /* TT_Size */
FT_LOCAL( void )
tt_size_done( FT_Size ttsize ); /* TT_Size */
*** 392,416 ****
FT_LOCAL( FT_Error )
tt_size_reset( TT_Size size,
FT_Bool only_height );
! /*************************************************************************/
! /* */
! /* Driver functions */
! /* */
FT_LOCAL( FT_Error )
tt_driver_init( FT_Module ttdriver ); /* TT_Driver */
FT_LOCAL( void )
tt_driver_done( FT_Module ttdriver ); /* TT_Driver */
! /*************************************************************************/
! /* */
! /* Slot functions */
! /* */
FT_LOCAL( FT_Error )
tt_slot_init( FT_GlyphSlot slot );
/* auxiliary */
--- 392,416 ----
FT_LOCAL( FT_Error )
tt_size_reset( TT_Size size,
FT_Bool only_height );
! /**************************************************************************
! *
! * Driver functions
! */
FT_LOCAL( FT_Error )
tt_driver_init( FT_Module ttdriver ); /* TT_Driver */
FT_LOCAL( void )
tt_driver_done( FT_Module ttdriver ); /* TT_Driver */
! /**************************************************************************
! *
! * Slot functions
! */
FT_LOCAL( FT_Error )
tt_slot_init( FT_GlyphSlot slot );
/* auxiliary */
< prev index next >