forked from minhngoc25a/freetype2
Better naming used.
This commit is contained in:
parent
bf1deae970
commit
c6a6859ad9
|
@ -550,14 +550,14 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_SVG_RENDERER_H
|
||||
* FT_SVG_RENDER_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in `#include` statements to name the file containing the
|
||||
* API of the SVG Renderer Module.
|
||||
*
|
||||
*/
|
||||
#define FT_SVG_RENDERER_H <freetype/svgrenderer.h>
|
||||
#define FT_SVG_RENDER_H <freetype/svgrender.h>
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
|
|
|
@ -33,7 +33,7 @@ FT_BEGIN_HEADER
|
|||
/**************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* SVG_Lib_Init
|
||||
* SVG_Lib_Init_Func
|
||||
*
|
||||
* @description:
|
||||
* A callback used to initiate the SVG Rendering port
|
||||
|
@ -49,13 +49,13 @@ FT_BEGIN_HEADER
|
|||
*/
|
||||
|
||||
typedef FT_Error
|
||||
(*SVG_Lib_Init)( FT_Library library );
|
||||
(*SVG_Lib_Init_Func)( FT_Library library );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* SVG_Lib_Free
|
||||
* SVG_Lib_Free_Func
|
||||
*
|
||||
* @description:
|
||||
* A callback used to free the SVG Rendering port. Calling this callback
|
||||
|
@ -68,13 +68,13 @@ FT_BEGIN_HEADER
|
|||
*/
|
||||
|
||||
typedef void
|
||||
(*SVG_Lib_Free)( FT_Library library );
|
||||
(*SVG_Lib_Free_Func)( FT_Library library );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* SVG_Lib_Render
|
||||
* SVG_Lib_Render_Func
|
||||
*
|
||||
* @description:
|
||||
* A callback used to render the glyph loaded in the slot.
|
||||
|
@ -92,17 +92,18 @@ FT_BEGIN_HEADER
|
|||
*/
|
||||
|
||||
typedef FT_Error
|
||||
(*SVG_Lib_Render)( FT_GlyphSlot slot,
|
||||
FT_BBox outline_bbox);
|
||||
(*SVG_Lib_Render_Func)( FT_GlyphSlot slot,
|
||||
FT_BBox outline_bbox);
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* SVG_Lib_Get_Buffer_Size
|
||||
* SVG_Lib_Get_Buffer_Size_Func
|
||||
*
|
||||
* @description:
|
||||
* A callback which is called to get the size of the image buffer needed.
|
||||
* This buffer will ultimately be populated by `SVG_Lib_Render' hook.
|
||||
* This buffer will ultimately be populated by `SVG_Lib_Render_Func'
|
||||
* hook.
|
||||
*
|
||||
* @input:
|
||||
* slot ::
|
||||
|
@ -119,14 +120,14 @@ FT_BEGIN_HEADER
|
|||
*/
|
||||
|
||||
typedef FT_ULong
|
||||
(*SVG_Lib_Get_Buffer_Size)( FT_GlyphSlot slot,
|
||||
FT_BBox bbox );
|
||||
(*SVG_Lib_Get_Buffer_Size_Func)( FT_GlyphSlot slot,
|
||||
FT_BBox bbox );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* SVG_Set_Hooks
|
||||
* SVG_Set_Hooks_Func
|
||||
*
|
||||
* @description:
|
||||
* A function that is used set SVG Hooks. Part of the SVG Renderer
|
||||
|
@ -136,32 +137,32 @@ FT_BEGIN_HEADER
|
|||
* module ::
|
||||
* FT_Module instance.
|
||||
*
|
||||
* init_hook ::
|
||||
* A function pointer of the type `SVG_Lib_Init'. Read the documentation
|
||||
* of `SVG_Lib_Init'
|
||||
* init_svg ::
|
||||
* A function pointer of the type `SVG_Lib_Init_Func'. Read the
|
||||
* documentation of `SVG_Lib_Init_Func'
|
||||
*
|
||||
* free_hook ::
|
||||
* A function pointer of the type `SVG_Lib_Free'. Read the documentation
|
||||
* of `SVG_Lib_Free'.
|
||||
* free_svg ::
|
||||
* A function pointer of the type `SVG_Lib_Free_Func'. Read the
|
||||
* documentation of `SVG_Lib_Free_Func'.
|
||||
*
|
||||
* render_hook ::
|
||||
* A function pointer of the type `SVG_Lib_Render'. Read the
|
||||
* documentation of `SVG_Lib_Render'.
|
||||
* render_svg ::
|
||||
* A function pointer of the type `SVG_Lib_Render_Func'. Read the
|
||||
* documentation of `SVG_Lib_Render_Func'.
|
||||
*
|
||||
* get_buffer_size ::
|
||||
* A function pointer of the type `SVG_Lib_Get_Buffer_Size'. Read the
|
||||
* documentation of `SVG_Lib_Get_Buffer_Size'.
|
||||
* A function pointer of the type `SVG_Lib_Get_Buffer_Size_Func'. Read
|
||||
* the documentation of `SVG_Lib_Get_Buffer_Size_Func'.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0 means success.
|
||||
*/
|
||||
|
||||
typedef FT_Error
|
||||
(*SVG_Set_Hooks)( FT_Module module,
|
||||
SVG_Lib_Init init_hook,
|
||||
SVG_Lib_Free free_hook,
|
||||
SVG_Lib_Render render_hook,
|
||||
SVG_Lib_Get_Buffer_Size get_buffer_size );
|
||||
(*SVG_Set_Hooks_Func)( FT_Module module,
|
||||
SVG_Lib_Init_Func init_svg,
|
||||
SVG_Lib_Free_Func free_svg,
|
||||
SVG_Lib_Render_Func render_svg,
|
||||
SVG_Lib_Get_Buffer_Size_Func get_buffer_size );
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
|
@ -182,17 +183,17 @@ FT_BEGIN_HEADER
|
|||
|
||||
typedef struct SVG_Renderer_Interface_
|
||||
{
|
||||
SVG_Set_Hooks set_hooks;
|
||||
SVG_Set_Hooks_Func set_hooks;
|
||||
} SVG_Renderer_Interface;
|
||||
|
||||
|
||||
/* TODO: to document */
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Set_Svg_Hooks( FT_Library library,
|
||||
SVG_Lib_Init init_hook,
|
||||
SVG_Lib_Free free_hook,
|
||||
SVG_Lib_Render render_hook,
|
||||
SVG_Lib_Get_Buffer_Size get_buffer_size );
|
||||
FT_Set_Svg_Hooks( FT_Library library,
|
||||
SVG_Lib_Init_Func init_svg,
|
||||
SVG_Lib_Free_Func free_svg,
|
||||
SVG_Lib_Render_Func render_svg,
|
||||
SVG_Lib_Get_Buffer_Size_Func get_buffer_size );
|
||||
|
||||
/**************************************************************************
|
||||
*
|
|
@ -35,7 +35,7 @@
|
|||
#include FT_OUTLINE_H
|
||||
#include FT_BITMAP_H
|
||||
#include FT_INTERNAL_OBJECTS_H
|
||||
#include FT_SVG_RENDERER_H
|
||||
#include FT_SVG_RENDER_H
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
#include FT_SERVICE_TT_CMAP_H
|
||||
#include FT_SERVICE_KERNING_H
|
||||
#include FT_SERVICE_TRUETYPE_ENGINE_H
|
||||
#include FT_SVG_RENDERER_H
|
||||
#include FT_SVG_RENDER_H
|
||||
|
||||
#include FT_DRIVER_H
|
||||
|
||||
|
@ -5593,11 +5593,11 @@
|
|||
}
|
||||
|
||||
FT_EXPORT_DEF( FT_Error )
|
||||
FT_Set_Svg_Hooks( FT_Library library,
|
||||
SVG_Lib_Init init_hook,
|
||||
SVG_Lib_Free free_hook,
|
||||
SVG_Lib_Render render_hook,
|
||||
SVG_Lib_Get_Buffer_Size get_buffer_size )
|
||||
FT_Set_Svg_Hooks( FT_Library library,
|
||||
SVG_Lib_Init_Func init_svg,
|
||||
SVG_Lib_Free_Func free_svg,
|
||||
SVG_Lib_Render_Func render_svg,
|
||||
SVG_Lib_Get_Buffer_Size_Func get_buffer_size )
|
||||
{
|
||||
FT_Module renderer;
|
||||
SVG_Renderer_Interface *svg;
|
||||
|
@ -5611,9 +5611,9 @@
|
|||
|
||||
svg = (SVG_Renderer_Interface*)renderer->clazz->module_interface;
|
||||
svg->set_hooks(renderer,
|
||||
init_hook,
|
||||
free_hook,
|
||||
render_hook,
|
||||
init_svg,
|
||||
free_svg,
|
||||
render_svg,
|
||||
get_buffer_size );
|
||||
return FT_Err_Ok;
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#include FT_INTERNAL_OBJECTS_H
|
||||
#include FT_TRUETYPE_TAGS_H
|
||||
#include FT_GZIP_H
|
||||
#include FT_SVG_RENDERER_H
|
||||
#include FT_SVG_RENDER_H
|
||||
|
||||
|
||||
#include "ttsvg.h"
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
*/
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_SVG_RENDERER_H
|
||||
#include FT_SVG_RENDER_H
|
||||
#include FT_BBOX_H
|
||||
|
||||
#include <stdio.h>
|
||||
|
@ -37,7 +37,7 @@
|
|||
{
|
||||
FT_Library library = svg_module->root.root.library;
|
||||
if ( svg_module->loaded == TRUE )
|
||||
svg_module->hooks.svg_lib_free( library );
|
||||
svg_module->hooks.free_svg( library );
|
||||
svg_module->loaded = FALSE;
|
||||
}
|
||||
|
||||
|
@ -59,7 +59,7 @@
|
|||
|
||||
if ( svg_renderer->loaded == FALSE )
|
||||
{
|
||||
error = hooks.svg_lib_init( library );
|
||||
error = hooks.init_svg( library );
|
||||
svg_renderer->loaded = TRUE;
|
||||
}
|
||||
|
||||
|
@ -68,30 +68,30 @@
|
|||
if( error != FT_Err_Ok )
|
||||
return error;
|
||||
|
||||
size_image_buffer = hooks.svg_lib_get_buffer_size( slot, outline_bbox );
|
||||
size_image_buffer = hooks.get_buffer_size( slot, outline_bbox );
|
||||
|
||||
FT_MEM_ALLOC( slot->bitmap.buffer, size_image_buffer );
|
||||
if ( error )
|
||||
return error;
|
||||
|
||||
return hooks.svg_lib_render( slot, outline_bbox );
|
||||
return hooks.render_svg( slot, outline_bbox );
|
||||
}
|
||||
|
||||
static FT_Error
|
||||
ft_svg_set_hooks( FT_Module module,
|
||||
SVG_Lib_Init init_hook,
|
||||
SVG_Lib_Free free_hook,
|
||||
SVG_Lib_Render render_hook,
|
||||
SVG_Lib_Get_Buffer_Size get_buffer_size )
|
||||
ft_svg_set_hooks( FT_Module module,
|
||||
SVG_Lib_Init_Func init_svg,
|
||||
SVG_Lib_Free_Func free_svg,
|
||||
SVG_Lib_Render_Func render_svg,
|
||||
SVG_Lib_Get_Buffer_Size_Func get_buffer_size )
|
||||
{
|
||||
SVG_Renderer renderer;
|
||||
|
||||
renderer = (SVG_Renderer)module;
|
||||
renderer->hooks.svg_lib_init = init_hook;
|
||||
renderer->hooks.svg_lib_free = free_hook;
|
||||
renderer->hooks.svg_lib_render = render_hook;
|
||||
renderer->hooks.init_svg = init_svg;
|
||||
renderer->hooks.free_svg = free_svg;
|
||||
renderer->hooks.render_svg = render_svg;
|
||||
|
||||
renderer->hooks.svg_lib_get_buffer_size = get_buffer_size;
|
||||
renderer->hooks.get_buffer_size = get_buffer_size;
|
||||
|
||||
return FT_Err_Ok;
|
||||
}
|
||||
|
@ -99,7 +99,7 @@
|
|||
|
||||
static const SVG_Renderer_Interface svg_renderer_interface =
|
||||
{
|
||||
(SVG_Set_Hooks)ft_svg_set_hooks
|
||||
(SVG_Set_Hooks_Func)ft_svg_set_hooks
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -19,16 +19,16 @@
|
|||
#include <ft2build.h>
|
||||
#include FT_INTERNAL_OBJECTS_H
|
||||
#include FT_RENDER_H
|
||||
#include FT_SVG_RENDERER_H
|
||||
#include FT_SVG_RENDER_H
|
||||
|
||||
typedef struct SVG_RendererHooks_
|
||||
{
|
||||
/* Api Hooks for OT-SVG Rendering */
|
||||
SVG_Lib_Init svg_lib_init;
|
||||
SVG_Lib_Free svg_lib_free;
|
||||
SVG_Lib_Render svg_lib_render;
|
||||
SVG_Lib_Init_Func init_svg;
|
||||
SVG_Lib_Free_Func free_svg;
|
||||
SVG_Lib_Render_Func render_svg;
|
||||
|
||||
SVG_Lib_Get_Buffer_Size svg_lib_get_buffer_size;
|
||||
SVG_Lib_Get_Buffer_Size_Func get_buffer_size;
|
||||
} SVG_RendererHooks;
|
||||
|
||||
typedef struct SVG_RendererRec_
|
||||
|
|
Loading…
Reference in New Issue