w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

ttgload.c
Go to the documentation of this file.
1 /*******************************************************************
2  *
3  * ttgload.c 1.0
4  *
5  * TrueType Glyph Loader.
6  *
7  * Copyright 1996-2000 by
8  * David Turner, Robert Wilhelm, and Werner Lemberg.
9  *
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.
15  *
16  ******************************************************************/
17 
18 #include "tttypes.h"
19 #include "ttdebug.h"
20 #include "ttcalc.h"
21 #include "ttfile.h"
22 
23 #include "tttables.h"
24 #include "ttobjs.h"
25 #include "ttgload.h"
26 
27 #include "ttmemory.h"
28 #include "tttags.h"
29 #include "ttload.h"
30 
31 /* required by the tracing mode */
32 #undef TT_COMPONENT
33 #define TT_COMPONENT trace_gload
34 
35 
36 /* composite font flags */
37 
38 #define ARGS_ARE_WORDS 0x001
39 #define ARGS_ARE_XY_VALUES 0x002
40 #define ROUND_XY_TO_GRID 0x004
41 #define WE_HAVE_A_SCALE 0x008
42 /* reserved 0x010 */
43 #define MORE_COMPONENTS 0x020
44 #define WE_HAVE_AN_XY_SCALE 0x040
45 #define WE_HAVE_A_2X2 0x080
46 #define WE_HAVE_INSTR 0x100
47 #define USE_MY_METRICS 0x200
48 
49 
50 /********************************************************/
51 /* Return horizontal or vertical metrics in font units */
52 /* for a given glyph. The metrics are the left side */
53 /* bearing (resp. top side bearing) and advance width */
54 /* (resp. advance height). */
55 /* */
56 /* This function will much probably move to another */
57 /* component in the short future, but I haven't decided */
58 /* which yet... */
59 
60  FT_INTERNAL_FUNC( void )
62  UShort index,
63  Short* bearing,
64  UShort* advance )
65  {
66  PLongMetrics longs_m;
67 
68  UShort k = header->number_Of_HMetrics;
69 
70 
71  if ( index < k )
72  {
73  longs_m = (PLongMetrics)header->long_metrics + index;
74  *bearing = longs_m->bearing;
75  *advance = longs_m->advance;
76  }
77  else
78  {
79  *bearing = ((PShortMetrics)header->short_metrics)[index - k];
80  *advance = ((PLongMetrics)header->long_metrics)[k - 1].advance;
81  }
82  }
83 
84 
85 /********************************************************/
86 /* Return horizontal metrics in font units for a given */
87 /* glyph. If `check' is true, take care of mono-spaced */
88 /* fonts by returning the advance width max. */
89 
90  static void Get_HMetrics( PFace face,
91  UShort index,
92  Bool check,
93  Short* lsb,
94  UShort* aw )
95  {
96  TT_Get_Metrics( &face->horizontalHeader, index, lsb, aw );
97 
98  if ( check && face->postscript.isFixedPitch )
99  *aw = face->horizontalHeader.advance_Width_Max;
100  }
101 
102 
103 /********************************************************/
104 /* Return advance width table for a given pixel size */
105 /* if it is found in the font's `hdmx' table (if any). */
106 
108  UShort ppem )
109  {
110  UShort n;
111 
112 
113  for ( n = 0; n < face->hdmx.num_records; n++ )
114  if ( face->hdmx.records[n].ppem == ppem )
115  return face->hdmx.records[n].widths;
116 
117  return NULL;
118  }
119 
120 
121 /********************************************************/
122 /* Copy current glyph into original one. */
123 
124 #define cur_to_org( n, zone ) \
125  MEM_Copy( (zone)->org, (zone)->cur, (n) * sizeof ( TT_Vector ) )
126 
127 /********************************************************/
128 /* copy original glyph into current one */
129 
130 #define org_to_cur( n, zone ) \
131  MEM_Copy( (zone)->cur, (zone)->org, (n) * sizeof ( TT_Vector ) )
132 
133 /********************************************************/
134 /* translate an array of coordinates */
135 
136  static void translate_array( UShort n,
137  TT_Vector* coords,
138  TT_Pos delta_x,
139  TT_Pos delta_y )
140  {
141  UShort k;
142 
143 
144  if ( delta_x )
145  for ( k = 0; k < n; k++ )
146  coords[k].x += delta_x;
147 
148  if ( delta_y )
149  for ( k = 0; k < n; k++ )
150  coords[k].y += delta_y;
151  }
152 
153 
154 /********************************************************/
155 /* mount one zone on top of another */
156 
159  {
160  UShort np;
161  Short nc;
162 
163  np = source->n_points;
164  nc = source->n_contours;
165 
166  target->org = source->org + np;
167  target->cur = source->cur + np;
168  target->touch = source->touch + np;
169 
170  target->contours = source->contours + nc;
171 
172  target->n_points = 0;
173  target->n_contours = 0;
174  }
175 
176 
177 /*******************************************************************
178  *
179  * Function: Load_Simple_Glyph
180  *
181  ******************************************************************/
182 
185  Short n_contours,
186  Short left_contours,
187  UShort left_points,
188  UShort load_flags,
189  PSubglyph_Record subg )
190  {
192 
193  PGlyph_Zone pts;
194  Short k;
195  UShort j;
196  UShort n_points, n_ins;
197  PFace face;
198  Byte* flag;
199  TT_Vector* vec;
200  TT_F26Dot6 x, y;
201 
202 
203  face = exec->face;
204 
205  /* simple check */
206  if ( n_contours > left_contours )
207  {
208  PTRACE0(( "ERROR: Glyph index %ld has %d contours > left %d\n",
209  subg->index, n_contours, left_contours ));
211  }
212 
213 
214  /* preparing the execution context */
215  mount_zone( &subg->zone, &exec->pts );
216 
217  /* reading the contours endpoints */
218  if ( ACCESS_Frame( (n_contours + 1) * 2L ) )
219  return error;
220 
221  PTRACE4(( " Contour endpoints:" ));
222 
223  for ( k = 0; k < n_contours; k++ )
224  {
225  exec->pts.contours[k] = GET_UShort();
226  PTRACE4(( " %d", exec->pts.contours[k] ));
227  }
228  PTRACE4(( "\n" ));
229 
230  if ( n_contours > 0 )
231  n_points = exec->pts.contours[n_contours - 1] + 1;
232  else
233  n_points = 0;
234 
235  n_ins = GET_UShort();
236 
237  FORGET_Frame();
238 
239  if ( n_points > left_points )
240  {
241  PTRACE0(( "ERROR: Too many points in glyph %ld\n", subg->index ));
242  return TT_Err_Too_Many_Points;
243  }
244 
245  /* loading instructions */
246 
247  PTRACE4(( " Instructions size: %d\n", n_ins ));
248 
249  if ( n_ins > face->maxProfile.maxSizeOfInstructions )
250  {
251  PTRACE0(( "ERROR: Too many instructions!\n" ));
252  return TT_Err_Too_Many_Ins;
253  }
254 
255  if ( FILE_Read( exec->glyphIns, n_ins ) )
256  return error;
257 
258  if ( (error = Set_CodeRange( exec,
260  exec->glyphIns,
261  n_ins )) != TT_Err_Ok )
262  return error;
263 
264 
265  /* read the flags */
266 
267  if ( CHECK_AND_ACCESS_Frame( n_points * 5L ) )
268  return error;
269 
270  j = 0;
271  flag = exec->pts.touch;
272 
273  while ( j < n_points )
274  {
275  Byte c, cnt;
276 
277  flag[j] = c = GET_Byte();
278  j++;
279 
280  if ( c & 8 )
281  {
282  cnt = GET_Byte();
283  while( cnt > 0 )
284  {
285  flag[j++] = c;
286  cnt--;
287  }
288  }
289  }
290 
291  /* read the X */
292 
293  x = 0;
294  vec = exec->pts.org;
295 
296  for ( j = 0; j < n_points; j++ )
297  {
298  if ( flag[j] & 2 )
299  {
300  if ( flag[j] & 16 )
301  x += GET_Byte();
302  else
303  x -= GET_Byte();
304  }
305  else
306  {
307  if ( (flag[j] & 16) == 0 )
308  x += GET_Short();
309  }
310 
311  vec[j].x = x;
312  }
313 
314 
315  /* read the Y */
316 
317  y = 0;
318 
319  for ( j = 0; j < n_points; j++ )
320  {
321  if ( flag[j] & 4 )
322  {
323  if ( flag[j] & 32 )
324  y += GET_Byte();
325  else
326  y -= GET_Byte();
327  }
328  else
329  {
330  if ( (flag[j] & 32) == 0 )
331  y += GET_Short();
332  }
333 
334  vec[j].y = y;
335  }
336 
337  FORGET_Frame();
338  /* Now add the two shadow points at n and n + 1. */
339  /* We need the left side bearing and advance width. */
340 
341  /* pp1 = xMin - lsb */
342  vec[n_points].x = subg->metrics.bbox.xMin - subg->metrics.horiBearingX;
343  vec[n_points].y = 0;
344 
345  /* pp2 = pp1 + aw */
346  vec[n_points+1].x = vec[n_points].x + subg->metrics.horiAdvance;
347  vec[n_points+1].y = 0;
348 
349  /* clear the touch flags */
350 
351  for ( j = 0; j < n_points; j++ )
352  exec->pts.touch[j] &= TT_Flag_On_Curve;
353 
354  exec->pts.touch[n_points ] = 0;
355  exec->pts.touch[n_points + 1] = 0;
356 
357  /* Note that we return two more points that are not */
358  /* part of the glyph outline. */
359 
360  n_points += 2;
361 
362  /* now eventually scale and hint the glyph */
363 
364  pts = &exec->pts;
365  pts->n_points = n_points;
366  pts->n_contours = n_contours;
367 
368  if ( (load_flags & TTLOAD_SCALE_GLYPH) == 0 )
369  {
370  /* no scaling, just copy the orig arrays into the cur ones */
371  org_to_cur( n_points, pts );
372  }
373  else
374  {
375  /* first scale the glyph points */
376 
377  for ( j = 0; j < n_points; j++ )
378  {
379  pts->org[j].x = Scale_X( &exec->metrics, pts->org[j].x );
380  pts->org[j].y = Scale_Y( &exec->metrics, pts->org[j].y );
381  }
382 
383  /* if hinting, round pp1, and shift the glyph accordingly */
384  if ( subg->is_hinted )
385  {
386  x = pts->org[n_points - 2].x;
387  x = ((x+32) & -64) - x;
388  translate_array( n_points, pts->org, x, 0 );
389 
390  org_to_cur( n_points, pts );
391 
392  pts->cur[n_points - 1].x = (pts->cur[n_points - 1].x + 32) & -64;
393 
394  /* now consider hinting */
395  if ( n_ins > 0 )
396  {
397  exec->is_composite = FALSE;
398  exec->pedantic_hinting = load_flags & TTLOAD_PEDANTIC;
399 
400  error = Context_Run( exec, FALSE );
401  if (error && exec->pedantic_hinting)
402  return error;
403  }
404  }
405  else
406  org_to_cur( n_points, pts );
407  }
408 
409  /* save glyph phantom points */
410  if (!subg->preserve_pps)
411  {
412  subg->pp1 = pts->cur[n_points - 2];
413  subg->pp2 = pts->cur[n_points - 1];
414  }
415 
416  return TT_Err_Ok;
417  }
418 
419 
420 /*******************************************************************
421  *
422  * Function : Load_Composite_End
423  *
424  ******************************************************************/
425 
426  static
428  Short n_contours,
429  PExecution_Context exec,
430  PSubglyph_Record subg,
431  UShort load_flags,
432  TT_Stream input )
433  {
435 
436  UShort k, n_ins;
437  PGlyph_Zone pts;
438 
439 
440  if ( subg->is_hinted &&
441  subg->element_flag & WE_HAVE_INSTR )
442  {
443  if ( ACCESS_Frame( 2L ) )
444  return error;
445 
446  n_ins = GET_UShort(); /* read size of instructions */
447  FORGET_Frame();
448 
449  PTRACE4(( " Instructions size: %d\n", n_ins ));
450 
451  if ( n_ins > exec->face->maxProfile.maxSizeOfInstructions )
452  {
453  PTRACE0(( "ERROR: Too many instructions in composite glyph %ld\n",
454  subg->index ));
455  return TT_Err_Too_Many_Ins;
456  }
457 
458  if ( FILE_Read( exec->glyphIns, n_ins ) )
459  return error;
460 
461  error = Set_CodeRange( exec,
463  exec->glyphIns,
464  n_ins );
465 
466  if ( error )
467  return error;
468  }
469  else
470  n_ins = 0;
471 
472 
473  /* prepare the execution context */
474  n_points += 2;
475  exec->pts = subg->zone;
476  pts = &exec->pts;
477 
478  pts->n_points = n_points;
479  pts->n_contours = n_contours;
480 
481  /* add phantom points */
482  pts->cur[n_points - 2] = subg->pp1;
483  pts->cur[n_points - 1] = subg->pp2;
484 
485  pts->touch[n_points - 1] = 0;
486  pts->touch[n_points - 2] = 0;
487 
488  /* if hinting, round the phantom points */
489  if ( subg->is_hinted )
490  {
491  pts->cur[n_points - 2].x = (subg->pp1.x + 32) & -64;
492  pts->cur[n_points - 1].x = (subg->pp2.x + 32) & -64;
493  }
494 
495  for ( k = 0; k < n_points; k++ )
496  pts->touch[k] &= TT_Flag_On_Curve;
497 
498  cur_to_org( n_points, pts );
499 
500  /* now consider hinting */
501  if ( subg->is_hinted && n_ins > 0 )
502  {
503  exec->is_composite = TRUE;
504  exec->pedantic_hinting = load_flags & TTLOAD_PEDANTIC;
505 
506  error = Context_Run( exec, FALSE );
507  if (error && exec->pedantic_hinting)
508  return error;
509  }
510 
511  /* save glyph origin and advance points */
512  subg->pp1 = pts->cur[n_points - 2];
513  subg->pp2 = pts->cur[n_points - 1];
514 
515  return TT_Err_Ok;
516  }
517 
518 
519 /*******************************************************************
520  *
521  * Function : Init_Glyph_Component
522  *
523  ******************************************************************/
524 
525  static
528  PExecution_Context exec )
529  {
530  element->index = -1;
531  element->is_scaled = FALSE;
532  element->is_hinted = FALSE;
533 
534  if ( original )
535  mount_zone( &original->zone, &element->zone );
536  else
537  element->zone = exec->pts;
538 
539  element->zone.n_contours = 0;
540  element->zone.n_points = 0;
541 
542  element->arg1 = 0;
543  element->arg2 = 0;
544 
545  element->element_flag = 0;
546  element->preserve_pps = FALSE;
547 
548  element->transform.xx = 1L << 16;
549  element->transform.xy = 0;
550  element->transform.yx = 0;
551  element->transform.yy = 1L << 16;
552 
553  element->transform.ox = 0;
554  element->transform.oy = 0;
555 
556  element->metrics.horiBearingX = 0;
557  element->metrics.horiAdvance = 0;
558  }
559 
560 
563  PGlyph glyph,
565  UShort load_flags )
566  {
567  enum TPhases_
568  {
569  Load_Exit,
570  Load_Glyph,
571  Load_Header,
572  Load_Simple,
573  Load_Composite,
574  Load_End
575  };
576 
577  typedef enum TPhases_ TPhases;
578 
580 
581  PFace face;
582 
583  UShort num_points;
584  Short num_contours;
585  UShort left_points;
586  Short left_contours;
587  UShort num_elem_points;
588 
589  Long table;
590  UShort load_top;
591  Long k, l;
592  UShort new_flags;
593  Long index;
594  UShort u, v;
595 
596  Long glyph_offset, offset;
597 
598  TT_F26Dot6 x, y, nx, ny;
599 
600  Fixed xx, xy, yx, yy;
601 
602  PExecution_Context exec;
603 
604  PSubglyph_Record subglyph, subglyph2;
605 
606  TGlyph_Zone base_pts;
607 
608  TPhases phase;
609  PByte widths;
610 
611 /* TT_Glyph_Loader_Callback cacheCb; */
612 /* TT_Outline cached_outline; */
613 
614 
615  /* first of all, check arguments */
616  if ( !glyph )
618 
619  face = glyph->face;
620  if ( !face )
622 
623  if ( glyph_index >= face->numGlyphs )
625 
626  if ( instance && (load_flags & TTLOAD_SCALE_GLYPH) == 0 )
627  {
628  instance = 0;
629  load_flags &= ~( TTLOAD_SCALE_GLYPH | TTLOAD_HINT_GLYPH );
630  }
631 
633  if ( table < 0 )
634  {
635  PTRACE0(( "ERROR: There is no glyph table in this font file!\n" ));
637  }
638 
639  glyph_offset = face->dirTables[table].Offset;
640 
641  /* query new execution context */
642 
643  if ( instance && instance->debug )
644  exec = instance->context;
645  else
646  exec = New_Context( face );
647 
648  if ( !exec )
650 
651  Context_Load( exec, face, instance );
652 
653  if ( instance )
654  {
655  if ( instance->GS.instruct_control & 2 )
656  exec->GS = Default_GraphicsState;
657  else
658  exec->GS = instance->GS;
659  /* load default graphics state */
660 
661  glyph->outline.high_precision = ( instance->metrics.y_ppem < 24 );
662  }
663 
664  /* save its critical pointers, as they'll be modified during load */
665  base_pts = exec->pts;
666 
667  /* init variables */
668  left_points = face->maxPoints;
669  left_contours = face->maxContours;
670 
671  num_points = 0;
672  num_contours = 0;
673 
674  load_top = 0;
675  subglyph = exec->loadStack;
676 
677  Init_Glyph_Component( subglyph, NULL, exec );
678 
679  subglyph->index = glyph_index;
680  subglyph->is_hinted = load_flags & TTLOAD_HINT_GLYPH;
681 
682  /* when the cvt program has disabled hinting, the argument */
683  /* is ignored. */
684  if ( instance && instance->GS.instruct_control & 1 )
685  subglyph->is_hinted = FALSE;
686 
687 
688  /* now access stream */
689 
690  if ( USE_Stream( face->stream, stream ) )
691  goto Fin;
692 
693  /* Main loading loop */
694 
695  phase = Load_Glyph;
696  index = 0;
697 
698  while ( phase != Load_Exit )
699  {
700  subglyph = exec->loadStack + load_top;
701 
702  switch ( phase )
703  {
704  /************************************************************/
705  /* */
706  /* Load_Glyph state */
707  /* */
708  /* reading a glyph's generic header to determine */
709  /* whether it's simple or composite */
710  /* */
711  /* exit states: Load_Header and Load_End */
712 
713  case Load_Glyph:
714  /* check glyph index and table */
715 
716  index = subglyph->index;
717  if ( index < 0 || index >= face->numGlyphs )
718  {
720  goto Fail;
721  }
722 
723  /* get horizontal metrics */
724 
725  {
726  Short left_bearing;
727  UShort advance_width;
728 
729 
731  !(load_flags & TTLOAD_IGNORE_GLOBAL_ADVANCE_WIDTH),
732  &left_bearing,
733  &advance_width );
734 
735  subglyph->metrics.horiBearingX = left_bearing;
736  subglyph->metrics.horiAdvance = advance_width;
737  }
738 
739  phase = Load_Header;
740 
741 
742  /* The cache callback isn't part of the FreeType release yet */
743  /* It is discarded for the moment.. */
744  /* */
745 #if 0
746  if ( instance )
747  {
748  /* is the glyph in an outline cache ? */
749  cacheCb = instance->owner->engine->glCallback;
750  if ( cacheCb && 0 ) /* disabled */
751  {
752  /* we have a callback */
753  error = cacheCb( instance->generic,
754  index, &cached_outline, &x, &y );
755  if ( !error )
756  {
757  /* no error, then append the outline to the current subglyph */
758  /* error = Append_Outline( subglyph,
759  &left_points,
760  &left_contours,
761  &cached_outline ); */
762  phase = Load_End;
763  }
764  }
765  }
766 #endif
767  break;
768 
769 
770  /************************************************************/
771  /* */
772  /* Load_Header state */
773  /* */
774  /* reading a glyph's generic header to determine */
775  /* wether it's simple or composite */
776  /* */
777  /* exit states: Load_Simple and Load_Composite */
778  /* */
779 
780  case Load_Header: /* load glyph */
781 
782  if ( (TT_UInt)( index + 1 ) < (TT_UInt)face->numLocations &&
783  face->glyphLocations[index] == face->glyphLocations[index + 1] )
784  {
785  /* as described by Frederic Loyer, these are spaces, and */
786  /* not the unknown glyph. */
787 
788  num_contours = 0;
789  num_points = 0;
790 
791  subglyph->metrics.bbox.xMin = 0;
792  subglyph->metrics.bbox.xMax = 0;
793  subglyph->metrics.bbox.yMin = 0;
794  subglyph->metrics.bbox.yMax = 0;
795 
796  subglyph->pp1.x = 0;
797  subglyph->pp2.x = subglyph->metrics.horiAdvance;
798  if (load_flags & TTLOAD_SCALE_GLYPH)
799  subglyph->pp2.x = Scale_X( &exec->metrics, subglyph->pp2.x );
800 
801  exec->glyphSize = 0;
802  phase = Load_End;
803  break;
804  }
805 
806  offset = glyph_offset + face->glyphLocations[index];
807 
808  /* read first glyph header */
809  if ( FILE_Seek( offset ) ||
810  ACCESS_Frame( 10L ) )
811  goto Fail_File;
812 
813  num_contours = GET_Short();
814 
815  subglyph->metrics.bbox.xMin = GET_Short();
816  subglyph->metrics.bbox.yMin = GET_Short();
817  subglyph->metrics.bbox.xMax = GET_Short();
818  subglyph->metrics.bbox.yMax = GET_Short();
819 
820  FORGET_Frame();
821 
822  PTRACE6(( "Glyph %ld:\n", index ));
823  PTRACE6(( " # of contours: %d\n", num_contours ));
824  PTRACE6(( " xMin: %4d xMax: %4d\n",
825  subglyph->metrics.bbox.xMin,
826  subglyph->metrics.bbox.xMax ));
827  PTRACE6(( " yMin: %4d yMax: %4d\n",
828  subglyph->metrics.bbox.yMin,
829  subglyph->metrics.bbox.yMax ));
830 
831  if ( num_contours > left_contours )
832  {
833  PTRACE0(( "ERROR: Too many contours for glyph %ld\n", index ));
835  goto Fail;
836  }
837 
838  subglyph->pp1.x = subglyph->metrics.bbox.xMin -
839  subglyph->metrics.horiBearingX;
840  subglyph->pp1.y = 0;
841  subglyph->pp2.x = subglyph->pp1.x + subglyph->metrics.horiAdvance;
842  if (load_flags & TTLOAD_SCALE_GLYPH)
843  {
844  subglyph->pp1.x = Scale_X( &exec->metrics, subglyph->pp1.x );
845  subglyph->pp2.x = Scale_X( &exec->metrics, subglyph->pp2.x );
846  }
847 
848  /* is it a simple glyph ? */
849  if ( num_contours > 0 )
850  phase = Load_Simple;
851  else
852  phase = Load_Composite;
853 
854  break;
855 
856 
857  /************************************************************/
858  /* */
859  /* Load_Simple state */
860  /* */
861  /* reading a simple glyph (num_contours must be set to */
862  /* the glyph's number of contours.) */
863  /* */
864  /* exit states : Load_End */
865  /* */
866 
867  case Load_Simple:
868  new_flags = load_flags;
869 
870  /* disable hinting when scaling */
871  if ( !subglyph->is_hinted )
872  new_flags &= ~~TTLOAD_HINT_GLYPH;
873 
874  error = Load_Simple_Glyph( exec,
875  stream,
876  num_contours,
877  left_contours,
878  left_points,
879  new_flags,
880  subglyph );
881  if ( error )
882  goto Fail;
883 
884  /* Note: We could have put the simple loader source there */
885  /* but the code is fat enough already :-) */
886 
887  num_points = exec->pts.n_points - 2;
888 
889  phase = Load_End;
890 
891  break;
892 
893 
894  /************************************************************/
895  /* */
896  /* Load_Composite state */
897  /* */
898  /* reading a composite glyph header a pushing a new */
899  /* load element on the stack. */
900  /* */
901  /* exit states: Load_Glyph */
902  /* */
903 
904  case Load_Composite:
905 
906  /* create a new element on the stack */
907  load_top++;
908 
909  if ( load_top > face->maxComponents )
910  {
912  goto Fail;
913  }
914 
915  subglyph2 = exec->loadStack + load_top;
916 
917  Init_Glyph_Component( subglyph2, subglyph, NULL );
918  subglyph2->is_hinted = subglyph->is_hinted;
919 
920  /* now read composite header */
921 
922  if ( ACCESS_Frame( 4L ) )
923  goto Fail_File;
924 
925  subglyph->element_flag = new_flags = GET_UShort();
926 
927  subglyph2->index = GET_UShort();
928 
929  FORGET_Frame();
930 
931  k = 1 + 1;
932 
933  if ( new_flags & ARGS_ARE_WORDS )
934  k *= 2;
935 
936  if ( new_flags & WE_HAVE_A_SCALE )
937  k += 2;
938 
939  else if ( new_flags & WE_HAVE_AN_XY_SCALE )
940  k += 4;
941 
942  else if ( new_flags & WE_HAVE_A_2X2 )
943  k += 8;
944 
945  if ( ACCESS_Frame( k ) )
946  goto Fail_File;
947 
948  if ( new_flags & ARGS_ARE_WORDS )
949  {
950  k = GET_Short();
951  l = GET_Short();
952  }
953  else
954  {
955  k = GET_Char();
956  l = GET_Char();
957  }
958 
959  subglyph->arg1 = k;
960  subglyph->arg2 = l;
961 
962  if ( new_flags & ARGS_ARE_XY_VALUES )
963  {
964  subglyph->transform.ox = k;
965  subglyph->transform.oy = l;
966  }
967 
968  xx = 1L << 16;
969  xy = 0;
970  yx = 0;
971  yy = 1L << 16;
972 
973  if ( new_flags & WE_HAVE_A_SCALE )
974  {
975  xx = (Fixed)GET_Short() << 2;
976  yy = xx;
977  subglyph2->is_scaled = TRUE;
978  }
979  else if ( new_flags & WE_HAVE_AN_XY_SCALE )
980  {
981  xx = (Fixed)GET_Short() << 2;
982  yy = (Fixed)GET_Short() << 2;
983  subglyph2->is_scaled = TRUE;
984  }
985  else if ( new_flags & WE_HAVE_A_2X2 )
986  {
987  xx = (Fixed)GET_Short() << 2;
988  xy = (Fixed)GET_Short() << 2;
989  yx = (Fixed)GET_Short() << 2;
990  yy = (Fixed)GET_Short() << 2;
991  subglyph2->is_scaled = TRUE;
992  }
993 
994  FORGET_Frame();
995 
996  subglyph->transform.xx = xx;
997  subglyph->transform.xy = xy;
998  subglyph->transform.yx = yx;
999  subglyph->transform.yy = yy;
1000 
1001  k = TT_MulFix( xx, yy ) - TT_MulFix( xy, yx );
1002 
1003  /* disable hinting in case of scaling/slanting */
1004  if ( ABS( k ) != (1L << 16) )
1005  subglyph2->is_hinted = FALSE;
1006 
1007  subglyph->file_offset = FILE_Pos();
1008 
1009  phase = Load_Glyph;
1010 
1011  break;
1012 
1013 
1014  /************************************************************/
1015  /* */
1016  /* Load_End state */
1017  /* */
1018  /* after loading a glyph, apply transformation and offset */
1019  /* where necessary, pops element and continue or */
1020  /* stop process. */
1021  /* */
1022  /* exit states : Load_Composite and Load_Exit */
1023  /* */
1024 
1025  case Load_End:
1026  if ( load_top > 0 )
1027  {
1028  subglyph2 = subglyph;
1029 
1030  load_top--;
1031  subglyph = exec->loadStack + load_top;
1032 
1033  /* check advance width and left side bearing */
1034 
1035  if ( !subglyph->preserve_pps &&
1036  subglyph->element_flag & USE_MY_METRICS )
1037  {
1038  subglyph->metrics.horiBearingX = subglyph2->metrics.horiBearingX;
1039  subglyph->metrics.horiAdvance = subglyph2->metrics.horiAdvance;
1040 
1041  subglyph->pp1 = subglyph2->pp1;
1042  subglyph->pp2 = subglyph2->pp2;
1043 
1044  subglyph->preserve_pps = TRUE;
1045  }
1046 
1047  /* apply scale */
1048 
1049  if ( subglyph2->is_scaled )
1050  {
1051  TT_Vector* cur = subglyph2->zone.cur;
1052  TT_Vector* org = subglyph2->zone.org;
1053 
1054  for ( u = 0; u < num_points; u++ )
1055  {
1056  nx = TT_MulFix( cur->x, subglyph->transform.xx ) +
1057  TT_MulFix( cur->y, subglyph->transform.yx );
1058 
1059  ny = TT_MulFix( cur->x, subglyph->transform.xy ) +
1060  TT_MulFix( cur->y, subglyph->transform.yy );
1061 
1062  cur->x = nx;
1063  cur->y = ny;
1064 
1065  nx = TT_MulFix( org->x, subglyph->transform.xx ) +
1066  TT_MulFix( org->y, subglyph->transform.yx );
1067 
1068  ny = TT_MulFix( org->x, subglyph->transform.xy ) +
1069  TT_MulFix( org->y, subglyph->transform.yy );
1070 
1071  org->x = nx;
1072  org->y = ny;
1073 
1074  cur++;
1075  org++;
1076  }
1077  }
1078 
1079  /* adjust counts */
1080 
1081  num_elem_points = subglyph->zone.n_points;
1082 
1083  for ( k = 0; k < num_contours; k++ )
1084  subglyph2->zone.contours[k] += num_elem_points;
1085 
1086  subglyph->zone.n_points += num_points;
1087  subglyph->zone.n_contours += num_contours;
1088 
1089  left_points -= num_points;
1090  left_contours -= num_contours;
1091 
1092  if ( !(subglyph->element_flag & ARGS_ARE_XY_VALUES) )
1093  {
1094  /* move second glyph according to control points */
1095  /* the attach points are relative to the specific component */
1096 
1097  u = (UShort)subglyph->arg1;
1098  v = (UShort)subglyph->arg2;
1099 
1100  if ( u >= num_elem_points ||
1101  v >= num_points )
1102  {
1104  goto Fail;
1105  }
1106 
1107  /* adjust count */
1108  v += num_elem_points;
1109 
1110  x = subglyph->zone.cur[u].x - subglyph->zone.cur[v].x;
1111  y = subglyph->zone.cur[u].y - subglyph->zone.cur[v].y;
1112  }
1113  else
1114  {
1115  /* apply offset */
1116 
1117  x = subglyph->transform.ox;
1118  y = subglyph->transform.oy;
1119 
1120  if ( load_flags & TTLOAD_SCALE_GLYPH )
1121  {
1122  x = Scale_X( &exec->metrics, x );
1123  y = Scale_Y( &exec->metrics, y );
1124 
1125  if ( subglyph->element_flag & ROUND_XY_TO_GRID )
1126  {
1127  x = (x+32) & -64;
1128  y = (y+32) & -64;
1129  }
1130  }
1131  }
1132 
1133  translate_array( num_points, subglyph2->zone.cur, x, y );
1134 
1135  cur_to_org( num_points, &subglyph2->zone );
1136 
1137  num_points = subglyph->zone.n_points;
1138  num_contours = subglyph->zone.n_contours;
1139 
1140  /* check for last component */
1141 
1142  if ( FILE_Seek( subglyph->file_offset ) )
1143  goto Fail_File;
1144 
1145  if ( subglyph->element_flag & MORE_COMPONENTS )
1146  phase = Load_Composite;
1147  else
1148  {
1149  error = Load_Composite_End( num_points,
1150  num_contours,
1151  exec,
1152  subglyph,
1153  load_flags,
1154  stream );
1155  if ( error )
1156  goto Fail;
1157 
1158  phase = Load_End;
1159  }
1160  }
1161  else
1162  phase = Load_Exit;
1163 
1164  break;
1165 
1166 
1167  case Load_Exit:
1168  break;
1169  }
1170  }
1171 
1172  /* finally, copy the points arrays to the glyph object */
1173 
1174  exec->pts = base_pts;
1175 
1176  for ( u = 0; u < num_points + 2; u++ )
1177  {
1178  glyph->outline.points[u] = exec->pts.cur[u];
1179  glyph->outline.flags [u] = exec->pts.touch[u];
1180  }
1181 
1182  for ( k = 0; k < num_contours; k++ )
1183  glyph->outline.contours[k] = exec->pts.contours[k];
1184 
1185  glyph->outline.n_points = num_points;
1186  glyph->outline.n_contours = num_contours;
1187  glyph->outline.second_pass = TRUE;
1188 
1189  /* translate array so that (0,0) is the glyph's origin */
1190  translate_array( num_points + 2,
1191  glyph->outline.points,
1192  -subglyph->pp1.x,
1193  0 );
1194 
1195  TT_Get_Outline_BBox( &glyph->outline, &glyph->metrics.bbox );
1196 
1197  if ( subglyph->is_hinted )
1198  {
1199  /* grid-fit the bounding box */
1200  glyph->metrics.bbox.xMin &= -64;
1201  glyph->metrics.bbox.yMin &= -64;
1202  glyph->metrics.bbox.xMax = (glyph->metrics.bbox.xMax+63) & -64;
1203  glyph->metrics.bbox.yMax = (glyph->metrics.bbox.yMax+63) & -64;
1204  }
1205 
1206  /* get the device-independent scaled horizontal metrics */
1207  /* take care of fixed-pitch fonts... */
1208  {
1209  TT_Pos left_bearing;
1210  TT_Pos advance;
1211 
1212 
1213  left_bearing = subglyph->metrics.horiBearingX;
1214  advance = subglyph->metrics.horiAdvance;
1215 
1216  if ( face->postscript.isFixedPitch )
1217  advance = face->horizontalHeader.advance_Width_Max;
1218 
1219  if ( load_flags & TTLOAD_SCALE_GLYPH )
1220  {
1221  left_bearing = Scale_X( &exec->metrics, left_bearing );
1222  advance = Scale_X( &exec->metrics, advance );
1223  }
1224 
1225  glyph->metrics.linearHoriBearingX = left_bearing;
1226  glyph->metrics.linearHoriAdvance = advance;
1227  }
1228 
1229  glyph->metrics.horiBearingX = glyph->metrics.bbox.xMin;
1230  glyph->metrics.horiBearingY = glyph->metrics.bbox.yMax;
1231  glyph->metrics.horiAdvance = subglyph->pp2.x - subglyph->pp1.x;
1232 
1233  /* Now take care of vertical metrics. In the case where there is */
1234  /* no vertical information within the font (relatively common), make */
1235  /* up some metrics `by hand' ... */
1236 
1237  {
1238  Short top_bearing; /* vertical top side bearing (EM units) */
1239  UShort advance_height; /* vertical advance height (EM units) */
1240 
1241  TT_Pos left; /* scaled vertical left side bearing */
1242  TT_Pos orig_top; /* scaled original vertical top side bearing */
1243  TT_Pos top; /* scaled vertical top side bearing */
1244  TT_Pos advance; /* scaled vertical advance height */
1245 
1246 
1247  /* Get the unscaled `tsb' and `ah' values */
1248  if ( face->verticalInfo &&
1249  face->verticalHeader.number_Of_VMetrics > 0 )
1250  {
1251  /* Don't assume that both the vertical header and vertical */
1252  /* metrics are present in the same font :-) */
1253 
1254  TT_Get_Metrics( (TT_Horizontal_Header*)&face->verticalHeader,
1255  glyph_index,
1256  &top_bearing,
1257  &advance_height );
1258  }
1259  else
1260  {
1261 
1262  /* Make up the distances from the horizontal header.. */
1263 
1264  /* NOTE: The OS/2 values are the only `portable' ones, */
1265  /* which is why we use them... */
1266  /* */
1267  /* NOTE2: The sTypoDescender is negative, which is why */
1268  /* we compute the baseline-to-baseline distance */
1269  /* here with : */
1270  /* ascender - descender + linegap */
1271  /* */
1272 
1273 /* XXX What happens here with these Apple fonts without OS/2 table ? */
1274 
1275  top_bearing = (Short) (face->os2.sTypoLineGap / 2);
1276  advance_height = (UShort)(face->os2.sTypoAscender -
1277  face->os2.sTypoDescender +
1278  face->os2.sTypoLineGap);
1279  }
1280 
1281  /* We must adjust the top_bearing value from the bounding box */
1282  /* given in the glyph header to te bounding box calculated with */
1283  /* TT_Get_Outline_BBox() */
1284 
1285  /* scale the metrics */
1286  if ( load_flags & TTLOAD_SCALE_GLYPH )
1287  {
1288  orig_top = Scale_Y( &exec->metrics, top_bearing );
1289  top = Scale_Y( &exec->metrics,
1290  top_bearing + subglyph->metrics.bbox.yMax ) -
1291  glyph->metrics.bbox.yMax;
1292  advance = Scale_Y( &exec->metrics, advance_height );
1293  }
1294  else
1295  {
1296  orig_top = top_bearing;
1297  top = top_bearing + subglyph->metrics.bbox.yMax -
1298  glyph->metrics.bbox.yMax;
1299  advance = advance_height;
1300  }
1301 
1302  glyph->metrics.linearVertBearingY = orig_top;
1303  glyph->metrics.linearVertAdvance = advance;
1304 
1305  /* XXX : for now, we have no better algo for the lsb, but it should */
1306  /* work ok.. */
1307  /* */
1308  left = ( glyph->metrics.bbox.xMin - glyph->metrics.bbox.xMax ) / 2;
1309 
1310  /* grid-fit them if necessary */
1311  if ( subglyph->is_hinted )
1312  {
1313  left &= -64;
1314  top = (top + 63) & -64;
1315  advance = (advance + 32) & -64;
1316  }
1317 
1318  glyph->metrics.vertBearingX = left;
1319  glyph->metrics.vertBearingY = top;
1320  glyph->metrics.vertAdvance = advance;
1321  }
1322 
1323  /* Adjust advance width to the value contained in the hdmx table. */
1324  if ( !exec->face->postscript.isFixedPitch && instance &&
1325  subglyph->is_hinted )
1326  {
1327  widths = Get_Advance_Widths( exec->face,
1328  exec->instance->metrics.x_ppem );
1329  if ( widths )
1330  glyph->metrics.horiAdvance = widths[glyph_index] << 6;
1331  }
1332 
1333  glyph->outline.dropout_mode = (Char)exec->GS.scan_type;
1334 
1335  error = TT_Err_Ok;
1336 
1337  Fail_File:
1338  Fail:
1339  DONE_Stream( stream );
1340 
1341  Fin:
1342 
1343  /* reset the execution context */
1344  exec->pts = base_pts;
1345 
1346  if ( !instance || !instance->debug )
1347  Done_Context( exec );
1348 
1349  return error;
1350  }
1351 
1352 
1353 /* END */
struct @88 table[500]
#define advance
Definition: aptex-macros.h:464
static point_t cur
Definition: backend_eps.c:108
#define check(T, S)
#define Fixed
#define n
Definition: t4ht.c:1290
@ FALSE
Definition: dd.h:101
@ TRUE
Definition: dd.h:102
int v
Definition: dviconv.c:10
static int np
Definition: bifont.c:64
static int xx[600]
Definition: psspecial.c:35
static int yy[600]
Definition: psspecial.c:35
#define error(a)
Definition: dviinfo.c:48
long int flag
Definition: f2c.h:53
FcElement element
Definition: fcxml.c:418
#define TT_Err_Could_Not_Find_Context
Definition: fterrid.h:143
#define TT_Err_Invalid_Glyph_Handle
Definition: fterrid.h:41
#define TT_Err_Too_Many_Points
Definition: fterrid.h:100
#define TT_Err_Invalid_Glyph_Index
Definition: fterrid.h:44
#define TT_Err_Ok
Definition: fterrid.h:34
#define TT_Err_Too_Many_Contours
Definition: fterrid.h:101
#define TT_Err_Glyf_Table_Missing
Definition: fterrid.h:73
#define TT_Err_Invalid_Composite
Definition: fterrid.h:102
#define TT_Err_Too_Many_Ins
Definition: fterrid.h:103
#define c(n)
Definition: gpos-common.c:150
unsigned char Bool
Definition: bzip2.c:162
long TT_Error
Definition: freetype.h:664
#define TTLOAD_SCALE_GLYPH
Definition: freetype.h:903
signed long TT_F26Dot6
Definition: freetype.h:123
unsigned int TT_UInt
Definition: freetype.h:108
#define TTLOAD_HINT_GLYPH
Definition: freetype.h:904
TT_Error TT_Get_Outline_BBox(TT_Outline *outline, TT_BBox *bbox)
Definition: ttapi.c:1786
#define TTLOAD_PEDANTIC
Definition: freetype.h:905
signed long TT_Pos
Definition: freetype.h:126
TT_Long TT_MulFix(TT_Long A, TT_Long B)
Definition: ttcalc.c:191
#define TTLOAD_IGNORE_GLOBAL_ADVANCE_WIDTH
Definition: freetype.h:906
static void mount_zone(PGlyph_Zone source, PGlyph_Zone target)
Definition: ttgload.c:157
#define org_to_cur(n, zone)
Definition: ttgload.c:130
#define WE_HAVE_INSTR
Definition: ttgload.c:46
#define WE_HAVE_A_2X2
Definition: ttgload.c:45
#define WE_HAVE_A_SCALE
Definition: ttgload.c:41
#define MORE_COMPONENTS
Definition: ttgload.c:43
static void TT_Get_Metrics(TT_Horizontal_Header *header, UShort index, Short *bearing, UShort *advance)
Definition: ttgload.c:61
static TT_Error Load_Composite_End(UShort n_points, Short n_contours, PExecution_Context exec, PSubglyph_Record subg, UShort load_flags, TT_Stream input)
Definition: ttgload.c:427
static void translate_array(UShort n, TT_Vector *coords, TT_Pos delta_x, TT_Pos delta_y)
Definition: ttgload.c:136
#define USE_MY_METRICS
Definition: ttgload.c:47
static void Init_Glyph_Component(PSubglyph_Record element, PSubglyph_Record original, PExecution_Context exec)
Definition: ttgload.c:526
#define ARGS_ARE_XY_VALUES
Definition: ttgload.c:39
#define cur_to_org(n, zone)
Definition: ttgload.c:124
#define ARGS_ARE_WORDS
Definition: ttgload.c:38
#define WE_HAVE_AN_XY_SCALE
Definition: ttgload.c:44
static void Get_HMetrics(PFace face, UShort index, Bool check, Short *lsb, UShort *aw)
Definition: ttgload.c:90
static TT_Error Load_Simple_Glyph(PExecution_Context exec, TT_Stream input, Short n_contours, Short left_contours, UShort left_points, UShort load_flags, PSubglyph_Record subg)
Definition: ttgload.c:183
#define ROUND_XY_TO_GRID
Definition: ttgload.c:40
static PByte Get_Advance_Widths(PFace face, UShort ppem)
Definition: ttgload.c:107
static TT_Error Load_TrueType_Glyph(PInstance instance, PGlyph glyph, UShort glyph_index, UShort load_flags)
Definition: ttgload.c:562
Long TT_LookUp_Table(PFace face, ULong tag)
Definition: ttload.c:54
static TT_Error Set_CodeRange(PExecution_Context exec, Int range, void *base, ULong length)
Definition: ttobjs.c:287
static TT_Pos Scale_X(PIns_Metrics metrics, TT_Pos x)
Definition: ttobjs.c:1334
static PExecution_Context New_Context(PFace face)
Definition: ttobjs.c:46
static const TGraphicsState Default_GraphicsState
Definition: ttobjs.c:666
static TT_Pos Scale_Y(PIns_Metrics metrics, TT_Pos y)
Definition: ttobjs.c:1356
static TT_Error Context_Load(PExecution_Context exec, PFace face, PInstance ins)
Definition: ttobjs.c:510
static TT_Error Done_Context(PExecution_Context exec)
Definition: ttobjs.c:70
static TT_Error Context_Run(PExecution_Context exec, Bool debug)
Definition: ttobjs.c:626
#define TT_CodeRange_Glyph
Definition: ttobjs.h:230
Short * PShortMetrics
Definition: tttables.h:164
struct TLongMetrics_ * PLongMetrics
Definition: tttables.h:162
TT_Int32 Fixed
Definition: tttypes.h:45
#define TT_Flag_On_Curve
Definition: tttypes.h:102
#define ABS(a)
Definition: tttypes.h:126
#define NULL
Definition: ftobjs.h:61
#define TTAG_glyf
Definition: tttags.h:62
small capitals from c petite p scientific f u
Definition: afcover.h:88
FT_Vector * vec
Definition: ftbbox.c:469
FT_Face face
Definition: cffdrivr.c:659
unsigned char Byte
Definition: ftzconf.h:219
unsigned short UShort
Definition: ftraster.c:310
long Long
Definition: ftraster.c:311
unsigned char * PByte
Definition: ftraster.c:314
short Short
Definition: ftraster.c:309
kerning y
Definition: ttdriver.c:212
int int double double double char double char * top
Definition: gdfx.h:19
static int phase
Definition: cs_type2.c:84
The following parameters were sufficient in the original
Definition: comm-w2c.h:249
#define target(code, i)
Definition: lpeg.c:1165
float x
Definition: cordic.py:15
int k
Definition: otp-parser.c:70
FILE * Fin
Definition: out2uni.c:1635
#define Char
Definition: p2c.h:237
set set set set set set set macro pixldst1 abits if abits op else op endif endm macro pixldst2 abits if abits op else op endif endm macro pixldst4 abits if abits op else op endif endm macro pixldst0 abits op endm macro pixldst3 mem_operand op endm macro pixldst30 mem_operand op endm macro pixldst abits if abits elseif abits elseif abits elseif abits elseif abits pixldst0 abits else pixldst0 abits pixldst0 abits pixldst0 abits pixldst0 abits endif elseif abits else pixldst0 abits pixldst0 abits endif elseif abits else error unsupported bpp *numpix else pixst endif endm macro pixld1_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl else error unsupported endif endm macro pixld2_s mem_operand if mov asr add asl add asl mov asr sub UNIT_X add asl mov asr add asl add asl mov asr add UNIT_X add asl else pixld1_s mem_operand pixld1_s mem_operand endif endm macro pixld0_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl endif endm macro pixld_s_internal mem_operand if mem_operand pixld2_s mem_operand pixdeinterleave basereg elseif mem_operand elseif mem_operand elseif mem_operand elseif mem_operand pixld0_s mem_operand else pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else error unsupported mem_operand if bpp mem_operand endif endm macro vuzp8 reg2 vuzp d d &reg2 endm macro vzip8 reg2 vzip d d &reg2 endm macro pixdeinterleave basereg basereg basereg basereg basereg endif endm macro pixinterleave basereg basereg basereg basereg basereg endif endm macro PF boost_increment endif if endif PF tst PF addne PF subne PF cmp ORIG_W if endif if endif if endif PF subge ORIG_W PF subges if endif if endif if endif endif endm macro cache_preload_simple endif if dst_r_bpp pld[DST_R, #(PREFETCH_DISTANCE_SIMPLE *dst_r_bpp/8)] endif if mask_bpp pld if[MASK, #(PREFETCH_DISTANCE_SIMPLE *mask_bpp/8)] endif endif endm macro fetch_mask_pixblock pixld mask_basereg pixblock_size MASK endm macro ensure_destination_ptr_alignment process_pixblock_tail_head if beq irp skip1(dst_w_bpp<=(lowbit *8)) &&((lowbit *8)<(pixblock_size *dst_w_bpp)) .if lowbit< 16 tst DST_R
static int cnt
Definition: pkout.c:166
#define index(s, c)
Definition: plain2.h:351
static int offset
Definition: ppmtogif.c:642
struct stream_s stream
Definition: pts_fax.h:93
#define glyph_index()
#define Short
#define flag
Definition: round_prec.c:45
lft_cell * left
Definition: routines.h:73
FT_Stream stream
Definition: freetype.h:1073
FT_Pos x
Definition: ftimage.h:77
FT_Pos y
Definition: ftimage.h:78
TGraphicsState GS
Definition: ttobjs.h:670
PInstance instance
Definition: ttobjs.h:648
Bool pedantic_hinting
Definition: ttobjs.h:733
TGlyph_Zone pts
Definition: ttobjs.h:665
TIns_Metrics metrics
Definition: ttobjs.h:668
PSubglyph_Stack loadStack
Definition: ttobjs.h:753
Definition: ttobjs.h:481
TMaxProfile maxProfile
Definition: ttobjs.h:495
TT_Postscript postscript
Definition: ttobjs.h:517
Byte * touch
Definition: ttobjs.h:292
UShort n_points
Definition: ttobjs.h:286
Short n_contours
Definition: ttobjs.h:287
TT_Vector * cur
Definition: ttobjs.h:290
TT_Vector * org
Definition: ttobjs.h:289
UShort * contours
Definition: ttobjs.h:293
UShort x_ppem
Definition: ttobjs.h:445
TIns_Metrics metrics
Definition: ttobjs.h:599
Short bearing
Definition: tttables.h:159
UShort advance
Definition: tttables.h:158
UShort maxSizeOfInstructions
Definition: tttables.h:117
UShort element_flag
Definition: ttobjs.h:371
TTransform transform
Definition: ttobjs.h:373
TGlyph_Zone zone
Definition: ttobjs.h:366
Bool preserve_pps
Definition: ttobjs.h:360
Long file_offset
Definition: ttobjs.h:362
TT_Vector pp2
Definition: ttobjs.h:375
TT_Vector pp1
Definition: ttobjs.h:375
TT_Big_Glyph_Metrics metrics
Definition: ttobjs.h:364
TT_Pos yMax
Definition: freetype.h:227
TT_Pos xMin
Definition: freetype.h:224
TT_Pos yMin
Definition: freetype.h:225
TT_Pos xMax
Definition: freetype.h:226
FT_ULong isFixedPitch
Definition: tttables.h:456
TT_F26Dot6 y
Definition: freetype.h:149
TT_F26Dot6 x
Definition: freetype.h:148
TT_Fixed yx
Definition: ttobjs.h:347
TT_Fixed yy
Definition: ttobjs.h:347
TT_Fixed xx
Definition: ttobjs.h:346
TT_F26Dot6 oy
Definition: ttobjs.h:348
TT_F26Dot6 ox
Definition: ttobjs.h:348
TT_Fixed xy
Definition: ttobjs.h:346
Definition: pbmfont.h:4
int yMax
Definition: pt1.h:152
CONTOUR * contours
Definition: pt1.h:180
int xMin
Definition: pt1.h:152
int xMax
Definition: pt1.h:152
short flags
Definition: pt1.h:156
int yMin
Definition: pt1.h:152
Definition: mendex.h:20
Definition: execute.c:108
long x
Definition: auxiliary.h:23
long y
Definition: auxiliary.h:24
Definition: sh.h:1345
Definition: table.h:30
int j
Definition: t4ht.c:1589
#define FT_INTERNAL_FUNC(type)
Definition: ttconfig.h:159
#define PTRACE4(varformat)
Definition: ttdebug.h:159
#define PTRACE0(varformat)
Definition: ttdebug.h:155
#define PTRACE6(varformat)
Definition: ttdebug.h:161
TT_Instance instance
Definition: ttf2pfb.c:161
#define GET_Byte()
Definition: ttfile.h:184
#define GET_Char()
Definition: ttfile.h:185
#define GET_Short()
Definition: ttfile.h:187
#define DEFINE_LOAD_LOCALS(STREAM)
Definition: ttfile.h:163
#define DONE_Stream(_stream)
Definition: ttfile.h:71
#define CHECK_AND_ACCESS_Frame(_size_)
Definition: ttfile.h:179
#define FILE_Read(buffer, count)
Definition: ttfile.h:198
#define DEFINE_ALL_LOCALS
Definition: ttfile.h:172
#define ACCESS_Frame(_size_)
Definition: ttfile.h:177
#define FILE_Pos()
Definition: ttfile.h:192
#define FORGET_Frame()
Definition: ttfile.h:181
#define USE_Stream(original, duplicate)
Definition: ttfile.h:68
#define GET_UShort()
Definition: ttfile.h:186
#define FILE_Seek(_position_)
Definition: ttfile.h:194
int ppem
Definition: ttflib.c:39