* src/gxlayout/gxdemo.c (set_trace_level): Move loca variation

defs inside FT_DEBUG_LEVEL_TRACE ifdef block.

* src/pcf/pcfdrivr.c (FT_Stream_OpenLZW): Add dummy
implementation. This should be removed when FTLAYOUT is
merged to the main trunk.

* src/gxlayout/*.[ch]: Remove all [gcaf]var realted codes.
gx variation are supported in the main trunk now.
This commit is contained in:
Yamato, Masatake (大和正武) 2004-05-03 04:51:06 +00:00
parent df292276d4
commit 77c95c64de
9 changed files with 31 additions and 370 deletions

View File

@ -1,3 +1,15 @@
2004-05-03 Masatake YAMATO <jet@gyve.org>
* src/gxlayout/gxdemo.c (set_trace_level): Move loca variation
defs inside FT_DEBUG_LEVEL_TRACE ifdef block.
* src/pcf/pcfdrivr.c (FT_Stream_OpenLZW): Add dummy
implementation. This should be removed when FTLAYOUT is
merged to the main trunk.
* src/gxlayout/*.[ch]: Remove all [gcaf]var realted codes.
gx variation are supported in the main trunk now.
2004-03-04 Werner Lemberg <wl@gnu.org>
* Jamfile, vms_make.com, builds/win32/visualc/freetype.dsp,

View File

@ -89,7 +89,7 @@ void render_glyph ( GtkWidget * button, gpointer request );
void set_trace_level( GtkAdjustment * adj, gpointer trace );
#define DUMP_DESC "Supported tables are mort,morx,feat,prop,trak,kern,just,lcar,opbd,bsln,fmtx,fdsc,fvar"
#define DUMP_DESC "Supported tables are mort,morx,feat,prop,trak,kern,just,lcar,opbd,bsln,fmtx,fdsc"
static const GDebugKey dump_keys[] = {
{"mort", GX_DUMP_mort},
{"morx", GX_DUMP_morx},
@ -103,7 +103,6 @@ static const GDebugKey dump_keys[] = {
{"bsln", GX_DUMP_bsln},
{"fmtx", GX_DUMP_fmtx},
{"fdsc", GX_DUMP_fdsc},
{"fvar", GX_DUMP_fvar}
};
int
@ -645,7 +644,6 @@ create_dump_area( GX_Face face,
MAKE_CHECK_BUTTON(bsln);
MAKE_CHECK_BUTTON(fmtx);
MAKE_CHECK_BUTTON(fdsc);
MAKE_CHECK_BUTTON(fvar);
button = gtk_button_new_with_label("Dump Font Tables");
g_signal_connect (G_OBJECT (button), "clicked",
@ -1206,9 +1204,9 @@ render_glyph ( GtkWidget * button, gpointer request )
void
set_trace_level( GtkAdjustment * adj, gpointer trace )
{
#ifdef FT_DEBUG_LEVEL_TRACE
gint index = GPOINTER_TO_INT(trace);
gint level = (gint)gtk_adjustment_get_value(adj);
#ifdef FT_DEBUG_LEVEL_TRACE
ft_trace_levels[index] = level;
#endif /* FT_DEBUG_LEVEL_TRACE */
}

View File

@ -221,7 +221,6 @@ void gx_face_dump_fdsc(GX_Face face, GX_Fdsc fdsc);
void gx_face_dump_morx(GX_Face face, GX_Morx morx);
void gx_face_dump_just(GX_Face face, GX_Just just);
void gx_face_dump_kern(GX_Face face, GX_Kern kern);
void gx_face_dump_fvar(GX_Face face, GX_Fvar fvar);
static FT_Error generic_dump_lookup_table_generic ( GX_LookupTable_Format format,
GX_LookupValue value,
@ -305,7 +304,6 @@ gx_face_dump( FT_Face face, FT_ULong tables, const char * fname )
COUNT(bsln);
COUNT(fmtx);
COUNT(fdsc);
COUNT(fvar);
POPEN2(t,gxdump,name,fname,%s,count,count,%d);
DUMP(mort);
DUMP(morx);
@ -319,7 +317,6 @@ gx_face_dump( FT_Face face, FT_ULong tables, const char * fname )
DUMP(bsln);
DUMP(fmtx);
DUMP(fdsc);
DUMP(fvar);
PCLOSE(t,gxdump);
return FT_Err_Ok;
}
@ -2204,143 +2201,6 @@ gx_face_dump_kern(GX_Face face, GX_Kern kern)
PCLOSE(t, subtables);
}
/******************************FVAR************************************/
static void
gx_face_dump_fvar_sfnt_variation_axis( GX_Face face,
GX_FontVariationsSFNTVariationAxis axis,
int t);
static void
gx_face_dump_fvar_sfnt_instance( GX_Face face,
FT_UShort axis_count,
GX_FontVariationsSFNTInstance instance,
int t);
void
gx_face_dump_fvar(GX_Face face, GX_Fvar fvar)
{
int i, t = 2;
PFIELD(t, fvar, version, 0x%08lx);
PFIELD(t, fvar, offsetToData, %u);
PFIELD(t, fvar, countSizePairs, %u);
PFIELD(t, fvar, axisCount, %u);
PFIELD(t, fvar, axisSize, %u);
PFIELD(t, fvar, instanceCount, %u);
PFIELD(t, fvar, instanceSize, %u);
for ( i = 0; i < fvar->axisCount; i++ )
{
POPEN1(t, axis, index, i, %d);
gx_face_dump_fvar_sfnt_variation_axis(face,
&fvar->axis[i],
t);
PCLOSE(t, axis);
}
for ( i = 0; i < fvar->instanceCount; i++ )
{
POPEN1(t, instance, index, i, %d);
gx_face_dump_fvar_sfnt_instance(face,
fvar->axisCount,
&fvar->instance[i],
t);
PCLOSE(t, instance);
}
}
static void
gx_face_dump_fvar_sfnt_variation_axis( GX_Face face,
GX_FontVariationsSFNTVariationAxis axis,
int t)
{
FT_Error error;
FT_Memory memory = face->root.driver->root.memory;
FT_SfntName sfnt_name;
FT_String * string;
int j;
PTAG(t, axisTag, axis->axisTag);
PFIELD(t, axis, minValue, %ld);
PFIELD(t, axis, defaultValue, %ld);
PFIELD(t, axis, maxValue, %ld);
PFIELD(t, axis, flags, %u);
if (( error = gx_get_name_from_id((FT_Face)face,
axis->nameID,
0, 0, 0,
&sfnt_name) ))
PFIELD(t, axis, nameID, %u);
else
{
if ( FT_NEW_ARRAY(string, sfnt_name.string_len + 1) )
goto NameFailure;
string[sfnt_name.string_len] = '\0';
for ( j = 0; j < sfnt_name.string_len; j++)
{
/* Don't use '&' in pseudo XML file.
Here I replace '&' with '|'. */
if ( sfnt_name.string[j] == '&' )
string[j] = '|' ;
else
string[j] = sfnt_name.string[j];
}
PFIELD1(t,axis,nameID,%u,name,string,%s);
FT_FREE(string);
}
return;
NameFailure:
exit(1);
}
static void
gx_face_dump_fvar_sfnt_instance( GX_Face face,
FT_UShort axis_count,
GX_FontVariationsSFNTInstance instance,
int t)
{
FT_Error error;
int i;
FT_Memory memory = face->root.driver->root.memory;
FT_SfntName sfnt_name;
FT_String * string;
int j;
if (( error = gx_get_name_from_id((FT_Face)face,
instance->nameID,
0, 0, 0, &sfnt_name) ))
PFIELD(t, instance, nameID, %u);
else
{
if ( FT_NEW_ARRAY(string, sfnt_name.string_len + 1) )
goto NameFailure;
string[sfnt_name.string_len] = '\0';
for ( j = 0; j < sfnt_name.string_len; j++)
{
/* Don't use '&' in pseudo XML file.
Here I replace '&' with '|'. */
if ( sfnt_name.string[j] == '&' )
string[j] = '|' ;
else
string[j] = sfnt_name.string[j];
}
PFIELD1(t,instance,nameID,%u,name,string,%s);
FT_FREE(string);
}
PFIELD(t, instance, flags, %u);
POPEN (t, coord);
for ( i = 0; i < axis_count; i++ )
{
NEWLINE10(t, i);
fprintf(stdout, "%ld[%d] ", instance->coord[i], i);
}
NEWLINE();
PCLOSE(t, coord);
return ;
NameFailure:
exit(error);
}
/****************************State***********************************/
static void

View File

@ -42,7 +42,6 @@ FT_BEGIN_HEADER
GX_DUMP_bsln = 1 << 9,
GX_DUMP_fmtx = 1 << 10,
GX_DUMP_fdsc = 1 << 11,
GX_DUMP_fvar = 1 << 12,
GX_DUMP_ALL = 0x7FFFFFFFUL /* gcc warns if I set this to 0xFFFFFFFFUL. */
} GXDumpFlag;

View File

@ -87,10 +87,6 @@
gx_just_done( GX_Just just,
FT_Memory memory );
static void
gx_fvar_done( GX_Fvar fvar,
FT_Memory memory );
#define GENERIC_LOOKUP_TABLE_CB_DATA_ZERO {NULL, NULL, NULL, 0, NULL}
typedef struct generic_lookup_table_cb_data_rec_
{
@ -3953,158 +3949,6 @@ static void gx_morx_free_subtable( FT_Memory memory, GX_XMetamorphosisSubtable c
kern->subtables = NULL;
}
/****************************FVAR***********************************/
static FT_Error gx_fvar_load_sfnt_instance ( GX_Face face, FT_Stream stream,
FT_UShort axis_count,
GX_FontVariationsSFNTInstance instance );
static void gx_fvar_free_sfnt_instance ( FT_Memory memory,
GX_FontVariationsSFNTInstance instance );
FT_LOCAL ( FT_Error )
gx_face_load_fvar ( GX_Face face,
FT_Stream stream,
GX_Fvar fvar )
{
FT_Error error;
FT_UShort i, j;
FT_Memory memory = stream->memory;
static const FT_Frame_Field fvar_fields[] =
{
#undef FT_STRUCTURE
#define FT_STRUCTURE GX_FvarRec
FT_FRAME_START ( 14 ),
FT_FRAME_LONG ( version ),
FT_FRAME_USHORT ( offsetToData ),
FT_FRAME_USHORT ( countSizePairs ),
FT_FRAME_USHORT ( axisCount ),
FT_FRAME_USHORT ( axisSize ),
FT_FRAME_USHORT ( instanceCount ),
FT_FRAME_USHORT ( instanceSize ),
FT_FRAME_END
};
static const FT_Frame_Field fvar_axis_fields[] =
{
#undef FT_STRUCTURE
#define FT_STRUCTURE GX_FontVariationsSFNTVariationAxisRec
FT_FRAME_START ( 20 ),
FT_FRAME_ULONG ( axisTag ),
FT_FRAME_LONG ( minValue ),
FT_FRAME_LONG ( defaultValue ),
FT_FRAME_LONG ( maxValue ),
FT_FRAME_USHORT( flags ),
FT_FRAME_USHORT( nameID ),
FT_FRAME_END
};
if (( error = gx_table_init( &(fvar->root), face, TTAG_fvar, stream,
(GX_Table_Done_Func)gx_fvar_done) ))
goto Failure;
if ( FT_STREAM_READ_FIELDS( fvar_fields, fvar ) )
goto Failure;
if ( FT_STREAM_SEEK( fvar->root.position + fvar->offsetToData ) )
goto Failure;
if ( FT_NEW_ARRAY( fvar->axis, fvar->axisCount ) )
goto Failure;
if ( FT_NEW_ARRAY( fvar->instance, fvar->instanceCount ) )
goto Failure;
for ( i = 0; i < fvar->axisCount; i++ )
{
if ( FT_STREAM_READ_FIELDS( fvar_axis_fields, &fvar->axis[i] ) )
goto Failure;
}
for ( i = 0; i < fvar->instanceCount; i++ )
{
if (( error = gx_fvar_load_sfnt_instance( face,
stream,
fvar->axisCount,
&fvar->instance[i]) ))
{
for ( j = i; j > 0; j-- )
gx_fvar_free_sfnt_instance( memory,
&fvar->instance[j - 1] );
goto Failure;
}
}
return error;
Failure:
if ( fvar->axis )
FT_FREE( fvar->axis );
if ( fvar->instanceCount )
FT_FREE ( fvar->instance );
return error;
}
static FT_Error
gx_fvar_load_sfnt_instance ( GX_Face face,
FT_Stream stream,
FT_UShort axis_count,
GX_FontVariationsSFNTInstance instance )
{
FT_Error error;
FT_UShort i;
FT_Memory memory = stream->memory;
static const FT_Frame_Field fvar_sfnt_instance_fields[] =
{
#undef FT_STRUCTURE
#define FT_STRUCTURE GX_FontVariationsSFNTInstanceRec
FT_FRAME_START ( 4 ),
FT_FRAME_USHORT ( nameID ),
FT_FRAME_USHORT ( flags ),
FT_FRAME_END,
};
if (( FT_NEW_ARRAY( instance->coord, axis_count ) ))
goto Failure;
if ( FT_STREAM_READ_FIELDS( fvar_sfnt_instance_fields,
instance ) )
goto Failure;
if ( FT_FRAME_ENTER ( axis_count * sizeof( FT_Fixed) ) )
goto Failure;
for ( i = 0; i < axis_count; i++ )
instance->coord[i] = FT_GET_LONG();
FT_FRAME_EXIT();
return error;
Failure:
if ( instance->coord )
FT_FREE( instance->coord );
return error;
}
static void
gx_fvar_free_sfnt_instance ( FT_Memory memory,
GX_FontVariationsSFNTInstance instance )
{
FT_FREE( instance->coord );
}
static void
gx_fvar_done( GX_Fvar fvar,
FT_Memory memory )
{
FT_UShort i;
for ( i = fvar->instanceCount; i > 0; i-- )
gx_fvar_free_sfnt_instance(memory, &fvar->instance[i - 1] );
FT_FREE ( fvar->instance );
FT_FREE ( fvar->axis );
}
/****************************GENERIC***********************************/
static FT_Error

View File

@ -99,11 +99,6 @@ FT_BEGIN_HEADER
FT_Stream stream,
GX_Just just );
FT_LOCAL ( FT_Error )
gx_face_load_fvar ( GX_Face face,
FT_Stream stream,
GX_Fvar fvar );
FT_END_HEADER
#endif /* Not def: __GXLOAD_H__ */

View File

@ -215,8 +215,6 @@
NEW_TABLE(fdsc);
NEW_TABLE(just);
NEW_TABLE(fvar);
error = FT_Err_Unknown_File_Format;
if ((( font->mort ) || ( font->morx ))
@ -277,8 +275,7 @@
DONE_TABLE(fmtx);
DONE_TABLE(fdsc);
DONE_TABLE(just);
DONE_TABLE(fvar);
FTL_Font_Finalize((FTL_Font)font);
FT_FREE(object);
}

View File

@ -1148,65 +1148,6 @@ typedef struct GX_LigCaretSegmentRec_ *GX_LigCaretSegment;
GX_KerningSubtable subtables;
} GX_KernRec, *GX_Kern;
/***************************************************************************/
/* CVAR */
/***************************************************************************/
typedef struct GX_GvarRec_
{
GX_TableRec root;
FT_Fixed version;
FT_UShort axisCount;
FT_UShort globalCoordCount;
FT_ULong offsetToCoord;
FT_UShort glyphCount;
FT_UShort flags;
FT_ULong offsetToData;
union {
FT_UShort * u16;
FT_ULong * u32;
} offset;
/* TODO */
} GX_GvarRec, *GX_Gvar;
/***************************************************************************/
/* GVAR */
/***************************************************************************/
/* TODO */
/***************************************************************************/
/* FVAR */
/***************************************************************************/
typedef struct GX_FontVariationsSFNTVariationAxisRec_
{
FT_ULong axisTag;
FT_Fixed minValue;
FT_Fixed defaultValue;
FT_Fixed maxValue;
FT_UShort flags;
FT_UShort nameID;
} GX_FontVariationsSFNTVariationAxisRec, * GX_FontVariationsSFNTVariationAxis;
typedef struct GX_FontVariationsSFNTInstanceRec_
{
FT_UShort nameID;
FT_UShort flags;
FT_Fixed * coord; /* GX_FvarRec::axisCount */
} GX_FontVariationsSFNTInstanceRec, *GX_FontVariationsSFNTInstance;
typedef struct GX_FvarRec_
{
GX_TableRec root;
FT_Fixed version;
FT_UShort offsetToData;
FT_UShort countSizePairs;
FT_UShort axisCount ;
FT_UShort axisSize ;
FT_UShort instanceCount ;
FT_UShort instanceSize ;
GX_FontVariationsSFNTVariationAxis axis; /* axisCount */
GX_FontVariationsSFNTInstance instance; /* instanceCount */
} GX_FvarRec, *GX_Fvar;
/***************************************************************************/
/* Generic */
/***************************************************************************/
@ -1226,7 +1167,6 @@ typedef struct GX_LigCaretSegmentRec_ *GX_LigCaretSegment;
GX_Fmtx fmtx;
GX_Fdsc fdsc;
GX_Just just;
GX_Fvar fvar;
} GXL_FontRec; /* *GX_Font; */

View File

@ -225,6 +225,22 @@ THE SOFTWARE.
return PCF_Err_Ok;
}
/* FTLAYOUT ONLY: This stub is used only for building FTLAYOUT.
FTLAYOUT branch of FreeType CVS doesn't include lzw directory
(because of probable mistake?).
Undefine FT_CONFIG_OPTION_USE_LZW is not enough to avoid this
issue.
Remove this stub when FTLAYOUT is merged to the main trunk.
-- Masatake */
static FT_Error
FT_Stream_OpenLZW( FT_Stream stream,
FT_Stream source )
{
FT_UNUSED( stream );
FT_UNUSED( source );
return FT_Err_Unimplemented_Feature;
}
FT_CALLBACK_DEF( FT_Error )
PCF_Face_Init( FT_Stream stream,