[truetype] Add framework for TrueType properties.

* src/truetype/ttdrivr.c: Include FT_SERVICE_PROPERTIES_H.
(tt_property_set, tt_property_get): New functions, still empty.
Define `tt_service_properties' service.
Update `tt_services'.

* src/truetype/ttpic.h: Include FT_SERVICE_PROPERTIES_H.
(TT_SERVICE_PROPERTIES_GET): New macro.
(TTModulePIC): Add `tt_service_properties'.
This commit is contained in:
Werner Lemberg 2013-05-12 15:08:57 +02:00
parent b112fa4190
commit cd888753c8
3 changed files with 70 additions and 11 deletions

View File

@ -1,3 +1,16 @@
2013-05-12 Werner Lemberg <wl@gnu.org>
[truetype] Add framework for TrueType properties.
* src/truetype/ttdrivr.c: Include FT_SERVICE_PROPERTIES_H.
(tt_property_set, tt_property_get): New functions, still empty.
Define `tt_service_properties' service.
Update `tt_services'.
* src/truetype/ttpic.h: Include FT_SERVICE_PROPERTIES_H.
(TT_SERVICE_PROPERTIES_GET): New macro.
(TTModulePIC): Add `tt_service_properties'.
2013-05-12 Werner Lemberg <wl@gnu.org> 2013-05-12 Werner Lemberg <wl@gnu.org>
Fix Savannah bug #38967. Fix Savannah bug #38967.
@ -289,13 +302,13 @@
New macro. New macro.
* src/cff/cffdrivr.c: Include FT_SERVICE_PROPERTIES_H. * src/cff/cffdrivr.c: Include FT_SERVICE_PROPERTIES_H.
(cff_property_set, cff_property_get): New function, still empty. (cff_property_set, cff_property_get): New functions, still empty.
Define `cff_service_properties' service. Define `cff_service_properties' service.
Update `cff_services'. Update `cff_services'.
* src/cff/cffpic.h: Include FT_SERVICE_PROPERTIES_H. * src/cff/cffpic.h: Include FT_SERVICE_PROPERTIES_H.
(CFF_SERVICE_PROPERTIES_GET): New macro. (CFF_SERVICE_PROPERTIES_GET): New macro.
CffModulePIC: Add `cff_service_properties'. (CffModulePIC): Add `cff_service_properties'.
2013-04-03 Werner Lemberg <wl@gnu.org> 2013-04-03 Werner Lemberg <wl@gnu.org>

View File

@ -29,6 +29,7 @@
#include FT_SERVICE_TRUETYPE_ENGINE_H #include FT_SERVICE_TRUETYPE_ENGINE_H
#include FT_SERVICE_TRUETYPE_GLYF_H #include FT_SERVICE_TRUETYPE_GLYF_H
#include FT_SERVICE_PROPERTIES_H
#include "ttdriver.h" #include "ttdriver.h"
#include "ttgload.h" #include "ttgload.h"
@ -52,6 +53,42 @@
#define FT_COMPONENT trace_ttdriver #define FT_COMPONENT trace_ttdriver
/*
* PROPERTY SERVICE
*
*/
static FT_Error
tt_property_set( FT_Module module, /* TT_Driver */
const char* property_name,
const void* value )
{
FT_Error error = FT_Err_Ok;
TT_Driver driver = (TT_Driver)module;
return error;
}
static FT_Error
tt_property_get( FT_Module module, /* TT_Driver */
const char* property_name,
const void* value )
{
FT_Error error = FT_Err_Ok;
TT_Driver driver = (TT_Driver)module;
return error;
}
FT_DEFINE_SERVICE_PROPERTIESREC(
tt_service_properties,
(FT_Properties_SetFunc)tt_property_set,
(FT_Properties_GetFunc)tt_property_get )
/*************************************************************************/ /*************************************************************************/
/*************************************************************************/ /*************************************************************************/
/*************************************************************************/ /*************************************************************************/
@ -384,18 +421,20 @@
(TT_Glyf_GetLocationFunc)tt_face_get_location ) (TT_Glyf_GetLocationFunc)tt_face_get_location )
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
FT_DEFINE_SERVICEDESCREC4( FT_DEFINE_SERVICEDESCREC5(
tt_services, tt_services,
FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_TRUETYPE, FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_TRUETYPE,
FT_SERVICE_ID_MULTI_MASTERS, &TT_SERVICE_GX_MULTI_MASTERS_GET, FT_SERVICE_ID_MULTI_MASTERS, &TT_SERVICE_GX_MULTI_MASTERS_GET,
FT_SERVICE_ID_TRUETYPE_ENGINE, &tt_service_truetype_engine, FT_SERVICE_ID_TRUETYPE_ENGINE, &tt_service_truetype_engine,
FT_SERVICE_ID_TT_GLYF, &TT_SERVICE_TRUETYPE_GLYF_GET ) FT_SERVICE_ID_TT_GLYF, &TT_SERVICE_TRUETYPE_GLYF_GET,
FT_SERVICE_ID_PROPERTIES, &TT_SERVICE_PROPERTIES_GET )
#else #else
FT_DEFINE_SERVICEDESCREC3( FT_DEFINE_SERVICEDESCREC4(
tt_services, tt_services,
FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_TRUETYPE, FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_TRUETYPE,
FT_SERVICE_ID_TRUETYPE_ENGINE, &tt_service_truetype_engine, FT_SERVICE_ID_TRUETYPE_ENGINE, &tt_service_truetype_engine,
FT_SERVICE_ID_TT_GLYF, &TT_SERVICE_TRUETYPE_GLYF_GET ) FT_SERVICE_ID_TT_GLYF, &TT_SERVICE_TRUETYPE_GLYF_GET,
FT_SERVICE_ID_PROPERTIES, &TT_SERVICE_PROPERTIES_GET )
#endif #endif
@ -457,7 +496,8 @@
#define TT_SIZE_SELECT 0 #define TT_SIZE_SELECT 0
#endif #endif
FT_DEFINE_DRIVER( tt_driver_class, FT_DEFINE_DRIVER(
tt_driver_class,
FT_MODULE_FONT_DRIVER | FT_MODULE_FONT_DRIVER |
FT_MODULE_DRIVER_SCALABLE | FT_MODULE_DRIVER_SCALABLE |

View File

@ -4,7 +4,7 @@
/* */ /* */
/* The FreeType position independent code services for truetype module. */ /* The FreeType position independent code services for truetype module. */
/* */ /* */
/* Copyright 2009, 2012 by */ /* Copyright 2009, 2012, 2013 by */
/* Oran Agra and Mickey Gabel. */ /* Oran Agra and Mickey Gabel. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -27,21 +27,24 @@ FT_BEGIN_HEADER
#define TT_SERVICES_GET tt_services #define TT_SERVICES_GET tt_services
#define TT_SERVICE_GX_MULTI_MASTERS_GET tt_service_gx_multi_masters #define TT_SERVICE_GX_MULTI_MASTERS_GET tt_service_gx_multi_masters
#define TT_SERVICE_TRUETYPE_GLYF_GET tt_service_truetype_glyf #define TT_SERVICE_TRUETYPE_GLYF_GET tt_service_truetype_glyf
#define TT_SERVICE_PROPERTIES_GET tt_service_properties
#else /* FT_CONFIG_OPTION_PIC */ #else /* FT_CONFIG_OPTION_PIC */
#include FT_MULTIPLE_MASTERS_H #include FT_MULTIPLE_MASTERS_H
#include FT_SERVICE_MULTIPLE_MASTERS_H #include FT_SERVICE_MULTIPLE_MASTERS_H
#include FT_SERVICE_TRUETYPE_GLYF_H #include FT_SERVICE_TRUETYPE_GLYF_H
#include FT_SERVICE_PROPERTIES_H
typedef struct TTModulePIC_ typedef struct TTModulePIC_
{ {
FT_ServiceDescRec* tt_services; FT_ServiceDescRec* tt_services;
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
FT_Service_MultiMastersRec tt_service_gx_multi_masters; FT_Service_MultiMastersRec tt_service_gx_multi_masters;
#endif #endif
FT_Service_TTGlyfRec tt_service_truetype_glyf; FT_Service_TTGlyfRec tt_service_truetype_glyf;
FT_Service_PropertiesRec tt_service_properties;
} TTModulePIC; } TTModulePIC;
@ -54,6 +57,8 @@ FT_BEGIN_HEADER
( GET_PIC( library )->tt_service_gx_multi_masters ) ( GET_PIC( library )->tt_service_gx_multi_masters )
#define TT_SERVICE_TRUETYPE_GLYF_GET \ #define TT_SERVICE_TRUETYPE_GLYF_GET \
( GET_PIC( library )->tt_service_truetype_glyf ) ( GET_PIC( library )->tt_service_truetype_glyf )
#define TT_SERVICE_PROPERTIES_GET \
( GET_PIC( library )->tt_service_properties )
/* see ttpic.c for the implementation */ /* see ttpic.c for the implementation */
@ -67,6 +72,7 @@ FT_BEGIN_HEADER
/* */ /* */
FT_END_HEADER FT_END_HEADER
#endif /* __TTPIC_H__ */ #endif /* __TTPIC_H__ */