< prev index next >
src/java.desktop/share/native/libfreetype/src/truetype/ttobjs.c
Print this page
*** 146,156 ****
/* Compare the face with a list of well-known `tricky' fonts. */
/* This list shall be expanded as we find more of them. */
static FT_Bool
! tt_check_trickyness_family( FT_String* name )
{
#define TRICK_NAMES_MAX_CHARACTERS 19
#define TRICK_NAMES_COUNT 26
--- 146,156 ----
/* Compare the face with a list of well-known `tricky' fonts. */
/* This list shall be expanded as we find more of them. */
static FT_Bool
! tt_check_trickyness_family( const FT_String* name )
{
#define TRICK_NAMES_MAX_CHARACTERS 19
#define TRICK_NAMES_COUNT 26
*** 935,945 ****
--- 935,960 ----
FT_Bool pedantic )
{
TT_Face face = (TT_Face)size->root.face;
TT_ExecContext exec;
FT_Error error;
+ FT_UInt i;
+
+ /* unscaled CVT values are already stored in 26.6 format */
+ FT_Fixed scale = size->ttmetrics.scale >> 6;
+
+ /* 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], scale );
+ FT_TRACE6(( " %3d: %f (%f)\n",
+ i, face->cvt[i] / 64.0, size->cvt[i] / 64.0 ));
+ }
+ FT_TRACE6(( "\n" ));
exec = size->context;
error = TT_Load_Context( exec, face, size );
if ( error )
*** 1092,1106 ****
tt_metrics->rotated = FALSE;
tt_metrics->stretched = FALSE;
! /* set default engine compensation */
tt_metrics->compensations[0] = 0; /* gray */
tt_metrics->compensations[1] = 0; /* black */
tt_metrics->compensations[2] = 0; /* white */
! tt_metrics->compensations[3] = 0; /* reserved */
}
/* allocate function defs, instruction defs, cvt, and storage area */
if ( FT_NEW_ARRAY( size->function_defs, size->max_function_defs ) ||
FT_NEW_ARRAY( size->instruction_defs, size->max_instruction_defs ) ||
--- 1107,1127 ----
tt_metrics->rotated = FALSE;
tt_metrics->stretched = FALSE;
! /* Set default engine compensation. Value 3 is not described */
! /* in the OpenType specification (as of Mai 2019), but Greg */
! /* says that MS handles it the same as `gray'. */
! /* */
! /* The Apple specification says that the compensation for */
! /* `gray' is always zero. FreeType doesn't do any */
! /* compensation at all. */
tt_metrics->compensations[0] = 0; /* gray */
tt_metrics->compensations[1] = 0; /* black */
tt_metrics->compensations[2] = 0; /* white */
! tt_metrics->compensations[3] = 0; /* the same as gray */
}
/* allocate function defs, instruction defs, cvt, and storage area */
if ( FT_NEW_ARRAY( size->function_defs, size->max_function_defs ) ||
FT_NEW_ARRAY( size->instruction_defs, size->max_instruction_defs ) ||
*** 1169,1191 ****
/* rescale CVT when needed */
if ( size->cvt_ready < 0 )
{
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;
--- 1190,1200 ----
< prev index next >