1
/***************************************************************************/
5
/* CID driver interface (body). */
7
/* Copyright 1996-2001, 2002, 2003, 2004 by */
8
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
10
/* This file is part of the FreeType project, and may only be used, */
11
/* modified, and distributed under the terms of the FreeType project */
12
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13
/* this file you indicate that you have read the license and */
14
/* understand and accept it fully. */
16
/***************************************************************************/
22
#include FT_INTERNAL_DEBUG_H
23
#include FT_INTERNAL_STREAM_H
27
#include FT_SERVICE_POSTSCRIPT_NAME_H
28
#include FT_SERVICE_XFREE86_NAME_H
29
#include FT_SERVICE_POSTSCRIPT_INFO_H
31
/*************************************************************************/
33
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */
34
/* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
35
/* messages during execution. */
38
#define FT_COMPONENT trace_ciddriver
42
* POSTSCRIPT NAME SERVICE
47
cid_get_postscript_name( CID_Face face )
49
const char* result = face->cid.cid_font_name;
52
if ( result && result[0] == '/' )
59
static const FT_Service_PsFontNameRec cid_service_ps_name =
61
(FT_PsName_GetFunc) cid_get_postscript_name
66
* POSTSCRIPT INFO SERVICE
71
cid_ps_get_font_info( FT_Face face,
72
PS_FontInfoRec* afont_info )
74
*afont_info = ((CID_Face)face)->cid.font_info;
79
static const FT_Service_PsInfoRec cid_service_ps_info =
81
(PS_GetFontInfoFunc) cid_ps_get_font_info,
82
(PS_HasGlyphNamesFunc)NULL /* unsupported with CID fonts */
91
static const FT_ServiceDescRec cid_services[] =
93
{ FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &cid_service_ps_name },
94
{ FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_CID },
95
{ FT_SERVICE_ID_POSTSCRIPT_INFO, &cid_service_ps_info },
100
FT_CALLBACK_DEF( FT_Module_Interface )
101
cid_get_interface( FT_Module module,
102
const char* cid_interface )
106
return ft_service_list_lookup( cid_services, cid_interface );
111
FT_CALLBACK_TABLE_DEF
112
const FT_Driver_ClassRec t1cid_driver_class =
114
/* first of all, the FT_Module_Class fields */
116
FT_MODULE_FONT_DRIVER |
117
FT_MODULE_DRIVER_SCALABLE |
118
FT_MODULE_DRIVER_HAS_HINTER,
120
sizeof( FT_DriverRec ),
121
"t1cid", /* module name */
122
0x10000L, /* version 1.0 of driver */
123
0x20000L, /* requires FreeType 2.0 */
132
/* then the other font drivers fields */
133
sizeof( CID_FaceRec ),
134
sizeof( CID_SizeRec ),
135
sizeof( CID_GlyphSlotRec ),
145
cid_point_size_reset,
150
0, /* FT_Face_GetKerningFunc */
151
0, /* FT_Face_AttachFunc */
153
0 /* FT_Face_GetAdvancesFunc */