summaryrefslogtreecommitdiff
path: root/src/pk/pkdrivr.c
blob: 4fbf351069ebb8b3662a610e62ef33531861b794 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
/****************************************************************************
 *
 * pkdrivr.c
 *
 *   FreeType font driver for TeX's PK FONT files.
 *
 * Copyright 1996-2018 by
 * David Turner, Robert Wilhelm, and Werner Lemberg.
 *
 * This file is part of the FreeType project, and may only be used,
 * modified, and distributed under the terms of the FreeType project
 * license, LICENSE.TXT.  By continuing to use, modify, or distribute
 * this file you indicate that you have read the license and
 * understand and accept it fully.
 *
 */

#include <ft2build.h>

#include FT_INTERNAL_DEBUG_H
#include FT_INTERNAL_STREAM_H
#include FT_INTERNAL_OBJECTS_H
#include FT_TRUETYPE_IDS_H
#include FT_SERVICE_FONT_FORMAT_H


#include "pk.h"
#include "pkdrivr.h"
#include "pkerror.h"


  /**************************************************************************
   *
   * The macro FT_COMPONENT is used in trace mode.  It is an implicit
   * parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log
   * messages during execution.
   */
#undef  FT_COMPONENT
#define FT_COMPONENT  trace_pkdriver


  typedef struct  PK_CMapRec_
  {
    FT_CMapRec        cmap;
    /* TO-DO */
  } PK_CMapRec, *PK_CMap;


  FT_CALLBACK_DEF( FT_Error )
  pk_cmap_init(  FT_CMap     pkcmap,
                 FT_Pointer  init_data )
  {
    /* TO-DO */
    return FT_Err_Ok;
  }


  FT_CALLBACK_DEF( void )
  pk_cmap_done( FT_CMap  pkcmap )
  {
    /* TO-DO */
  }


  FT_CALLBACK_DEF( FT_UInt )
  pk_cmap_char_index(  FT_CMap    pkcmap,
                       FT_UInt32  char_code )
  {
    /* TO-DO */
    return gindex;
  }

  FT_CALLBACK_DEF( FT_UInt )
  pk_cmap_char_next(  FT_CMap    pkcmap,
                       FT_UInt32  *achar_code )
  {
    /* To-DO */
    return gindex;
  }


  static
  const FT_CMap_ClassRec  pk_cmap_class =
  {
    sizeof ( PK_CMapRec ),
    pk_cmap_init,
    pk_cmap_done,
    pk_cmap_char_index,
    pk_cmap_char_next,

    NULL, NULL, NULL, NULL, NULL
  };


  FT_CALLBACK_DEF( void )
  PK_Face_Done( FT_Face        pkface )         /* PK_Face */
  {
    /* TO-DO */
  }


  FT_CALLBACK_DEF( FT_Error )
  PK_Face_Init(   FT_Stream      stream,
                  FT_Face        pkface,         /* PK_Face */
                  FT_Int         face_index,
                  FT_Int         num_params,
                  FT_Parameter*  params )
  {
    /* TO-DO */
  }

  FT_CALLBACK_DEF( FT_Error )
  PK_Size_Select(  FT_Size   size,
                   FT_ULong  strike_index )
  {
    /* TO-DO */
  }

  FT_CALLBACK_DEF( FT_Error )
  PK_Size_Request( FT_Size          size,
                   FT_Size_Request  req )
  {
    /* TO-DO */
  }



  FT_CALLBACK_DEF( FT_Error )
  PK_Glyph_Load(   FT_GlyphSlot  slot,
                   FT_Size       size,
                   FT_UInt       glyph_index,
                   FT_Int32      load_flags )
  {
    /* TO-DO */
  }


   FT_CALLBACK_TABLE_DEF
  const FT_Driver_ClassRec  pk_driver_class =
  {
    {
      FT_MODULE_FONT_DRIVER         |
      FT_MODULE_DRIVER_NO_OUTLINES,
      sizeof ( FT_DriverRec ),

      "pk",
      0x10000L,
      0x20000L,

      NULL,    									/* module-specific interface */

      NULL,                     /* FT_Module_Constructor  module_init   */
      NULL,                     /* FT_Module_Destructor   module_done   */
      NULL      								/* FT_Module_Requester    get_interface */
    },

    sizeof ( PK_FaceRec ),
    sizeof ( FT_SizeRec ),
    sizeof ( FT_GlyphSlotRec ),

    PK_Face_Init,               /* FT_Face_InitFunc  init_face */
    PK_Face_Done,               /* FT_Face_DoneFunc  done_face */
    NULL,                       /* FT_Size_InitFunc  init_size */
    NULL,                       /* FT_Size_DoneFunc  done_size */
    NULL,                       /* FT_Slot_InitFunc  init_slot */
    NULL,                       /* FT_Slot_DoneFunc  done_slot */

    PK_Glyph_Load,              /* FT_Slot_LoadFunc  load_glyph */

    NULL,                       /* FT_Face_GetKerningFunc   get_kerning  */
    NULL,                       /* FT_Face_AttachFunc       attach_file  */
    NULL,                       /* FT_Face_GetAdvancesFunc  get_advances */

    PK_Size_Request,           /* FT_Size_RequestFunc  request_size */
    PK_Size_Select             /* FT_Size_SelectFunc   select_size  */
  };


/* END */