Remove the dependence on outlines. No longer needed.

This commit is contained in:
Moazin Khatti 2019-08-07 14:21:09 +05:00
parent dbcc809e7c
commit a227395912
3 changed files with 5 additions and 20 deletions

View File

@ -241,11 +241,11 @@ FT_BEGIN_HEADER
* *
* @description: * @description:
* A structure used for SVG glyph images. This really is a 'sub-class' * A structure used for SVG glyph images. This really is a 'sub-class'
* of @FT_OutlineGlyphRec. * of @FT_GlyphRec.
* *
* @fields: * @fields:
* root :: * root ::
* The root @FT_OutlineGlyphRec fields. * The root @FT_GlyphRec fields.
* *
* svg_document :: * svg_document ::
* A pointer to the SVG document. * A pointer to the SVG document.
@ -281,7 +281,7 @@ FT_BEGIN_HEADER
*/ */
typedef struct FT_SvgGlyphRec_ typedef struct FT_SvgGlyphRec_
{ {
FT_OutlineGlyphRec root; FT_GlyphRec root;
FT_Byte* svg_document; FT_Byte* svg_document;
FT_ULong svg_document_length; FT_ULong svg_document_length;
FT_UInt glyph_index; FT_UInt glyph_index;

View File

@ -317,11 +317,6 @@
goto Exit; goto Exit;
} }
/* init the parent first */
slot->format = FT_GLYPH_FORMAT_OUTLINE;
ft_outline_glyph_class.glyph_init( svg_glyph, slot );
slot->format = FT_GLYPH_FORMAT_SVG;
/* allocate a new document */ /* allocate a new document */
doc_length = document->svg_document_length; doc_length = document->svg_document_length;
glyph->svg_document = memory->alloc( memory, doc_length ); glyph->svg_document = memory->alloc( memory, doc_length );
@ -331,7 +326,6 @@
glyph->units_per_EM = document->units_per_EM; glyph->units_per_EM = document->units_per_EM;
glyph->start_glyph_id = document->start_glyph_id; glyph->start_glyph_id = document->start_glyph_id;
glyph->end_glyph_id = document->end_glyph_id; glyph->end_glyph_id = document->end_glyph_id;
/* copy the document into glyph */ /* copy the document into glyph */
FT_MEM_COPY( glyph->svg_document, document->svg_document, doc_length ); FT_MEM_COPY( glyph->svg_document, document->svg_document, doc_length );
@ -346,9 +340,6 @@
FT_SvgGlyph glyph = (FT_SvgGlyph)svg_glyph; FT_SvgGlyph glyph = (FT_SvgGlyph)svg_glyph;
FT_Memory memory = svg_glyph->library->memory; FT_Memory memory = svg_glyph->library->memory;
/* free the parent first */
ft_outline_glyph_class.glyph_done( svg_glyph );
/* just free the memory */ /* just free the memory */
memory->free( memory, glyph->svg_document ); memory->free( memory, glyph->svg_document );
} }
@ -374,8 +365,6 @@
return error; return error;
} }
/* copy the parent first */
ft_outline_glyph_class.glyph_copy( svg_source, svg_target );
target->glyph_index = source->glyph_index; target->glyph_index = source->glyph_index;
target->svg_document_length = source->svg_document_length; target->svg_document_length = source->svg_document_length;
@ -410,10 +399,6 @@
if ( FT_NEW( document ) ) if ( FT_NEW( document ) )
return error; return error;
/* call the parent and prepare it */
ft_outline_glyph_class.glyph_prepare( svg_glyph, slot );
slot->format = FT_GLYPH_FORMAT_SVG;
document->svg_document = glyph->svg_document; document->svg_document = glyph->svg_document;
document->svg_document_length = glyph->svg_document_length; document->svg_document_length = glyph->svg_document_length;
document->metrics = glyph->metrics; document->metrics = glyph->metrics;
@ -508,7 +493,6 @@
if ( error ) if ( error )
goto Exit; goto Exit;
copy->advance = source->advance;
copy->format = source->format; copy->format = source->format;
if ( clazz->glyph_copy ) if ( clazz->glyph_copy )

View File

@ -382,10 +382,11 @@
module = FT_Get_Module(slot->library, "ot-svg" ); module = FT_Get_Module(slot->library, "ot-svg" );
SVG_Service svg_service = module->clazz->module_interface; SVG_Service svg_service = module->clazz->module_interface;
svg_service->preset_slot( module, slot, FALSE ); return svg_service->preset_slot( module, slot, FALSE );
} }
else else
return 1; return 1;
return 1;
} }
if ( origin ) if ( origin )