summaryrefslogtreecommitdiff
path: root/src/gxlayout/gxlookuptbl.c
blob: 4298caf04fc285a51df2efc6570cacfaf50048da (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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
/***************************************************************************/
/*                                                                         */
/*  gxlookuptbl.c                                                          */
/*                                                                         */
/*    AAT/TrueTypeGX lookup table related types and functions              */
/*   (body)                                                                */
/*                                                                         */
/*  Copyright 2003 by                                                      */
/*  Masatake YAMATO and Redhat K.K.                                        */
/*                                                                         */
/*  This file 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.                                        */
/*                                                                         */
/***************************************************************************/

/***************************************************************************/
/* Development of the code in this file is support of                      */
/* Information-technology Promotion Agency, Japan.                         */
/***************************************************************************/

#include <ft2build.h>
#include FT_INTERNAL_STREAM_H
#include FT_INTERNAL_DEBUG_H
#include "gxlookuptbl.h"
#include "gxerrors.h"

  typedef FT_Error (*gx_LookupTable_loader) ( GX_LookupTable lookup_table,
					      FT_Stream stream );
  typedef void (*gx_LookupTable_finalizer) ( FT_Memory memory,
					     GX_LookupTable lookup_table );
  typedef FT_Error (*gx_LookupTable_traverser) ( GX_LookupTable lookup_table,
						 GX_LookupTable_Funcs funcs,
						 FT_Pointer user );

  static FT_Error
  gx_load_BinSrchHeader( FT_Stream stream,
			 GX_BinSrchHeader header )
  {
    FT_Error error;
    const FT_Frame_Field fields[] =
      {
#undef FT_STRUCTURE
#define FT_STRUCTURE GX_BinSrchHeaderRec
	FT_FRAME_START( 10 ),
	    FT_FRAME_USHORT (unitSize),
	    FT_FRAME_USHORT (nUnits),
	    FT_FRAME_USHORT (searchRange),
	    FT_FRAME_USHORT (entrySelector),
	    FT_FRAME_USHORT (rangeShift),
	FT_FRAME_END
      };

    FT_STREAM_READ_FIELDS( fields, header );
    return error;
  }

  static  FT_Error
  gx_LookupTable_load_raw_values ( FT_Stream stream,
				   FT_Long value_count,
				   GX_LookupValue value_slot )
  {
    FT_Error error;
    FT_Long i;

    for ( i = 0; i < value_count; i++)
      {
	value_slot[i].extra.any = NULL;
	if ( FT_READ_SHORT(value_slot[i].raw.s) )
	  return error;
      }
    return error;
  }

  static FT_Error
  gx_LookupTable_load_segment_generic( GX_LookupTable lookup_table,
				       FT_Stream stream )

  {
    FT_Error error;
    FT_Memory memory = stream->memory;
    GX_LookupTable_Segment segment_table = lookup_table->fsHeader.segment_generic;
    GX_BinSrchHeaderRec binSrchHeader    = segment_table->binSrchHeader;
    GX_LookupSegment segment;
    FT_Long i;

    if ( FT_NEW_ARRAY( segment, binSrchHeader.nUnits ) )
      return error;

    for ( i = 0; i < binSrchHeader.nUnits; i++ )
      {
	if ( FT_READ_USHORT(segment[i].lastGlyph)  ||
	     FT_READ_USHORT(segment[i].firstGlyph) )
	  goto Failure;

	error = gx_LookupTable_load_raw_values(stream, 1, &(segment[i].value));
	if ( error )
	  goto Failure;
      }
    segment_table->segments = segment;
    return error;
  Failure:
    FT_FREE(segment);
    return error;
  }

  static void
  gx_LookupTable_free_segment_generic( FT_Memory memory,
				       GX_LookupTable lookup_table )
  {
    GX_LookupTable_Segment segment_table = lookup_table->fsHeader.segment_generic;
    FT_FREE(segment_table->segments);
    segment_table->segments = NULL;
  }


  static FT_Error
  gx_LookupTable_load_single_table( GX_LookupTable lookup_table,
				    FT_Stream stream )
  {
    FT_Error error;
    FT_Memory memory 			     = stream->memory;
    GX_LookupTable_Single_Table single_table = lookup_table->fsHeader.single_table;
    GX_BinSrchHeaderRec binSrchHeader 	     = single_table->binSrchHeader;
    GX_LookupSingle single;
    FT_Long i;

    if ( FT_NEW_ARRAY( single, binSrchHeader.nUnits ) )
      return error;

    for ( i = 0; i < binSrchHeader.nUnits; i++ )
      {
	if ( FT_READ_USHORT(single[i].glyph) )
	  goto Failure;

	gx_LookupTable_load_raw_values(stream, 1, &(single[i].value));
	if ( error )
	  goto Failure;
      }
    single_table->entries = single;

    return error;
  Failure:
    FT_FREE(single);
    single_table->entries = NULL;
    return error;
  }

  static void
  gx_LookupTable_free_single_table( FT_Memory memory,
				    GX_LookupTable lookup_table )
  {
    GX_LookupTable_Single_Table single_table = lookup_table->fsHeader.single_table;

    FT_FREE(single_table->entries);
    single_table->entries = NULL;
  }

  static FT_Error
  gx_LookupTable_load_binSrch( GX_LookupTable lookup_table,
			       FT_Stream stream )
  {
    FT_Error error = GX_Err_Ok;
    FT_Memory memory = stream->memory;
    GX_LookupTable_BinSrch binSrch;
    gx_LookupTable_loader lookuptable_loader;

    switch (lookup_table->format)
      {
      case GX_LOOKUPTABLE_SEGMENT_SINGLE:
      case GX_LOOKUPTABLE_SEGMENT_ARRAY:
	lookuptable_loader = gx_LookupTable_load_segment_generic;
	break;
      case GX_LOOKUPTABLE_SINGLE_TABLE:
	lookuptable_loader = gx_LookupTable_load_single_table;
	break;
      default:
	return GX_Err_Invalid_Table;
      }

    if ( FT_MEM_NEW (binSrch) )
      return error;

    binSrch->dummy = NULL;
    error = gx_load_BinSrchHeader( stream, &(binSrch->binSrchHeader) );
    if ( error )
      goto Failure;

    lookup_table->fsHeader.bin_srch = binSrch;
    error = lookuptable_loader ( lookup_table, stream );
    if ( error )
      {
	lookup_table->fsHeader.bin_srch = NULL;
	goto Failure;
      }

    return error;

  Failure:
    FT_FREE ( binSrch );
    return error;
  }

  static void
  gx_LookupTable_free_binSrch ( FT_Memory memory,
				GX_LookupTable lookup_table )
  {
    GX_LookupTable_BinSrch binSrch = lookup_table->fsHeader.bin_srch;
    gx_LookupTable_finalizer finalizer;

    switch (lookup_table->format)
      {
      case GX_LOOKUPTABLE_SEGMENT_SINGLE:
      case GX_LOOKUPTABLE_SEGMENT_ARRAY:
	finalizer = gx_LookupTable_free_segment_generic;
	break;
      case GX_LOOKUPTABLE_SINGLE_TABLE:
	finalizer = gx_LookupTable_free_single_table;
	break;
      default:
	finalizer = NULL;
      }
    FT_ASSERT(finalizer);

    finalizer ( memory, lookup_table );
    binSrch->dummy 	   = NULL;
    FT_FREE ( lookup_table->fsHeader.bin_srch );
    lookup_table->fsHeader.bin_srch = NULL;
  }

  static FT_Error
  gx_LookupTable_load_simple_array( GX_LookupTable lookup_table,
				    FT_Stream stream )

  {
    FT_Error error;
    FT_Memory memory   = stream->memory;
    GX_LookupValue value_slot;

    if ( FT_NEW_ARRAY (value_slot, lookup_table->num_glyphs) )
      return error;
    error =  gx_LookupTable_load_raw_values ( stream,
					      lookup_table->num_glyphs,
					      value_slot );
    if ( error )
      goto Failure;

    lookup_table->fsHeader.simple_array = value_slot;
    return error;

  Failure:
    FT_FREE( value_slot );
    return error;
  }

  static void
  gx_LookupTable_free_simple_array( FT_Memory memory,
				    GX_LookupTable lookup_table )
  {
    FT_FREE ( lookup_table->fsHeader.simple_array );
    lookup_table->fsHeader.simple_array = NULL;
  }

  static FT_Error
  gx_LookupTable_load_trimmed_array( GX_LookupTable lookup_table,
				     FT_Stream stream )
  {
    FT_Error error;
    FT_Memory memory = stream->memory;
    FT_Short firstGlyph, glyphCount;
    GX_LookupTable_Trimmed_Array trimmed_array;
    GX_LookupValue value_slot;

    if ( FT_READ_USHORT(firstGlyph) ||
         FT_READ_USHORT(glyphCount) )
      return error;

    if ( FT_ALLOC (trimmed_array,
		   sizeof (*trimmed_array) + sizeof(*trimmed_array->valueArray)  * glyphCount) )
      return error;
    trimmed_array->firstGlyph = firstGlyph;
    trimmed_array->glyphCount = glyphCount;
    trimmed_array->valueArray = NULL;
    value_slot =(GX_LookupValue)(((char *)trimmed_array) + sizeof (*trimmed_array));
    error = gx_LookupTable_load_raw_values ( stream, glyphCount, value_slot );
    if ( error )
      goto Failure;

    lookup_table->fsHeader.trimmed_array = trimmed_array;
    trimmed_array->valueArray = value_slot;
    return error;

  Failure:
    FT_FREE( trimmed_array );
    lookup_table->fsHeader.trimmed_array = NULL;
    return error;
  }

  static void
  gx_LookupTable_free_trimmed_array( FT_Memory memory,
				     GX_LookupTable lookup_table )
  {
    GX_LookupTable_Trimmed_Array trimmed_array;

    trimmed_array = lookup_table->fsHeader.trimmed_array;
    trimmed_array->valueArray = NULL;
    FT_FREE(trimmed_array);
    lookup_table->fsHeader.trimmed_array = NULL;
  }


  FT_LOCAL_DEF( FT_Error )
  gx_face_load_LookupTable ( GX_Face face,
			     FT_Stream stream,
			     GX_LookupTable lookup_table )
  {
    FT_Error error;
    gx_LookupTable_loader loader;

    lookup_table->position   = FT_STREAM_POS();
    lookup_table->num_glyphs = face->root.num_glyphs;
    lookup_table->fsHeader.any = NULL;
    if ( FT_READ_SHORT(lookup_table->format) )
      return error;

    switch ( lookup_table->format )
      {
      case GX_LOOKUPTABLE_SIMPLE_ARRAY:
	loader = gx_LookupTable_load_simple_array;
	break;
      case GX_LOOKUPTABLE_TRIMMED_ARRAY:
	loader = gx_LookupTable_load_trimmed_array;
	break;
      default:
	loader = gx_LookupTable_load_binSrch;
      }

    error = (*loader)( lookup_table, stream );
    return error;
  }

  FT_LOCAL_DEF ( void )
  gx_LookupTable_free ( GX_LookupTable lookup_table,
			FT_Memory memory )
  {
    gx_LookupTable_finalizer finalizer;

    switch ( lookup_table->format )
      {
     case GX_LOOKUPTABLE_SIMPLE_ARRAY:
       finalizer = gx_LookupTable_free_simple_array;
       break;
     case GX_LOOKUPTABLE_TRIMMED_ARRAY:
       finalizer = gx_LookupTable_free_trimmed_array;
       break;
     default:
       finalizer = gx_LookupTable_free_binSrch;
     }
    finalizer ( memory, lookup_table );
  }


  static FT_Error
  gx_LookupTable_traverse_simple_array( GX_LookupTable lookup_table,
					GX_LookupTable_Funcs funcs,
					FT_Pointer user )
  {
    FT_Long i;
    FT_Error error = GX_Err_Ok;

    if ( funcs->simple_array_func )
      {
	for ( i = 0; i < lookup_table->num_glyphs; i++ )
	  {
	    error = (* funcs->simple_array_func)(lookup_table->format,
						 i,
						 &((lookup_table->fsHeader.simple_array)[i]),
						 user);
	    if ( error )
	      return error;
	  }
      }
    else if ( funcs->generic_func )
      {
        for ( i = 0; i < lookup_table->num_glyphs; i++ )
	  {
	    error = (* funcs->generic_func)(lookup_table->format,
					    &((lookup_table->fsHeader.simple_array)[i]),
					    user);
	    if ( error )
	      return error;
	  }
      }
    else
      error = GX_Err_Ok;
    return error;
  }

  static FT_Error
  gx_LookupTable_traverse_segment_generic( GX_LookupTable lookup_table,
					   GX_LookupTable_Funcs funcs,
					   FT_Pointer user )
  {
    FT_Error error = GX_Err_Ok;
    GX_LookupTable_Segment segment_table = lookup_table->fsHeader.segment_generic;
    GX_BinSrchHeader header = &(segment_table->binSrchHeader);
    GX_LookupSegment segment;
    GX_LookupTable_Segment_Func segment_func;
    FT_Long i;

    if ( lookup_table->format == GX_LOOKUPTABLE_SEGMENT_SINGLE )
      segment_func = funcs->segment_single_func;
    else if ( lookup_table->format == GX_LOOKUPTABLE_SEGMENT_ARRAY)
      segment_func = funcs->segment_array_func;
    else
      segment_func = NULL;

    if ( segment_func )
      {
	for ( i = 0; i < header->nUnits; i++ )
	  {
	    segment = &(segment_table->segments[i]);
	    error 	= (*segment_func)( lookup_table->format,
					   segment->lastGlyph,
					   segment->firstGlyph,
					   &(segment->value),
					   user );
	    if ( error )
	      return error;
	  }
      }
    else if ( funcs->generic_func )
      {
	for ( i = 0; i < header->nUnits; i++ )
	  {
	    segment = &(segment_table->segments[i]);
	    error 	= (*funcs->generic_func)( lookup_table->format,
						  &(segment->value),
						  user );
	    if ( error )
	      return error;
	  }
      }
    else
      error = GX_Err_Ok;
    return error;
  }

  static FT_Error
  gx_LookupTable_traverse_single_table ( GX_LookupTable lookup_table,
					 GX_LookupTable_Funcs funcs,
					 FT_Pointer user )
  {
    FT_Error error = GX_Err_Ok;
    GX_LookupTable_Single_Table single_table;
    GX_LookupSingle entries;
    GX_BinSrchHeader binSrchHeader;
    FT_Long i;

    single_table  = lookup_table->fsHeader.single_table;
    entries 	  = single_table->entries;
    binSrchHeader = &(single_table->binSrchHeader);

    if ( funcs->single_table_func )
      {
	for ( i = 0; i < binSrchHeader->nUnits; i++ )
	  {
	    error = (*funcs->single_table_func) ( lookup_table->format,
						  entries[i].glyph,
						  &(entries[i].value),
						  user );
	      if ( error )
		return error;
	  }
      }
    else if ( funcs->generic_func )
      {
	for ( i = 0; i < binSrchHeader->nUnits; i++ )
	  {
	    error = (* funcs->generic_func) ( lookup_table->format,
					      &(entries[i].value),
					      user );
	    if ( error )
	      return error;
	  }
      }
    else
      error = GX_Err_Ok;
    return error;
  }

  static FT_Error
  gx_LookupTable_traverse_trimmed_array( GX_LookupTable lookup_table,
					 GX_LookupTable_Funcs funcs,
					 FT_Pointer user )
  {
    FT_Error error = GX_Err_Ok;
    FT_Long i;
    GX_LookupTable_Trimmed_Array trimmed_array = lookup_table->fsHeader.trimmed_array;

    if ( funcs->trimmed_array_func )
      {
	for ( i = 0; i < trimmed_array->glyphCount; i++ )
	  {
	    error = (* funcs->trimmed_array_func)(lookup_table->format,
						  i,
						  trimmed_array->firstGlyph,
						  trimmed_array->glyphCount,
						  &(trimmed_array->valueArray[i]),
						  user);
	    if ( error )
	      return error;
	  }
      }
    else if ( funcs->generic_func )
      {
	for ( i = 0; i < trimmed_array->glyphCount; i++ )
	  {
	    error = (* funcs->generic_func)(lookup_table->format,
					    &(trimmed_array->valueArray[i]),
					    user);
	    if ( error )
	      return error;
	  }
      }
    else
      error = GX_Err_Ok;
    return error;
  }

  FT_LOCAL_DEF ( FT_Error )
  gx_LookupTable_traverse_low( GX_LookupTable lookup_table,
			   GX_LookupTable_Funcs funcs,
			   FT_Pointer user )
  {
    gx_LookupTable_traverser traverser;

    switch (lookup_table->format)
      {
      case GX_LOOKUPTABLE_SIMPLE_ARRAY:
	traverser = gx_LookupTable_traverse_simple_array;
	break;
      case GX_LOOKUPTABLE_SEGMENT_SINGLE:
      case GX_LOOKUPTABLE_SEGMENT_ARRAY:
	traverser = gx_LookupTable_traverse_segment_generic;
	break;
      case GX_LOOKUPTABLE_SINGLE_TABLE:
	traverser = gx_LookupTable_traverse_single_table;
	break;
      case GX_LOOKUPTABLE_TRIMMED_ARRAY:
	traverser = gx_LookupTable_traverse_trimmed_array;
	break;
      default:
	traverser = NULL;
      }
    FT_ASSERT(traverser);
    return (*traverser) ( lookup_table, funcs, user );
  }

  static int
  lookup_lookup_segment (const void *keyval, const void *datum)
  {
    const GX_LookupSegment segment = (const GX_LookupSegment)datum;
    FT_UShort glyph 	     = *(FT_UShort*)keyval;

    if ( glyph < segment->firstGlyph )
      return -1;
    else if ( segment->lastGlyph < glyph )
      return 1;
    else
      return 0;
  }


  static int
  lookup_lookup_single(const void *keyval, const void *datum)
  {
    const GX_LookupSingle entry = (const GX_LookupSingle)datum;
    FT_UShort glyph 	  = *(FT_UShort*)keyval;
    if ( glyph < entry->glyph )
      return -1;
    else if ( entry->glyph < glyph )
      return 1;
    else
      return 0;
  }

  FT_LOCAL_DEF( GX_LookupResultRec )
  gx_LookupTable_lookup ( GX_LookupTable lookup_table,
			  FT_UShort glyph )
  {
    GX_LookupResultRec result;

    GX_LookupTable_Segment segment_table;
    GX_LookupSegment segment;

    GX_LookupTable_Single_Table single_table;
    GX_LookupSingle entry;

    GX_LookupTable_Trimmed_Array trimmed_array;
    FT_Long trimmed_index;

    void * bs_key = &glyph;
    void * bs_base;
    size_t bs_n;
    size_t bs_size;

    int (* bs_cmp)(const void* keyval, const void* datum);

    result.firstGlyph = GX_LOOKUP_RESULT_NO_FIRST_GLYPH;
    result.value      = NULL;
    switch ( lookup_table->format )
      {
      case GX_LOOKUPTABLE_SIMPLE_ARRAY:
	if ( glyph < lookup_table->num_glyphs )
	  result.value = &((lookup_table->fsHeader.simple_array) [glyph]);
	break;
      case GX_LOOKUPTABLE_SEGMENT_SINGLE:
      case GX_LOOKUPTABLE_SEGMENT_ARRAY:
	segment_table 	  = lookup_table->fsHeader.segment_generic;
	bs_base       	  = segment_table->segments;
	bs_n          	  = segment_table->binSrchHeader.nUnits;
	bs_size       	  = sizeof (*segment_table->segments);
	bs_cmp        	  = lookup_lookup_segment;
	segment       	  = ft_bsearch( bs_key, bs_base, bs_n, bs_size, bs_cmp );
	if ( segment )
	  {
	    result.value = &segment->value;
	    if ( ( lookup_table->format == GX_LOOKUPTABLE_SEGMENT_ARRAY ) )
	      result.firstGlyph = segment->firstGlyph;
	  }
	return result;
      case GX_LOOKUPTABLE_SINGLE_TABLE:
	single_table = lookup_table->fsHeader.single_table;
	bs_base      = single_table->entries;
	bs_n 	     = single_table->binSrchHeader.nUnits;
	bs_size      = sizeof (*single_table->entries);
	bs_cmp 	     = lookup_lookup_single;
	entry 	     = ft_bsearch( bs_key, bs_base, bs_n, bs_size, bs_cmp );
	if ( entry )
	  result.value = &(entry->value);
	break;
      case GX_LOOKUPTABLE_TRIMMED_ARRAY:
	trimmed_array = lookup_table->fsHeader.trimmed_array;
	if ( glyph < trimmed_array->firstGlyph )
	  break;

	trimmed_index = glyph - trimmed_array->firstGlyph;
	if ( trimmed_index < trimmed_array->glyphCount )
	  result.value = &(trimmed_array->valueArray[trimmed_index]);
	break;
      }
    return result;
  }

  FT_LOCAL ( FT_Error )
  gx_LookupTable_traverse_high ( GX_LookupTable lookup_table,
				 GX_LookupTable_Glyph_Func func,
				 FT_Pointer user)
  {
    FT_Error error;
    FT_UShort glyph;
    GX_LookupResultRec result;

    for ( glyph = 0; glyph < 0xFFFF; glyph++ )
      {
	result = gx_LookupTable_lookup ( lookup_table, glyph );
	if ( result.value == NULL)
	  continue ;

	if (( error = func( glyph, result.value, result.firstGlyph, user ) ))
	  return error;
      }
    return FT_Err_Ok;
  }


/* END */