< prev index next >
src/java.desktop/share/native/libfreetype/src/truetype/ttobjs.c
Print this page
*** 1,21 ****
! /***************************************************************************/
! /* */
! /* ttobjs.c */
! /* */
! /* Objects manager (body). */
! /* */
! /* 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. */
! /* */
! /***************************************************************************/
#include <ft2build.h>
#include FT_INTERNAL_DEBUG_H
#include FT_INTERNAL_STREAM_H
--- 1,21 ----
! /****************************************************************************
! *
! * ttobjs.c
! *
! * Objects manager (body).
! *
! * 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.
! *
! */
#include <ft2build.h>
#include FT_INTERNAL_DEBUG_H
#include FT_INTERNAL_STREAM_H
*** 34,73 ****
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
#include "ttgxvar.h"
#endif
! /*************************************************************************/
! /* */
! /* The macro FT_COMPONENT is used in trace mode. It is an implicit */
! /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
! /* messages during execution. */
! /* */
#undef FT_COMPONENT
! #define FT_COMPONENT trace_ttobjs
#ifdef TT_USE_BYTECODE_INTERPRETER
! /*************************************************************************/
! /* */
! /* GLYPH ZONE FUNCTIONS */
! /* */
! /*************************************************************************/
! /*************************************************************************/
! /* */
! /* <Function> */
! /* tt_glyphzone_done */
! /* */
! /* <Description> */
! /* Deallocate a glyph zone. */
! /* */
! /* <Input> */
! /* zone :: A pointer to the target glyph zone. */
! /* */
FT_LOCAL_DEF( void )
tt_glyphzone_done( TT_GlyphZone zone )
{
FT_Memory memory = zone->memory;
--- 34,74 ----
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
#include "ttgxvar.h"
#endif
! /**************************************************************************
! *
! * The macro FT_COMPONENT is used in trace mode. It is an implicit
! * parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log
! * messages during execution.
! */
#undef FT_COMPONENT
! #define FT_COMPONENT ttobjs
#ifdef TT_USE_BYTECODE_INTERPRETER
! /**************************************************************************
! *
! * GLYPH ZONE FUNCTIONS
! *
! */
! /**************************************************************************
! *
! * @Function:
! * tt_glyphzone_done
! *
! * @Description:
! * Deallocate a glyph zone.
! *
! * @Input:
! * zone ::
! * A pointer to the target glyph zone.
! */
FT_LOCAL_DEF( void )
tt_glyphzone_done( TT_GlyphZone zone )
{
FT_Memory memory = zone->memory;
*** 85,115 ****
zone->memory = NULL;
}
}
! /*************************************************************************/
! /* */
! /* <Function> */
! /* tt_glyphzone_new */
! /* */
! /* <Description> */
! /* Allocate a new glyph zone. */
! /* */
! /* <Input> */
! /* memory :: A handle to the current memory object. */
! /* */
! /* maxPoints :: The capacity of glyph zone in points. */
! /* */
! /* maxContours :: The capacity of glyph zone in contours. */
! /* */
! /* <Output> */
! /* zone :: A pointer to the target glyph zone record. */
! /* */
! /* <Return> */
! /* FreeType error code. 0 means success. */
! /* */
FT_LOCAL_DEF( FT_Error )
tt_glyphzone_new( FT_Memory memory,
FT_UShort maxPoints,
FT_Short maxContours,
TT_GlyphZone zone )
--- 86,120 ----
zone->memory = NULL;
}
}
! /**************************************************************************
! *
! * @Function:
! * tt_glyphzone_new
! *
! * @Description:
! * Allocate a new glyph zone.
! *
! * @Input:
! * memory ::
! * A handle to the current memory object.
! *
! * maxPoints ::
! * The capacity of glyph zone in points.
! *
! * maxContours ::
! * The capacity of glyph zone in contours.
! *
! * @Output:
! * zone ::
! * A pointer to the target glyph zone record.
! *
! * @Return:
! * FreeType error code. 0 means success.
! */
FT_LOCAL_DEF( FT_Error )
tt_glyphzone_new( FT_Memory memory,
FT_UShort maxPoints,
FT_Short maxContours,
TT_GlyphZone zone )
*** 564,599 ****
return result;
}
! /*************************************************************************/
! /* */
! /* <Function> */
! /* tt_face_init */
! /* */
! /* <Description> */
! /* Initialize a given TrueType face object. */
! /* */
! /* <Input> */
! /* stream :: The source font stream. */
! /* */
! /* face_index :: The index of the TrueType font, if we are opening a */
! /* collection, in bits 0-15. The numbered instance */
! /* index~+~1 of a GX (sub)font, if applicable, in bits */
! /* 16-30. */
! /* */
! /* num_params :: Number of additional generic parameters. Ignored. */
! /* */
! /* params :: Additional generic parameters. Ignored. */
! /* */
! /* <InOut> */
! /* face :: The newly built face object. */
! /* */
! /* <Return> */
! /* FreeType error code. 0 means success. */
! /* */
FT_LOCAL_DEF( FT_Error )
tt_face_init( FT_Stream stream,
FT_Face ttface, /* TT_Face */
FT_Int face_index,
FT_Int num_params,
--- 569,609 ----
return result;
}
! /**************************************************************************
! *
! * @Function:
! * tt_face_init
! *
! * @Description:
! * Initialize a given TrueType face object.
! *
! * @Input:
! * stream ::
! * The source font stream.
! *
! * face_index ::
! * The index of the TrueType font, if we are opening a
! * collection, in bits 0-15. The numbered instance
! * index~+~1 of a GX (sub)font, if applicable, in bits
! * 16-30.
! *
! * num_params ::
! * Number of additional generic parameters. Ignored.
! *
! * params ::
! * Additional generic parameters. Ignored.
! *
! * @InOut:
! * face ::
! * The newly built face object.
! *
! * @Return:
! * FreeType error code. 0 means success.
! */
FT_LOCAL_DEF( FT_Error )
tt_face_init( FT_Stream stream,
FT_Face ttface, /* TT_Face */
FT_Int face_index,
FT_Int num_params,
*** 741,761 ****
error = FT_THROW( Unknown_File_Format );
goto Exit;
}
! /*************************************************************************/
! /* */
! /* <Function> */
! /* tt_face_done */
! /* */
! /* <Description> */
! /* Finalize a given face object. */
! /* */
! /* <Input> */
! /* face :: A pointer to the face object to destroy. */
! /* */
FT_LOCAL_DEF( void )
tt_face_done( FT_Face ttface ) /* TT_Face */
{
TT_Face face = (TT_Face)ttface;
FT_Memory memory;
--- 751,772 ----
error = FT_THROW( Unknown_File_Format );
goto Exit;
}
! /**************************************************************************
! *
! * @Function:
! * tt_face_done
! *
! * @Description:
! * Finalize a given face object.
! *
! * @Input:
! * face ::
! * A pointer to the face object to destroy.
! */
FT_LOCAL_DEF( void )
tt_face_done( FT_Face ttface ) /* TT_Face */
{
TT_Face face = (TT_Face)ttface;
FT_Memory memory;
*** 797,830 ****
face->blend = NULL;
#endif
}
! /*************************************************************************/
! /* */
! /* SIZE FUNCTIONS */
! /* */
! /*************************************************************************/
#ifdef TT_USE_BYTECODE_INTERPRETER
! /*************************************************************************/
! /* */
! /* <Function> */
! /* tt_size_run_fpgm */
! /* */
! /* <Description> */
! /* Run the font program. */
! /* */
! /* <Input> */
! /* size :: A handle to the size object. */
! /* */
! /* pedantic :: Set if bytecode execution should be pedantic. */
! /* */
! /* <Return> */
! /* FreeType error code. 0 means success. */
! /* */
FT_LOCAL_DEF( FT_Error )
tt_size_run_fpgm( TT_Size size,
FT_Bool pedantic )
{
TT_Face face = (TT_Face)size->root.face;
--- 808,843 ----
face->blend = NULL;
#endif
}
! /**************************************************************************
! *
! * SIZE FUNCTIONS
! *
! */
#ifdef TT_USE_BYTECODE_INTERPRETER
! /**************************************************************************
! *
! * @Function:
! * tt_size_run_fpgm
! *
! * @Description:
! * Run the font program.
! *
! * @Input:
! * size ::
! * A handle to the size object.
! *
! * pedantic ::
! * Set if bytecode execution should be pedantic.
! *
! * @Return:
! * FreeType error code. 0 means success.
! */
FT_LOCAL_DEF( FT_Error )
tt_size_run_fpgm( TT_Size size,
FT_Bool pedantic )
{
TT_Face face = (TT_Face)size->root.face;
*** 897,922 ****
return error;
}
! /*************************************************************************/
! /* */
! /* <Function> */
! /* tt_size_run_prep */
! /* */
! /* <Description> */
! /* Run the control value program. */
! /* */
! /* <Input> */
! /* size :: A handle to the size object. */
! /* */
! /* pedantic :: Set if bytecode execution should be pedantic. */
! /* */
! /* <Return> */
! /* FreeType error code. 0 means success. */
! /* */
FT_LOCAL_DEF( FT_Error )
tt_size_run_prep( TT_Size size,
FT_Bool pedantic )
{
TT_Face face = (TT_Face)size->root.face;
--- 910,937 ----
return error;
}
! /**************************************************************************
! *
! * @Function:
! * tt_size_run_prep
! *
! * @Description:
! * Run the control value program.
! *
! * @Input:
! * size ::
! * A handle to the size object.
! *
! * pedantic ::
! * Set if bytecode execution should be pedantic.
! *
! * @Return:
! * FreeType error code. 0 means success.
! */
FT_LOCAL_DEF( FT_Error )
tt_size_run_prep( TT_Size size,
FT_Bool pedantic )
{
TT_Face face = (TT_Face)size->root.face;
*** 1158,1170 ****
FT_UInt i;
TT_Face face = (TT_Face)size->root.face;
/* Scale the cvt values to the new ppem. */
! /* We use by default the y ppem to scale the CVT. */
for ( i = 0; i < size->cvt_size; i++ )
size->cvt[i] = FT_MulFix( face->cvt[i], size->ttmetrics.scale );
/* all twilight points are originally zero */
for ( i = 0; i < (FT_UInt)size->twilight.n_points; i++ )
{
size->twilight.org[i].x = 0;
--- 1173,1191 ----
FT_UInt i;
TT_Face face = (TT_Face)size->root.face;
/* Scale the cvt values to the new ppem. */
! /* By default, we use the y ppem value for scaling. */
! FT_TRACE6(( "CVT values:\n" ));
for ( i = 0; i < size->cvt_size; i++ )
+ {
size->cvt[i] = FT_MulFix( face->cvt[i], size->ttmetrics.scale );
+ FT_TRACE6(( " %3d: %d (%f)\n",
+ i, face->cvt[i], size->cvt[i] / 64.0 ));
+ }
+ FT_TRACE6(( "\n" ));
/* all twilight points are originally zero */
for ( i = 0; i < (FT_UInt)size->twilight.n_points; i++ )
{
size->twilight.org[i].x = 0;
*** 1189,1212 ****
}
#endif /* TT_USE_BYTECODE_INTERPRETER */
! /*************************************************************************/
! /* */
! /* <Function> */
! /* tt_size_init */
! /* */
! /* <Description> */
! /* Initialize a new TrueType size object. */
! /* */
! /* <InOut> */
! /* size :: A handle to the size object. */
! /* */
! /* <Return> */
! /* FreeType error code. 0 means success. */
! /* */
FT_LOCAL_DEF( FT_Error )
tt_size_init( FT_Size ttsize ) /* TT_Size */
{
TT_Size size = (TT_Size)ttsize;
FT_Error error = FT_Err_Ok;
--- 1210,1234 ----
}
#endif /* TT_USE_BYTECODE_INTERPRETER */
! /**************************************************************************
! *
! * @Function:
! * tt_size_init
! *
! * @Description:
! * Initialize a new TrueType size object.
! *
! * @InOut:
! * size ::
! * A handle to the size object.
! *
! * @Return:
! * FreeType error code. 0 means success.
! */
FT_LOCAL_DEF( FT_Error )
tt_size_init( FT_Size ttsize ) /* TT_Size */
{
TT_Size size = (TT_Size)ttsize;
FT_Error error = FT_Err_Ok;
*** 1222,1242 ****
return error;
}
! /*************************************************************************/
! /* */
! /* <Function> */
! /* tt_size_done */
! /* */
! /* <Description> */
! /* The TrueType size object finalizer. */
! /* */
! /* <Input> */
! /* size :: A handle to the target size object. */
! /* */
FT_LOCAL_DEF( void )
tt_size_done( FT_Size ttsize ) /* TT_Size */
{
TT_Size size = (TT_Size)ttsize;
--- 1244,1265 ----
return error;
}
! /**************************************************************************
! *
! * @Function:
! * tt_size_done
! *
! * @Description:
! * The TrueType size object finalizer.
! *
! * @Input:
! * size ::
! * A handle to the target size object.
! */
FT_LOCAL_DEF( void )
tt_size_done( FT_Size ttsize ) /* TT_Size */
{
TT_Size size = (TT_Size)ttsize;
*** 1247,1272 ****
size->ttmetrics.valid = FALSE;
}
! /*************************************************************************/
! /* */
! /* <Function> */
! /* tt_size_reset */
! /* */
! /* <Description> */
! /* Reset a TrueType size when resolutions and character dimensions */
! /* have been changed. */
! /* */
! /* <Input> */
! /* size :: A handle to the target size object. */
! /* */
! /* only_height :: Only recompute ascender, descender, and height; */
! /* this flag is used for variation fonts where */
! /* `tt_size_reset' is used as an iterator function. */
! /* */
FT_LOCAL_DEF( FT_Error )
tt_size_reset( TT_Size size,
FT_Bool only_height )
{
TT_Face face;
--- 1270,1297 ----
size->ttmetrics.valid = FALSE;
}
! /**************************************************************************
! *
! * @Function:
! * tt_size_reset
! *
! * @Description:
! * Reset a TrueType size when resolutions and character dimensions
! * have been changed.
! *
! * @Input:
! * size ::
! * A handle to the target size object.
! *
! * only_height ::
! * Only recompute ascender, descender, and height;
! * this flag is used for variation fonts where
! * `tt_size_reset' is used as an iterator function.
! */
FT_LOCAL_DEF( FT_Error )
tt_size_reset( TT_Size size,
FT_Bool only_height )
{
TT_Face face;
*** 1356,1379 ****
return FT_Err_Ok;
}
! /*************************************************************************/
! /* */
! /* <Function> */
! /* tt_driver_init */
! /* */
! /* <Description> */
! /* Initialize a given TrueType driver object. */
! /* */
! /* <Input> */
! /* driver :: A handle to the target driver object. */
! /* */
! /* <Return> */
! /* FreeType error code. 0 means success. */
! /* */
FT_LOCAL_DEF( FT_Error )
tt_driver_init( FT_Module ttdriver ) /* TT_Driver */
{
#ifdef TT_USE_BYTECODE_INTERPRETER
--- 1381,1405 ----
return FT_Err_Ok;
}
! /**************************************************************************
! *
! * @Function:
! * tt_driver_init
! *
! * @Description:
! * Initialize a given TrueType driver object.
! *
! * @Input:
! * driver ::
! * A handle to the target driver object.
! *
! * @Return:
! * FreeType error code. 0 means success.
! */
FT_LOCAL_DEF( FT_Error )
tt_driver_init( FT_Module ttdriver ) /* TT_Driver */
{
#ifdef TT_USE_BYTECODE_INTERPRETER
*** 1396,1437 ****
return FT_Err_Ok;
}
! /*************************************************************************/
! /* */
! /* <Function> */
! /* tt_driver_done */
! /* */
! /* <Description> */
! /* Finalize a given TrueType driver. */
! /* */
! /* <Input> */
! /* driver :: A handle to the target TrueType driver. */
! /* */
FT_LOCAL_DEF( void )
tt_driver_done( FT_Module ttdriver ) /* TT_Driver */
{
FT_UNUSED( ttdriver );
}
! /*************************************************************************/
! /* */
! /* <Function> */
! /* tt_slot_init */
! /* */
! /* <Description> */
! /* Initialize a new slot object. */
! /* */
! /* <InOut> */
! /* slot :: A handle to the slot object. */
! /* */
! /* <Return> */
! /* FreeType error code. 0 means success. */
! /* */
FT_LOCAL_DEF( FT_Error )
tt_slot_init( FT_GlyphSlot slot )
{
return FT_GlyphLoader_CreateExtra( slot->internal->loader );
}
--- 1422,1465 ----
return FT_Err_Ok;
}
! /**************************************************************************
! *
! * @Function:
! * tt_driver_done
! *
! * @Description:
! * Finalize a given TrueType driver.
! *
! * @Input:
! * driver ::
! * A handle to the target TrueType driver.
! */
FT_LOCAL_DEF( void )
tt_driver_done( FT_Module ttdriver ) /* TT_Driver */
{
FT_UNUSED( ttdriver );
}
! /**************************************************************************
! *
! * @Function:
! * tt_slot_init
! *
! * @Description:
! * Initialize a new slot object.
! *
! * @InOut:
! * slot ::
! * A handle to the slot object.
! *
! * @Return:
! * FreeType error code. 0 means success.
! */
FT_LOCAL_DEF( FT_Error )
tt_slot_init( FT_GlyphSlot slot )
{
return FT_GlyphLoader_CreateExtra( slot->internal->loader );
}
< prev index next >