Commit 54e75749465821066fe3ed533f00d6a2c67fbb37

David Turner 2000-11-04T02:52:02

defining new types to hold "internal" fields of public objects: FT_Face_Internal, FT_Size_Internal, FT_Slot_Internal these contain some fields that may change between releases of FreeType, without affecting the size of FT_FaceRec, FT_SizeRec, FT_GlyphSlotRec, etc.., which means that drivers wouldn't need to be recompiled if we only add new fields to an internal structure.. I plan to hack a few things related to the auto-hinter and I need this move to ensure that we will not break binary compatibility between 2.0 and 2.1 :-) - David

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
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
diff --git a/include/freetype/freetype.h b/include/freetype/freetype.h
index ce09e80..1cb5109 100644
--- a/include/freetype/freetype.h
+++ b/include/freetype/freetype.h
@@ -393,6 +393,21 @@
   /*************************************************************************/
   /*************************************************************************/
 
+ /*********************************************************************
+  *
+  * <Type>
+  *    FT_Face_Internal
+  *
+  * <Description>
+  *    an opaque handle to a FT_Face_InternalRec structure, used to
+  *    model private data of a given FT_Face object.
+  *
+  *    this fields might change between releases of FreeType 2 and
+  *    are not generally available to client applications
+  *
+  */
+  typedef struct FT_Face_InternalRec_*   FT_Face_Internal;
+
   /*************************************************************************/
   /*                                                                       */
   /*                       FreeType base face class                        */
@@ -570,18 +585,10 @@
   /*                           this should be set to 0.  Only relevant for */
   /*                           scalable formats.                           */
   /*                                                                       */
-  /*    transform_matrix    :: A 2x2 matrix of 16.16 coefficients used     */
-  /*                           to transform glyph outlines after they are  */
-  /*                           loaded from the font.  Only used by the     */
-  /*                           convenience functions.                      */
-  /*                                                                       */
-  /*    transform_delta     :: A translation vector used to transform      */
-  /*                           glyph outlines after they are loaded from   */
-  /*                           the font.  Only used by the convenience     */
-  /*                           functions.                                  */
-  /*                                                                       */
-  /*    transform_flags     :: Some flags used to classify the transform.  */
-  /*                           Only used by the convenience functions.     */
+  /*    internal            :: a pointer to internal fields of the face    */
+  /*                           object. These fields can change freely      */
+  /*                           between releases of FreeType and are not    */
+  /*                           publicly available..                        */
   /*                                                                       */
   typedef struct  FT_FaceRec_
   {
@@ -620,6 +627,7 @@
 
     FT_GlyphSlot     glyph;
     FT_Size          size;
+    FT_CharMap       charmap;
 
     /*@private begin */
 
@@ -627,18 +635,12 @@
     FT_Memory        memory;
     FT_Stream        stream;
 
-    FT_CharMap       charmap;
     FT_ListRec       sizes_list;
 
     FT_Generic       autohint;
     void*            extensions;
 
-    FT_UShort        max_points;
-    FT_Short         max_contours;
-
-    FT_Matrix        transform_matrix;
-    FT_Vector        transform_delta;
-    FT_Int           transform_flags;
+    FT_Face_Internal internal;
 
     /*@private end */
 
@@ -848,6 +850,17 @@
 #define FT_STYLE_FLAG_BOLD  2
 
 
+ /*********************************************************************
+  *
+  * <Type>
+  *    FT_Size_Internal
+  *
+  * <Description>
+  *    an opaque handle to a FT_Size_InternalRec structure, used to
+  *    model private data of a given FT_Size object.
+  */
+  typedef struct FT_Size_InternalRec_*   FT_Size_Internal;
+  
   /*************************************************************************/
   /*                                                                       */
   /*                    FreeType base size metrics                         */
@@ -914,16 +927,16 @@
   /*                                                                       */
   typedef struct  FT_Size_Metrics_
   {
-    FT_UShort   x_ppem;        /* horizontal pixels per EM               */
-    FT_UShort   y_ppem;        /* vertical pixels per EM                 */
+    FT_UShort  x_ppem;      /* horizontal pixels per EM               */
+    FT_UShort  y_ppem;      /* vertical pixels per EM                 */
 
-    FT_Fixed    x_scale;       /* two scales used to convert font units  */
-    FT_Fixed    y_scale;       /* to 26.6 frac. pixel coordinates..      */
+    FT_Fixed   x_scale;     /* two scales used to convert font units  */
+    FT_Fixed   y_scale;     /* to 26.6 frac. pixel coordinates..      */
 
-    FT_Pos      ascender;      /* ascender in 26.6 frac. pixels          */
-    FT_Pos      descender;     /* descender in 26.6 frac. pixels         */
-    FT_Pos      height;        /* text height in 26.6 frac. pixels       */
-    FT_Pos      max_advance;   /* max horizontal advance, in 26.6 pixels */
+    FT_Pos     ascender;    /* ascender in 26.6 frac. pixels          */
+    FT_Pos     descender;   /* descender in 26.6 frac. pixels         */
+    FT_Pos     height;      /* text height in 26.6 frac. pixels       */
+    FT_Pos     max_advance; /* max horizontal advance, in 26.6 pixels */
 
   } FT_Size_Metrics;
 
@@ -951,9 +964,11 @@
   /*                                                                       */
   typedef struct  FT_SizeRec_
   {
-    FT_Face          face;      /* parent face object              */
-    FT_Generic       generic;   /* generic pointer for client uses */
-    FT_Size_Metrics  metrics;   /* size metrics                    */
+    FT_Face           face;      /* parent face object              */
+    FT_Generic        generic;   /* generic pointer for client uses */
+    FT_Size_Metrics   metrics;   /* size metrics                    */
+    FT_Size_Internal  internal;
+    
 
   } FT_SizeRec;
 
@@ -974,20 +989,16 @@
   typedef struct FT_SubGlyph_  FT_SubGlyph;
 
 
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Struct>                                                              */
-  /*    FT_GlyphLoader                                                     */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    The glyph loader is an internal object used to load several glyphs */
-  /*    together (for example, in the case of composites).                 */
-  /*                                                                       */
-  /* <Note>                                                                */
-  /*    The glyph loader implementation is not part of the high-level API, */
-  /*    hence the forward structure declaration.                           */
-  /*                                                                       */
-  typedef struct FT_GlyphLoader_  FT_GlyphLoader;
+ /*********************************************************************
+  *
+  * <Type>
+  *    FT_Slot_Internal
+  *
+  * <Description>
+  *    an opaque handle to a FT_Slot_InternalRec structure, used to
+  *    model private data of a given FT_GlyphSlot object.
+  */
+  typedef struct FT_Slot_InternalRec_*   FT_Slot_Internal;
 
 
   /*************************************************************************/
@@ -1146,14 +1157,7 @@
 
     void*             other;
 
-    /*@private begin */
-
-    FT_GlyphLoader*   loader;
-    FT_Bool           glyph_transformed;
-    FT_Matrix         glyph_matrix;
-    FT_Vector         glyph_delta;
-
-    /*@private end */
+    FT_Slot_Internal  internal;
 
   } FT_GlyphSlotRec;
 
diff --git a/include/freetype/internal/ftobjs.h b/include/freetype/internal/ftobjs.h
index c911ca4..be297c0 100644
--- a/include/freetype/internal/ftobjs.h
+++ b/include/freetype/internal/ftobjs.h
@@ -75,6 +75,95 @@
 #define ABS( a )     ( (a) < 0 ? -(a) : (a) )
 #endif
 
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Struct>                                                              */
+  /*    FT_GlyphLoader                                                     */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    The glyph loader is an internal object used to load several glyphs */
+  /*    together (for example, in the case of composites).                 */
+  /*                                                                       */
+  /* <Note>                                                                */
+  /*    The glyph loader implementation is not part of the high-level API, */
+  /*    hence the forward structure declaration.                           */
+  /*                                                                       */
+  typedef struct FT_GlyphLoader_  FT_GlyphLoader;
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Struct>                                                              */
+  /*    FT_Face_InternalRec                                                */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    this structure contains the internal fields of each FT_Face        */
+  /*    object. These fields may change between different releases         */
+  /*    of FreeType.                                                       */
+  /*                                                                       */
+  /* <Fields>                                                              */
+  /*    transform_matrix    :: A 2x2 matrix of 16.16 coefficients used     */
+  /*                           to transform glyph outlines after they are  */
+  /*                           loaded from the font.  Only used by the     */
+  /*                           convenience functions.                      */
+  /*                                                                       */
+  /*    transform_delta     :: A translation vector used to transform      */
+  /*                           glyph outlines after they are loaded from   */
+  /*                           the font.  Only used by the convenience     */
+  /*                           functions.                                  */
+  /*                                                                       */
+  /*    transform_flags     :: Some flags used to classify the transform.  */
+  /*                           Only used by the convenience functions.     */
+  /*                                                                       */
+  /*                                                                       */
+  /*                                                                       */
+  /*                                                                       */
+  typedef struct FT_Face_InternalRec_
+  {
+    FT_UShort        max_points;
+    FT_Short         max_contours;
+
+    FT_Matrix        transform_matrix;
+    FT_Vector        transform_delta;
+    FT_Int           transform_flags;
+  
+  } FT_Face_InternalRec;
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Struct>                                                              */
+  /*    FT_Slot_InternalRec                                                */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    this structure contains the internal fields of each FT_GlyphSlot   */
+  /*    object. These fields may change between different releases         */
+  /*    of FreeType.                                                       */
+  /*                                                                       */
+  /* <Fields>                                                              */
+  /*    loader            :: the glyph loader object used to load          */
+  /*                         outlines in the glyph slot                    */
+  /*                                                                       */
+  /*    glyph_transformed :: boolean. set to TRUE when the loaded glyph    */
+  /*                         must be transformed through a specific        */
+  /*                         font transform. this is _not_ the same as     */
+  /*                         the face transform set through                */
+  /*                         FT_Set_Transform                              */
+  /*                                                                       */
+  /*    glyph_matrix      :: the 2x2 matrix corresponding to the glyph     */
+  /*                         transform, when required                      */
+  /*                                                                       */
+  /*    glyph_delta       :: the 2d translation vector corresponding to    */
+  /*                         the glyph transform, when required            */
+  /*                                                                       */
+  typedef struct FT_Slot_InternalRec_
+  {
+    FT_GlyphLoader*   loader;
+    FT_Bool           glyph_transformed;
+    FT_Matrix         glyph_matrix;
+    FT_Vector         glyph_delta;
+  
+  } FT_GlyphSlot_InternalRec;
 
   /*************************************************************************/
   /*************************************************************************/
diff --git a/src/autohint/ahhint.c b/src/autohint/ahhint.c
index 15ef067..f458f63 100644
--- a/src/autohint/ahhint.c
+++ b/src/autohint/ahhint.c
@@ -1286,12 +1286,12 @@
       /* XXX: TO DO - slot->linearHoriAdvance */
 
       /* now copy outline into glyph slot */
-      ah_loader_rewind( slot->loader );
-      error = ah_loader_copy_points( slot->loader, gloader );
+      ah_loader_rewind( slot->internal->loader );
+      error = ah_loader_copy_points( slot->internal->loader, gloader );
       if ( error )
         goto Exit;
 
-      slot->outline = slot->loader->base.outline;
+      slot->outline = slot->internal->loader->base.outline;
       slot->format  = ft_glyph_format_outline;
     }
 
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index 4b46fb2..0bac579 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -674,16 +674,23 @@
     FT_Driver_Class*  clazz  = driver->clazz;
     FT_Memory         memory = driver->root.memory;
     FT_Error          error  = FT_Err_Ok;
+    FT_Slot_Internal  internal;
 
 
     slot->library = driver->root.library;
 
+    if ( ALLOC( internal, sizeof( *internal ) ) )
+      goto Exit;
+
+    slot->internal = internal;
+
     if ( FT_DRIVER_USES_OUTLINES( driver ) )
-      error = FT_GlyphLoader_New( memory, &slot->loader );
+      error = FT_GlyphLoader_New( memory, &internal->loader );
 
     if ( !error && clazz->init_slot )
       error = clazz->init_slot( slot );
 
+  Exit:
     return error;
   }
 
@@ -728,6 +735,9 @@
     FT_Memory         memory = driver->root.memory;
 
 
+    if ( clazz->done_slot )
+      clazz->done_slot( slot );
+
     /* free bitmap buffer if needed */
     if ( slot->flags & ft_glyph_own_bitmap )
       FREE( slot->bitmap.buffer );
@@ -735,12 +745,11 @@
     /* free glyph loader */
     if ( FT_DRIVER_USES_OUTLINES( driver ) )
     {
-      FT_GlyphLoader_Done( slot->loader );
-      slot->loader = 0;
+      FT_GlyphLoader_Done( slot->internal->loader );
+      slot->internal->loader = 0;
     }
 
-    if ( clazz->done_slot )
-      clazz->done_slot( slot );
+    FREE( slot->internal );
   }
 
 
@@ -876,40 +885,45 @@
                                            FT_Matrix*  matrix,
                                            FT_Vector*  delta )
   {
+    FT_Face_Internal  internal;
+    
+
     if ( !face )
       return;
 
-    face->transform_flags = 0;
+    internal = face->internal;
+
+    internal->transform_flags = 0;
 
     if ( !matrix )
     {
-      face->transform_matrix.xx = 0x10000L;
-      face->transform_matrix.xy = 0;
-      face->transform_matrix.yx = 0;
-      face->transform_matrix.yy = 0x10000L;
-      matrix = &face->transform_matrix;
+      internal->transform_matrix.xx = 0x10000L;
+      internal->transform_matrix.xy = 0;
+      internal->transform_matrix.yx = 0;
+      internal->transform_matrix.yy = 0x10000L;
+      matrix = &internal->transform_matrix;
     }
     else
-      face->transform_matrix = *matrix;
+      internal->transform_matrix = *matrix;
 
     /* set transform_flags bit flag 0 if `matrix' isn't the identity */
     if ( ( matrix->xy | matrix->yx ) ||
          matrix->xx != 0x10000L      ||
          matrix->yy != 0x10000L      )
-      face->transform_flags |= 1;
+      internal->transform_flags |= 1;
 
     if ( !delta )
     {
-      face->transform_delta.x = 0;
-      face->transform_delta.y = 0;
-      delta = &face->transform_delta;
+      internal->transform_delta.x = 0;
+      internal->transform_delta.y = 0;
+      delta = &internal->transform_delta;
     }
     else
-      face->transform_delta = *delta;
+      internal->transform_delta = *delta;
 
     /* set transform_flags bit flag 1 if `delta' isn't the null vector */
     if ( delta->x | delta->y )
-      face->transform_flags |= 2;
+      internal->transform_flags |= 2;
   }
 
 
@@ -1044,8 +1058,11 @@
 
     if ( ( load_flags & FT_LOAD_IGNORE_TRANSFORM ) == 0 )
     {
+      FT_Face_Internal  internal = face->internal;
+      
+      
       /* now, transform the glyph image if needed */
-      if ( face->transform_flags )
+      if ( internal->transform_flags )
       {
         /* get renderer */
         FT_Renderer  renderer = ft_lookup_glyph_renderer( slot );
@@ -1053,10 +1070,10 @@
 
         if ( renderer )
           error = renderer->clazz->transform_glyph( renderer, slot,
-                                                    &face->transform_matrix,
-                                                    &face->transform_delta );
+                                                    &internal->transform_matrix,
+                                                    &internal->transform_delta );
         /* transform advance */
-        FT_Vector_Transform( &slot->advance, &face->transform_matrix );
+        FT_Vector_Transform( &slot->advance, &internal->transform_matrix );
       }
     }
 
@@ -1147,6 +1164,7 @@
     if ( driver->clazz->done_size )
       driver->clazz->done_size( size );
 
+    FREE( size->internal );
     FREE( size );
   }
 
@@ -1190,6 +1208,7 @@
       ( face->face_flags & FT_FACE_FLAG_EXTERNAL_STREAM ) != 0 );
 
     /* get rid of it */
+    FREE( face->internal );
     FREE( face );
   }
 
@@ -1228,6 +1247,7 @@
     FT_Driver_Class*  clazz;
     FT_Face           face = 0;
     FT_Error          error;
+    FT_Face_Internal  internal;
 
 
     clazz  = driver->clazz;
@@ -1237,9 +1257,14 @@
     if ( ALLOC( face, clazz->face_object_size ) )
       goto Fail;
 
-    face->driver = driver;
-    face->memory = memory;
-    face->stream = stream;
+    if ( ALLOC( internal, sizeof(*internal) ) )
+      goto Fail;
+      
+    face->internal = internal;
+
+    face->driver   = driver;
+    face->memory   = memory;
+    face->stream   = stream;
 
     error = clazz->init_face( stream,
                               face,
@@ -1255,6 +1280,7 @@
     if ( error )
     {
       clazz->done_face( face );
+      FREE( face->internal );
       FREE( face );
       *aface = 0;
     }
@@ -1574,14 +1600,19 @@
       face->size = size;
     }
 
-    /* initialize transformation for convenience functions */
-    face->transform_matrix.xx = 0x10000L;
-    face->transform_matrix.xy = 0;
-    face->transform_matrix.yx = 0;
-    face->transform_matrix.yy = 0x10000L;
-
-    face->transform_delta.x = 0;
-    face->transform_delta.y = 0;
+    /* initialize internal face data */
+    {
+      FT_Face_Internal  internal = face->internal;
+      
+
+      internal->transform_matrix.xx = 0x10000L;
+      internal->transform_matrix.xy = 0;
+      internal->transform_matrix.yx = 0;
+      internal->transform_matrix.yy = 0x10000L;
+  
+      internal->transform_delta.x = 0;
+      internal->transform_delta.y = 0;
+    }
 
     *aface = face;
     goto Exit;
@@ -1809,6 +1840,9 @@
       goto Exit;
 
     size->face = face;
+    
+    /* for now, do not use any internal fields in size objects */
+    size->internal = 0;
 
     if ( clazz->init_size )
       error = clazz->init_size( size );
@@ -2038,6 +2072,21 @@
   /* <Return>                                                              */
   /*    FreeType error code.  0 means success.                             */
   /*                                                                       */
+  /* <Note>                                                                */
+  /*    the values of "pixel_width" and "pixel_height" correspond to       */
+  /*    the pixel values of the _typographic_ character size, which are    */
+  /*    NOT necessarily the same as the dimensions of the glyph            */
+  /*    "bitmap cells".                                                    */
+  /*                                                                       */
+  /*    The "character size" is really the size of an abstract square      */
+  /*    called the "EM", used to design the font. However, depending       */
+  /*    on the font design, glyphs will be smaller or greater than the     */
+  /*    EM.                                                                */
+  /*                                                                       */
+  /*    this means that setting the pixel size to 8x8 doesn't guarantee    */
+  /*    in any way that you'll end up with glyph bitmaps that all fit      */
+  /*    within an 8x8 cell.. far from it..                                 */
+  /*                                                                       */
   FT_EXPORT_DEF( FT_Error )  FT_Set_Pixel_Sizes( FT_Face  face,
                                                  FT_UInt  pixel_width,
                                                  FT_UInt  pixel_height )
diff --git a/src/cff/t2gload.c b/src/cff/t2gload.c
index d1e3745..20944fd 100644
--- a/src/cff/t2gload.c
+++ b/src/cff/t2gload.c
@@ -243,7 +243,7 @@
 
     if ( glyph )
     {
-      FT_GlyphLoader*  loader = glyph->root.loader;
+      FT_GlyphLoader*  loader = glyph->root.internal->loader;
 
 
       builder->loader  = loader;
diff --git a/src/cid/cidgload.c b/src/cid/cidgload.c
index 2579326..a86519b 100644
--- a/src/cid/cidgload.c
+++ b/src/cid/cidgload.c
@@ -264,12 +264,15 @@
       /* advance width                                           */
       if ( load_flags & FT_LOAD_NO_RECURSE )
       {
+        FT_Slot_Internal  internal = glyph->root.internal;
+        
+        
         glyph->root.metrics.horiBearingX = decoder.builder.left_bearing.x;
         glyph->root.metrics.horiAdvance  = decoder.builder.advance.x;
 
-        glyph->root.glyph_matrix         = font_matrix;
-        glyph->root.glyph_delta          = font_offset;
-        glyph->root.glyph_transformed    = 1;
+        internal->glyph_matrix         = font_matrix;
+        internal->glyph_delta          = font_offset;
+        internal->glyph_transformed    = 1;
       }
       else
       {
@@ -280,7 +283,7 @@
         /* copy the _unscaled_ advance width */
         metrics->horiAdvance          = decoder.builder.advance.x;
         glyph->root.linearHoriAdvance = decoder.builder.advance.x;
-        glyph->root.glyph_transformed = 0;
+        glyph->root.internal->glyph_transformed = 0;
 
         /* make up vertical metrics */
         metrics->vertBearingX = 0;
diff --git a/src/cid/cidobjs.c b/src/cid/cidobjs.c
index 51f9aa7..9966c8a 100644
--- a/src/cid/cidobjs.c
+++ b/src/cid/cidobjs.c
@@ -269,8 +269,8 @@
         root->underline_position  = face->cid.font_info.underline_position;
         root->underline_thickness = face->cid.font_info.underline_thickness;
 
-        root->max_points   = 0;
-        root->max_contours = 0;
+        root->internal->max_points   = 0;
+        root->internal->max_contours = 0;
       }
     }
 
diff --git a/src/psaux/psobjs.c b/src/psaux/psobjs.c
index 2b17778..fc1ecc6 100644
--- a/src/psaux/psobjs.c
+++ b/src/psaux/psobjs.c
@@ -1076,7 +1076,7 @@
 
     if ( glyph )
     {
-      FT_GlyphLoader*  loader = glyph->loader;
+      FT_GlyphLoader*  loader = glyph->internal->loader;
 
 
       builder->loader  = loader;
diff --git a/src/psaux/t1decode.c b/src/psaux/t1decode.c
index 1d9c8d8..40e4f4e 100644
--- a/src/psaux/t1decode.c
+++ b/src/psaux/t1decode.c
@@ -222,7 +222,7 @@
     if ( decoder->builder.no_recurse )
     {
       FT_GlyphSlot     glyph  = (FT_GlyphSlot)decoder->builder.glyph;
-      FT_GlyphLoader*  loader = glyph->loader;
+      FT_GlyphLoader*  loader = glyph->internal->loader;
       FT_SubGlyph*     subg;
 
 
diff --git a/src/sfnt/ttload.c b/src/sfnt/ttload.c
index 0205786..18148ab 100644
--- a/src/sfnt/ttload.c
+++ b/src/sfnt/ttload.c
@@ -583,11 +583,11 @@
 
     face->root.num_glyphs = maxProfile->numGlyphs;
 
-    face->root.max_points = MAX( maxProfile->maxCompositePoints,
-                                 maxProfile->maxPoints );
+    face->root.internal->max_points = MAX( maxProfile->maxCompositePoints,
+                                           maxProfile->maxPoints );
 
-    face->root.max_contours = MAX( maxProfile->maxCompositeContours,
-                                   maxProfile->maxContours );
+    face->root.internal->max_contours = MAX( maxProfile->maxCompositeContours,
+                                             maxProfile->maxContours );
 
     face->max_components = (FT_ULong)maxProfile->maxComponentElements +
                            maxProfile->maxComponentDepth;
@@ -599,8 +599,8 @@
 
     /* We also increase maxPoints and maxContours in order to support */
     /* some broken fonts.                                             */
-    face->root.max_points   += 8;
-    face->root.max_contours += 4;
+    face->root.internal->max_points   += 8;
+    face->root.internal->max_contours += 4;
 
     FT_TRACE2(( "MAXP loaded.\n" ));
 
diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c
index c54bb7e..a9c19bf 100644
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -1127,8 +1127,8 @@
       glyph->outline.flags &= ~ft_outline_single_pass;
 
       /* copy outline to our glyph slot */
-      FT_GlyphLoader_Copy_Points( glyph->loader, loader->gloader );
-      glyph->outline = glyph->loader->base.outline;
+      FT_GlyphLoader_Copy_Points( glyph->internal->loader, loader->gloader );
+      glyph->outline = glyph->internal->loader->base.outline;
 
       /* translate array so that (0,0) is the glyph's origin */
       FT_Outline_Translate( &glyph->outline, -loader->pp1.x, 0 );
diff --git a/src/type1/t1gload.c b/src/type1/t1gload.c
index ff53d14..e6bd317 100644
--- a/src/type1/t1gload.c
+++ b/src/type1/t1gload.c
@@ -214,11 +214,14 @@
       /* advance width                                           */
       if ( load_flags & FT_LOAD_NO_RECURSE )
       {
+        FT_Slot_Internal  internal = glyph->root.internal;
+        
+        
         glyph->root.metrics.horiBearingX = decoder.builder.left_bearing.x;
         glyph->root.metrics.horiAdvance  = decoder.builder.advance.x;
-        glyph->root.glyph_matrix         = font_matrix;
-        glyph->root.glyph_delta          = font_offset;
-        glyph->root.glyph_transformed    = 1;
+        internal->glyph_matrix         = font_matrix;
+        internal->glyph_delta          = font_offset;
+        internal->glyph_transformed    = 1;
       }
       else
       {
@@ -229,7 +232,7 @@
         /* copy the _unscaled_ advance width */
         metrics->horiAdvance          = decoder.builder.advance.x;
         glyph->root.linearHoriAdvance = decoder.builder.advance.x;
-/*        glyph->root.transformed       = 0; */
+        glyph->root.internal->glyph_transformed = 0;
 
         /* make up vertical metrics */
         metrics->vertBearingX = 0;
diff --git a/src/type1/t1objs.c b/src/type1/t1objs.c
index 2771b72..d586594 100644
--- a/src/type1/t1objs.c
+++ b/src/type1/t1objs.c
@@ -292,8 +292,8 @@
       root->underline_position  = face->type1.font_info.underline_position;
       root->underline_thickness = face->type1.font_info.underline_thickness;
 
-      root->max_points   = 0;
-      root->max_contours = 0;
+      root->internal->max_points   = 0;
+      root->internal->max_contours = 0;
     }
 
     /* charmap support -- synthetize unicode charmap if possible */