4 * Copyright (C) 2011-2012 by Werner Lemberg.
6 * This file is part of the ttfautohint library, and may only be used,
7 * modified, and distributed under the terms given in `COPYING'. By
8 * continuing to use, modify, or distribute this file you indicate that you
9 * have read `COPYING' and understand and accept it fully.
11 * The file `COPYING' mentioned in the previous paragraph is distributed
12 * with the ttfautohint library.
21 #define MISSING (FT_UInt)~0
23 /* a simple macro to emit bytecode instructions */
24 #define BCI(code) *(bufp++) = (code)
26 /* we increase the stack depth by this amount */
27 #define ADDITIONAL_STACK_ELEMENTS 20
30 /* #define DEBUGGING */
35 int _ta_debug_disable_horz_hints
;
36 int _ta_debug_disable_vert_hints
;
37 int _ta_debug_disable_blue_hints
;
38 void* _ta_debug_hints
;
42 typedef struct Hints_Record_
50 typedef struct Recorder_
53 GLYPH
* glyph
; /* the current glyph */
54 Hints_Record hints_record
;
56 /* some segments can `wrap around' */
57 /* a contour's start point like 24-25-26-0-1-2 */
58 /* (there can be at most one such segment per contour); */
59 /* later on we append additional records */
60 /* to split them into 24-26 and 0-2 */
61 FT_UInt
* wrap_around_segments
;
62 FT_UInt num_wrap_around_segments
;
64 FT_UShort num_stack_elements
; /* the necessary stack depth so far */
66 /* data necessary for strong point interpolation */
67 FT_UInt
* ip_before_points
;
68 FT_UInt
* ip_after_points
;
69 FT_UInt
* ip_on_point_array
;
70 FT_UInt
* ip_between_point_array
;
72 FT_UInt num_strong_points
;
77 /* We add a subglyph for each composite glyph. */
78 /* Since subglyphs must contain at least one point, */
79 /* we have to adjust all point indices accordingly. */
80 /* Using the `pointsums' array of the `GLYPH' structure */
81 /* it is straightforward to do that: */
82 /* Assuming that point with index x is in the interval */
83 /* pointsums[n] <= x < pointsums[n + 1], */
84 /* the new point index is x + n. */
87 TA_adjust_point_index(Recorder
* recorder
,
90 GLYPH
* glyph
= recorder
->glyph
;
94 if (!glyph
->num_components
)
95 return idx
; /* not a composite glyph */
97 for (i
= 0; i
< glyph
->num_pointsums
; i
++)
98 if (idx
< glyph
->pointsums
[i
])
105 /* we store the segments in the storage area; */
106 /* each segment record consists of the first and last point */
109 TA_sfnt_build_glyph_segments(SFNT
* sfnt
,
114 FONT
* font
= recorder
->font
;
115 TA_GlyphHints hints
= &font
->loader
->hints
;
116 TA_AxisHints axis
= &hints
->axis
[TA_DIMENSION_VERT
];
117 TA_Point points
= hints
->points
;
118 TA_Segment segments
= axis
->segments
;
120 TA_Segment seg_limit
;
122 FT_Outline outline
= font
->loader
->gloader
->base
.outline
;
128 FT_UInt num_segments
;
130 FT_Bool need_words
= 0;
135 FT_UInt num_packed_segments
;
137 FT_UInt num_stack_elements
;
138 FT_UInt num_twilight_points
;
141 seg_limit
= segments
+ axis
->num_segments
;
142 num_segments
= axis
->num_segments
;
144 /* to pack the data in the bytecode more tightly, */
145 /* we store up to the first nine segments in nibbles if possible, */
146 /* using delta values */
148 num_packed_segments
= 0;
149 for (seg
= segments
; seg
< seg_limit
; seg
++)
151 FT_UInt first
= seg
->first
- points
;
152 FT_UInt last
= seg
->last
- points
;
155 first
= TA_adjust_point_index(recorder
, first
);
156 last
= TA_adjust_point_index(recorder
, last
);
158 if (first
- base
>= 16)
160 if (first
> last
|| last
- first
>= 16)
162 if (num_packed_segments
== 9)
164 num_packed_segments
++;
168 /* also handle wrap-around segments */
169 num_segments
+= recorder
->num_wrap_around_segments
;
171 /* wrap-around segments are pushed with four arguments; */
172 /* a segment stored in nibbles needs only one byte instead of two */
173 num_args
= num_packed_segments
174 + 2 * (num_segments
- num_packed_segments
)
175 + 2 * recorder
->num_wrap_around_segments
178 /* collect all arguments temporarily in an array (in reverse order) */
179 /* so that we can easily split into chunks of 255 args */
180 /* as needed by NPUSHB and NPUSHW, respectively */
181 args
= (FT_UInt
*)malloc(num_args
* sizeof (FT_UInt
));
185 arg
= args
+ num_args
- 1;
187 if (num_segments
> 0xFF)
190 /* the number of packed segments is indicated by the function number */
191 if (recorder
->glyph
->num_components
)
192 *(arg
--) = bci_create_segments_composite_0
+ num_packed_segments
;
194 *(arg
--) = bci_create_segments_0
+ num_packed_segments
;
195 *(arg
--) = num_segments
;
198 for (seg
= segments
; seg
< segments
+ num_packed_segments
; seg
++)
200 FT_UInt first
= seg
->first
- points
;
201 FT_UInt last
= seg
->last
- points
;
206 first
= TA_adjust_point_index(recorder
, first
);
207 last
= TA_adjust_point_index(recorder
, last
);
209 low_nibble
= first
- base
;
210 high_nibble
= last
- first
;
212 *(arg
--) = 16 * high_nibble
+ low_nibble
;
217 for (seg
= segments
+ num_packed_segments
; seg
< seg_limit
; seg
++)
219 FT_UInt first
= seg
->first
- points
;
220 FT_UInt last
= seg
->last
- points
;
223 *(arg
--) = TA_adjust_point_index(recorder
, first
);
224 *(arg
--) = TA_adjust_point_index(recorder
, last
);
226 /* we push the last and first contour point */
227 /* as a third and fourth argument in wrap-around segments */
230 for (n
= 0; n
< outline
.n_contours
; n
++)
232 FT_UInt end
= (FT_UInt
)outline
.contours
[n
];
237 *(arg
--) = TA_adjust_point_index(recorder
, end
);
242 *(arg
--) = TA_adjust_point_index(recorder
, 0);
244 *(arg
--) = TA_adjust_point_index(recorder
,
245 (FT_UInt
)outline
.contours
[n
- 1] + 1);
255 /* emit the second part of wrap-around segments as separate segments */
256 /* so that edges can easily link to them */
257 for (seg
= segments
; seg
< seg_limit
; seg
++)
259 FT_UInt first
= seg
->first
- points
;
260 FT_UInt last
= seg
->last
- points
;
265 for (n
= 0; n
< outline
.n_contours
; n
++)
267 if (first
<= (FT_UInt
)outline
.contours
[n
])
270 *(arg
--) = TA_adjust_point_index(recorder
, 0);
272 *(arg
--) = TA_adjust_point_index(recorder
,
273 (FT_UInt
)outline
.contours
[n
- 1] + 1);
278 *(arg
--) = TA_adjust_point_index(recorder
, last
);
281 /* with most fonts it is very rare */
282 /* that any of the pushed arguments is larger than 0xFF, */
283 /* thus we refrain from further optimizing this case */
289 for (i
= 0; i
< num_args
; i
+= 255)
291 nargs
= (num_args
- i
> 255) ? 255 : num_args
- i
;
294 if (optimize
&& nargs
<= 8)
295 BCI(PUSHW_1
- 1 + nargs
);
301 for (j
= 0; j
< nargs
; j
++)
311 for (i
= 0; i
< num_args
; i
+= 255)
313 nargs
= (num_args
- i
> 255) ? 255 : num_args
- i
;
315 if (optimize
&& nargs
<= 8)
316 BCI(PUSHB_1
- 1 + nargs
);
322 for (j
= 0; j
< nargs
; j
++)
332 num_storage
= sal_segment_offset
+ num_segments
* 2;
333 if (num_storage
> sfnt
->max_storage
)
334 sfnt
->max_storage
= num_storage
;
336 num_twilight_points
= num_segments
* 2;
337 if (num_twilight_points
> sfnt
->max_twilight_points
)
338 sfnt
->max_twilight_points
= num_twilight_points
;
340 /* both this function and `TA_emit_hints_record' */
341 /* push data onto the stack */
342 num_stack_elements
= ADDITIONAL_STACK_ELEMENTS
343 + recorder
->num_stack_elements
+ num_args
;
344 if (num_stack_elements
> sfnt
->max_stack_elements
)
345 sfnt
->max_stack_elements
= num_stack_elements
;
354 TA_sfnt_build_glyph_scaler(SFNT
* sfnt
,
358 FT_GlyphSlot glyph
= sfnt
->face
->glyph
;
359 FT_Vector
* points
= glyph
->outline
.points
;
360 FT_Int num_contours
= glyph
->outline
.n_contours
;
367 FT_Bool need_words
= 0;
371 FT_UInt num_stack_elements
;
374 num_args
= 2 * num_contours
+ 2;
376 /* collect all arguments temporarily in an array (in reverse order) */
377 /* so that we can easily split into chunks of 255 args */
378 /* as needed by NPUSHB and NPUSHW, respectively */
379 args
= (FT_UInt
*)malloc(num_args
* sizeof (FT_UInt
));
383 arg
= args
+ num_args
- 1;
388 if (recorder
->glyph
->num_components
)
389 *(arg
--) = bci_scale_composite_glyph
;
391 *(arg
--) = bci_scale_glyph
;
392 *(arg
--) = num_contours
;
397 for (p
= 0; p
< num_contours
; p
++)
403 end
= glyph
->outline
.contours
[p
];
405 for (q
= start
; q
<= end
; q
++)
407 if (points
[q
].y
< points
[min
].y
)
409 if (points
[q
].y
> points
[max
].y
)
415 *(arg
--) = TA_adjust_point_index(recorder
, max
);
416 *(arg
--) = TA_adjust_point_index(recorder
, min
);
420 *(arg
--) = TA_adjust_point_index(recorder
, min
);
421 *(arg
--) = TA_adjust_point_index(recorder
, max
);
430 /* with most fonts it is very rare */
431 /* that any of the pushed arguments is larger than 0xFF, */
432 /* thus we refrain from further optimizing this case */
438 for (i
= 0; i
< num_args
; i
+= 255)
440 nargs
= (num_args
- i
> 255) ? 255 : num_args
- i
;
443 BCI(PUSHW_1
- 1 + nargs
);
449 for (j
= 0; j
< nargs
; j
++)
459 for (i
= 0; i
< num_args
; i
+= 255)
461 nargs
= (num_args
- i
> 255) ? 255 : num_args
- i
;
464 BCI(PUSHB_1
- 1 + nargs
);
470 for (j
= 0; j
< nargs
; j
++)
480 num_stack_elements
= ADDITIONAL_STACK_ELEMENTS
+ num_args
;
481 if (num_stack_elements
> sfnt
->max_stack_elements
)
482 sfnt
->max_stack_elements
= num_stack_elements
;
491 TA_font_build_subglyph_shifter(FONT
* font
,
494 FT_Face face
= font
->loader
->face
;
495 FT_GlyphSlot glyph
= face
->glyph
;
497 TA_GlyphLoader gloader
= font
->loader
->gloader
;
499 TA_SubGlyph subglyphs
= gloader
->base
.subglyphs
;
500 TA_SubGlyph subglyph_limit
= subglyphs
+ gloader
->base
.num_subglyphs
;
501 TA_SubGlyph subglyph
;
503 FT_Int curr_contour
= 0;
506 for (subglyph
= subglyphs
; subglyph
< subglyph_limit
; subglyph
++)
510 FT_UShort flags
= subglyph
->flags
;
511 FT_Pos y_offset
= subglyph
->arg2
;
516 /* load subglyph to get the number of contours */
517 error
= FT_Load_Glyph(face
, subglyph
->index
, FT_LOAD_NO_SCALE
);
520 num_contours
= glyph
->outline
.n_contours
;
522 /* nothing to do if there is a point-to-point alignment */
523 if (!(flags
& FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES
))
526 /* nothing to do if y offset is zero */
530 /* nothing to do if there are no contours */
534 /* note that calling `FT_Load_Glyph' without FT_LOAD_NO_RECURSE */
535 /* ensures that composite subglyphs are represented as simple glyphs */
537 if (num_contours
> 0xFF
538 || curr_contour
> 0xFF)
541 BCI(HIGH(curr_contour
));
542 BCI(LOW(curr_contour
));
543 BCI(HIGH(num_contours
));
544 BCI(LOW(num_contours
));
553 /* there are high chances that this value needs PUSHW, */
554 /* thus we handle it separately */
555 if (y_offset
> 0xFF || y_offset
< 0)
568 BCI(bci_shift_subglyph
);
572 curr_contour
+= num_contours
;
580 * The four `ta_ip_*' actions in the `TA_hints_recorder' callback store its
581 * data in four arrays (which are simple but waste a lot of memory). The
582 * function below converts them into bytecode.
584 * For `ta_ip_before' and `ta_ip_after', the collected points are emitted
585 * together with the edge they correspond to.
587 * For both `ta_ip_on' and `ta_ip_between', an outer loop is constructed to
588 * loop over the edge or edge pairs, respectively, and each edge or edge
589 * pair contains an inner loop to emit the correponding points.
593 TA_build_point_hints(Recorder
* recorder
,
596 TA_AxisHints axis
= &hints
->axis
[TA_DIMENSION_VERT
];
597 TA_Segment segments
= axis
->segments
;
598 TA_Edge edges
= axis
->edges
;
604 FT_Byte
* p
= recorder
->hints_record
.buf
;
605 FT_UInt num_edges
= axis
->num_edges
;
606 FT_UInt num_strong_points
= recorder
->num_strong_points
;
620 /* we store everything as 16bit numbers; */
621 /* the function numbers (`ta_ip_before', etc.) */
622 /* reflect the order in the TA_Action enumeration */
624 /* ip_before_points */
627 ip
= recorder
->ip_before_points
;
628 ip_limit
= ip
+ num_strong_points
;
629 for (; ip
< ip_limit
; ip
++)
639 recorder
->hints_record
.num_actions
++;
644 *(p
++) = (FT_Byte
)ta_ip_before
+ ACTION_OFFSET
;
645 *(p
++) = HIGH(edge
->first
- segments
);
646 *(p
++) = LOW(edge
->first
- segments
);
650 ip
= recorder
->ip_before_points
;
652 for (; ip
< ip_limit
; ip
++)
654 FT_UInt point
= TA_adjust_point_index(recorder
, *ip
);
657 *(p
++) = HIGH(point
);
662 /* ip_after_points */
665 ip
= recorder
->ip_after_points
;
666 ip_limit
= ip
+ num_strong_points
;
667 for (; ip
< ip_limit
; ip
++)
677 recorder
->hints_record
.num_actions
++;
679 edge
= edges
+ axis
->num_edges
- 1;
682 *(p
++) = (FT_Byte
)ta_ip_after
+ ACTION_OFFSET
;
683 *(p
++) = HIGH(edge
->first
- segments
);
684 *(p
++) = LOW(edge
->first
- segments
);
688 ip
= recorder
->ip_after_points
;
690 for (; ip
< ip_limit
; ip
++)
692 FT_UInt point
= TA_adjust_point_index(recorder
, *ip
);
695 *(p
++) = HIGH(point
);
700 /* ip_on_point_array */
703 ip
= recorder
->ip_on_point_array
;
704 ip_limit
= ip
+ num_edges
* num_strong_points
;
705 for (; ip
< ip_limit
; ip
+= num_strong_points
)
711 recorder
->hints_record
.num_actions
++;
714 *(p
++) = (FT_Byte
)ta_ip_on
+ ACTION_OFFSET
;
719 ip
= recorder
->ip_on_point_array
;
720 ip_limit
= ip
+ num_edges
* num_strong_points
;
721 for (; ip
< ip_limit
; ip
+= num_strong_points
, i
++)
728 *(p
++) = HIGH(edge
->first
- segments
);
729 *(p
++) = LOW(edge
->first
- segments
);
733 iq_limit
= iq
+ num_strong_points
;
734 for (; iq
< iq_limit
; iq
++)
747 for (; iq
< iq_limit
; iq
++)
749 FT_UInt point
= TA_adjust_point_index(recorder
, *iq
);
752 *(p
++) = HIGH(point
);
758 /* ip_between_point_array */
761 ip
= recorder
->ip_between_point_array
;
762 ip_limit
= ip
+ num_edges
* num_edges
* num_strong_points
;
763 for (; ip
< ip_limit
; ip
+= num_strong_points
)
769 recorder
->hints_record
.num_actions
++;
772 *(p
++) = (FT_Byte
)ta_ip_between
+ ACTION_OFFSET
;
777 ip
= recorder
->ip_between_point_array
;
778 ip_limit
= ip
+ num_edges
* num_edges
* num_strong_points
;
781 ip
+= num_edges
* num_strong_points
, i
++)
787 iq_limit
= iq
+ num_edges
* num_strong_points
;
788 for (; iq
< iq_limit
; iq
+= num_strong_points
, j
++)
795 *(p
++) = HIGH(after
->first
- segments
);
796 *(p
++) = LOW(after
->first
- segments
);
797 *(p
++) = HIGH(before
->first
- segments
);
798 *(p
++) = LOW(before
->first
- segments
);
802 ir_limit
= ir
+ num_strong_points
;
803 for (; ir
< ir_limit
; ir
++)
816 for (; ir
< ir_limit
; ir
++)
818 FT_UInt point
= TA_adjust_point_index(recorder
, *ir
);
821 *(p
++) = HIGH(point
);
828 recorder
->hints_record
.buf
= p
;
833 TA_hints_record_is_different(Hints_Record
* hints_records
,
834 FT_UInt num_hints_records
,
838 Hints_Record last_hints_record
;
844 /* we only need to compare with the last hints record */
845 last_hints_record
= hints_records
[num_hints_records
- 1];
847 if ((FT_UInt
)(end
- start
) != last_hints_record
.buf_len
)
850 if (memcmp(start
, last_hints_record
.buf
, last_hints_record
.buf_len
))
858 TA_add_hints_record(Hints_Record
** hints_records
,
859 FT_UInt
* num_hints_records
,
861 Hints_Record hints_record
)
863 Hints_Record
* hints_records_new
;
865 /* at this point, `hints_record.buf' still points into `ins_buf' */
866 FT_Byte
* end
= hints_record
.buf
;
869 buf_len
= (FT_UInt
)(end
- start
);
871 /* now fill the structure completely */
872 hints_record
.buf_len
= buf_len
;
873 hints_record
.buf
= (FT_Byte
*)malloc(buf_len
);
874 if (!hints_record
.buf
)
875 return FT_Err_Out_Of_Memory
;
877 memcpy(hints_record
.buf
, start
, buf_len
);
879 (*num_hints_records
)++;
881 (Hints_Record
*)realloc(*hints_records
, *num_hints_records
882 * sizeof (Hints_Record
));
883 if (!hints_records_new
)
885 free(hints_record
.buf
);
886 (*num_hints_records
)--;
887 return FT_Err_Out_Of_Memory
;
890 *hints_records
= hints_records_new
;
892 (*hints_records
)[*num_hints_records
- 1] = hints_record
;
899 TA_emit_hints_record(Recorder
* recorder
,
900 Hints_Record
* hints_record
,
906 FT_Bool need_words
= 0;
909 FT_UInt num_arguments
;
913 /* check whether any argument is larger than 0xFF */
914 endp
= hints_record
->buf
+ hints_record
->buf_len
;
915 for (p
= hints_record
->buf
; p
< endp
; p
+= 2)
919 /* with most fonts it is very rare */
920 /* that any of the pushed arguments is larger than 0xFF, */
921 /* thus we refrain from further optimizing this case */
923 num_arguments
= hints_record
->buf_len
/ 2;
928 for (i
= 0; i
< num_arguments
; i
+= 255)
930 num_args
= (num_arguments
- i
> 255) ? 255 : (num_arguments
- i
);
932 if (optimize
&& num_args
<= 8)
933 BCI(PUSHW_1
- 1 + num_args
);
939 for (j
= 0; j
< num_args
; j
++)
949 /* we only need the lower bytes */
952 for (i
= 0; i
< num_arguments
; i
+= 255)
954 num_args
= (num_arguments
- i
> 255) ? 255 : (num_arguments
- i
);
956 if (optimize
&& num_args
<= 8)
957 BCI(PUSHB_1
- 1 + num_args
);
963 for (j
= 0; j
< num_args
; j
++)
971 /* collect stack depth data */
972 if (num_arguments
> recorder
->num_stack_elements
)
973 recorder
->num_stack_elements
= num_arguments
;
980 TA_emit_hints_records(Recorder
* recorder
,
981 Hints_Record
* hints_records
,
982 FT_UInt num_hints_records
,
987 Hints_Record
* hints_record
;
990 hints_record
= hints_records
;
992 for (i
= 0; i
< num_hints_records
- 1; i
++)
995 if (hints_record
->size
> 0xFF)
998 BCI(HIGH((hints_record
+ 1)->size
));
999 BCI(LOW((hints_record
+ 1)->size
));
1004 BCI((hints_record
+ 1)->size
);
1008 bufp
= TA_emit_hints_record(recorder
, hints_record
, bufp
, optimize
);
1014 bufp
= TA_emit_hints_record(recorder
, hints_record
, bufp
, optimize
);
1016 for (i
= 0; i
< num_hints_records
- 1; i
++)
1024 TA_free_hints_records(Hints_Record
* hints_records
,
1025 FT_UInt num_hints_records
)
1030 for (i
= 0; i
< num_hints_records
; i
++)
1031 free(hints_records
[i
].buf
);
1033 free(hints_records
);
1038 TA_hints_recorder_handle_segments(FT_Byte
* bufp
,
1043 TA_Segment segments
= axis
->segments
;
1046 FT_UInt num_segs
= 0;
1050 seg_idx
= edge
->first
- segments
;
1052 /* we store everything as 16bit numbers */
1053 *(bufp
++) = HIGH(seg_idx
);
1054 *(bufp
++) = LOW(seg_idx
);
1056 /* wrap-around segments are stored as two segments */
1057 if (edge
->first
->first
> edge
->first
->last
)
1060 seg
= edge
->first
->edge_next
;
1061 while (seg
!= edge
->first
)
1065 if (seg
->first
> seg
->last
)
1068 seg
= seg
->edge_next
;
1071 *(bufp
++) = HIGH(num_segs
);
1072 *(bufp
++) = LOW(num_segs
);
1074 if (edge
->first
->first
> edge
->first
->last
)
1076 /* emit second part of wrap-around segment; */
1077 /* the bytecode positions such segments after `normal' ones */
1081 if (seg_idx
== *wrap
)
1086 *(bufp
++) = HIGH(axis
->num_segments
+ (wrap
- wraps
));
1087 *(bufp
++) = LOW(axis
->num_segments
+ (wrap
- wraps
));
1090 seg
= edge
->first
->edge_next
;
1091 while (seg
!= edge
->first
)
1093 seg_idx
= seg
- segments
;
1095 *(bufp
++) = HIGH(seg_idx
);
1096 *(bufp
++) = LOW(seg_idx
);
1098 if (seg
->first
> seg
->last
)
1103 if (seg_idx
== *wrap
)
1108 *(bufp
++) = HIGH(axis
->num_segments
+ (wrap
- wraps
));
1109 *(bufp
++) = LOW(axis
->num_segments
+ (wrap
- wraps
));
1112 seg
= seg
->edge_next
;
1120 TA_hints_recorder(TA_Action action
,
1121 TA_GlyphHints hints
,
1126 TA_Edge lower_bound
,
1127 TA_Edge upper_bound
)
1129 TA_AxisHints axis
= &hints
->axis
[dim
];
1130 TA_Edge edges
= axis
->edges
;
1131 TA_Segment segments
= axis
->segments
;
1132 TA_Point points
= hints
->points
;
1134 Recorder
* recorder
= (Recorder
*)hints
->user
;
1135 FONT
* font
= recorder
->font
;
1136 FT_UInt
* wraps
= recorder
->wrap_around_segments
;
1137 FT_Byte
* p
= recorder
->hints_record
.buf
;
1143 if (dim
== TA_DIMENSION_HORZ
)
1146 /* we collect point hints for later processing */
1151 TA_Point point
= (TA_Point
)arg1
;
1154 ip
= recorder
->ip_before_points
;
1155 limit
= ip
+ recorder
->num_strong_points
;
1156 for (; ip
< limit
; ip
++)
1160 *ip
= point
- points
;
1169 TA_Point point
= (TA_Point
)arg1
;
1172 ip
= recorder
->ip_after_points
;
1173 limit
= ip
+ recorder
->num_strong_points
;
1174 for (; ip
< limit
; ip
++)
1178 *ip
= point
- points
;
1187 TA_Point point
= (TA_Point
)arg1
;
1188 TA_Edge edge
= arg2
;
1191 ip
= recorder
->ip_on_point_array
1192 + recorder
->num_strong_points
1194 limit
= ip
+ recorder
->num_strong_points
;
1195 for (; ip
< limit
; ip
++)
1199 *ip
= point
- points
;
1208 TA_Point point
= (TA_Point
)arg1
;
1209 TA_Edge before
= arg2
;
1210 TA_Edge after
= arg3
;
1213 /* note that `recorder->num_segments' has been used for allocation, */
1214 /* but `axis->num_edges' is used for accessing this array */
1215 ip
= recorder
->ip_between_point_array
1216 + recorder
->num_strong_points
* axis
->num_edges
1218 + recorder
->num_strong_points
1220 limit
= ip
+ recorder
->num_strong_points
;
1221 for (; ip
< limit
; ip
++)
1225 *ip
= point
- points
;
1233 /* we ignore the BOUND action since we signal this information */
1234 /* with the proper function number */
1241 /* some enum values correspond to four or eight bytecode functions; */
1242 /* if the value is n, the function numbers are n, ..., n+7, */
1243 /* to be differentiated with flags */
1249 TA_Edge base_edge
= (TA_Edge
)arg1
;
1250 TA_Edge stem_edge
= arg2
;
1254 *(p
++) = (FT_Byte
)action
+ ACTION_OFFSET
1255 + ((stem_edge
->flags
& TA_EDGE_SERIF
) != 0)
1256 + 2 * ((base_edge
->flags
& TA_EDGE_ROUND
) != 0);
1258 *(p
++) = HIGH(base_edge
->first
- segments
);
1259 *(p
++) = LOW(base_edge
->first
- segments
);
1260 *(p
++) = HIGH(stem_edge
->first
- segments
);
1261 *(p
++) = LOW(stem_edge
->first
- segments
);
1263 p
= TA_hints_recorder_handle_segments(p
, axis
, stem_edge
, wraps
);
1269 TA_Edge edge
= (TA_Edge
)arg1
;
1270 TA_Edge edge2
= arg2
;
1274 *(p
++) = (FT_Byte
)action
+ ACTION_OFFSET
1275 + ((edge2
->flags
& TA_EDGE_SERIF
) != 0)
1276 + 2 * ((edge
->flags
& TA_EDGE_ROUND
) != 0);
1278 *(p
++) = HIGH(edge
->first
- segments
);
1279 *(p
++) = LOW(edge
->first
- segments
);
1280 *(p
++) = HIGH(edge2
->first
- segments
);
1281 *(p
++) = LOW(edge2
->first
- segments
);
1283 p
= TA_hints_recorder_handle_segments(p
, axis
, edge
, wraps
);
1289 TA_Edge edge
= (TA_Edge
)arg1
;
1290 TA_Edge edge2
= arg2
;
1291 TA_Edge edge_minus_one
= lower_bound
;
1295 *(p
++) = (FT_Byte
)action
+ ACTION_OFFSET
1296 + ((edge2
->flags
& TA_EDGE_SERIF
) != 0)
1297 + 2 * ((edge
->flags
& TA_EDGE_ROUND
) != 0)
1298 + 4 * (edge_minus_one
!= NULL
);
1300 *(p
++) = HIGH(edge
->first
- segments
);
1301 *(p
++) = LOW(edge
->first
- segments
);
1302 *(p
++) = HIGH(edge2
->first
- segments
);
1303 *(p
++) = LOW(edge2
->first
- segments
);
1307 *(p
++) = HIGH(edge_minus_one
->first
- segments
);
1308 *(p
++) = LOW(edge_minus_one
->first
- segments
);
1311 p
= TA_hints_recorder_handle_segments(p
, axis
, edge
, wraps
);
1315 case ta_blue_anchor
:
1317 TA_Edge edge
= (TA_Edge
)arg1
;
1318 TA_Edge blue
= arg2
;
1322 *(p
++) = (FT_Byte
)action
+ ACTION_OFFSET
;
1324 *(p
++) = HIGH(blue
->first
- segments
);
1325 *(p
++) = LOW(blue
->first
- segments
);
1327 if (edge
->best_blue_is_shoot
)
1329 *(p
++) = HIGH(CVT_BLUE_SHOOTS_OFFSET(font
) + edge
->best_blue_idx
);
1330 *(p
++) = LOW(CVT_BLUE_SHOOTS_OFFSET(font
) + edge
->best_blue_idx
);
1334 *(p
++) = HIGH(CVT_BLUE_REFS_OFFSET(font
) + edge
->best_blue_idx
);
1335 *(p
++) = LOW(CVT_BLUE_REFS_OFFSET(font
) + edge
->best_blue_idx
);
1338 *(p
++) = HIGH(edge
->first
- segments
);
1339 *(p
++) = LOW(edge
->first
- segments
);
1341 p
= TA_hints_recorder_handle_segments(p
, axis
, edge
, wraps
);
1347 TA_Edge edge
= (TA_Edge
)arg1
;
1348 TA_Edge edge2
= arg2
;
1349 TA_Edge edge_minus_one
= lower_bound
;
1353 *(p
++) = (FT_Byte
)action
+ ACTION_OFFSET
1354 + ((edge2
->flags
& TA_EDGE_SERIF
) != 0)
1355 + 2 * ((edge
->flags
& TA_EDGE_ROUND
) != 0)
1356 + 4 * (edge_minus_one
!= NULL
);
1358 *(p
++) = HIGH(edge
->first
- segments
);
1359 *(p
++) = LOW(edge
->first
- segments
);
1360 *(p
++) = HIGH(edge2
->first
- segments
);
1361 *(p
++) = LOW(edge2
->first
- segments
);
1365 *(p
++) = HIGH(edge_minus_one
->first
- segments
);
1366 *(p
++) = LOW(edge_minus_one
->first
- segments
);
1369 p
= TA_hints_recorder_handle_segments(p
, axis
, edge
, wraps
);
1370 p
= TA_hints_recorder_handle_segments(p
, axis
, edge2
, wraps
);
1376 TA_Edge edge
= (TA_Edge
)arg1
;
1380 *(p
++) = (FT_Byte
)action
+ ACTION_OFFSET
;
1382 if (edge
->best_blue_is_shoot
)
1384 *(p
++) = HIGH(CVT_BLUE_SHOOTS_OFFSET(font
) + edge
->best_blue_idx
);
1385 *(p
++) = LOW(CVT_BLUE_SHOOTS_OFFSET(font
) + edge
->best_blue_idx
);
1389 *(p
++) = HIGH(CVT_BLUE_REFS_OFFSET(font
) + edge
->best_blue_idx
);
1390 *(p
++) = LOW(CVT_BLUE_REFS_OFFSET(font
) + edge
->best_blue_idx
);
1393 *(p
++) = HIGH(edge
->first
- segments
);
1394 *(p
++) = LOW(edge
->first
- segments
);
1396 p
= TA_hints_recorder_handle_segments(p
, axis
, edge
, wraps
);
1402 TA_Edge serif
= (TA_Edge
)arg1
;
1403 TA_Edge base
= serif
->serif
;
1407 *(p
++) = (FT_Byte
)action
+ ACTION_OFFSET
1408 + (lower_bound
!= NULL
)
1409 + 2 * (upper_bound
!= NULL
);
1411 *(p
++) = HIGH(serif
->first
- segments
);
1412 *(p
++) = LOW(serif
->first
- segments
);
1413 *(p
++) = HIGH(base
->first
- segments
);
1414 *(p
++) = LOW(base
->first
- segments
);
1418 *(p
++) = HIGH(lower_bound
->first
- segments
);
1419 *(p
++) = LOW(lower_bound
->first
- segments
);
1423 *(p
++) = HIGH(upper_bound
->first
- segments
);
1424 *(p
++) = LOW(upper_bound
->first
- segments
);
1427 p
= TA_hints_recorder_handle_segments(p
, axis
, serif
, wraps
);
1431 case ta_serif_anchor
:
1432 case ta_serif_link2
:
1434 TA_Edge edge
= (TA_Edge
)arg1
;
1438 *(p
++) = (FT_Byte
)action
+ ACTION_OFFSET
1439 + (lower_bound
!= NULL
)
1440 + 2 * (upper_bound
!= NULL
);
1442 *(p
++) = HIGH(edge
->first
- segments
);
1443 *(p
++) = LOW(edge
->first
- segments
);
1447 *(p
++) = HIGH(lower_bound
->first
- segments
);
1448 *(p
++) = LOW(lower_bound
->first
- segments
);
1452 *(p
++) = HIGH(upper_bound
->first
- segments
);
1453 *(p
++) = LOW(upper_bound
->first
- segments
);
1456 p
= TA_hints_recorder_handle_segments(p
, axis
, edge
, wraps
);
1460 case ta_serif_link1
:
1462 TA_Edge edge
= (TA_Edge
)arg1
;
1463 TA_Edge before
= arg2
;
1464 TA_Edge after
= arg3
;
1468 *(p
++) = (FT_Byte
)action
+ ACTION_OFFSET
1469 + (lower_bound
!= NULL
)
1470 + 2 * (upper_bound
!= NULL
);
1472 *(p
++) = HIGH(before
->first
- segments
);
1473 *(p
++) = LOW(before
->first
- segments
);
1474 *(p
++) = HIGH(edge
->first
- segments
);
1475 *(p
++) = LOW(edge
->first
- segments
);
1476 *(p
++) = HIGH(after
->first
- segments
);
1477 *(p
++) = LOW(after
->first
- segments
);
1481 *(p
++) = HIGH(lower_bound
->first
- segments
);
1482 *(p
++) = LOW(lower_bound
->first
- segments
);
1486 *(p
++) = HIGH(upper_bound
->first
- segments
);
1487 *(p
++) = LOW(upper_bound
->first
- segments
);
1490 p
= TA_hints_recorder_handle_segments(p
, axis
, edge
, wraps
);
1495 /* there are more cases in the enumeration */
1496 /* which are handled with flags */
1500 recorder
->hints_record
.num_actions
++;
1501 recorder
->hints_record
.buf
= p
;
1506 TA_init_recorder(Recorder
* recorder
,
1509 TA_GlyphHints hints
)
1511 TA_AxisHints axis
= &hints
->axis
[TA_DIMENSION_VERT
];
1512 TA_Point points
= hints
->points
;
1513 TA_Point point_limit
= points
+ hints
->num_points
;
1516 TA_Segment segments
= axis
->segments
;
1517 TA_Segment seg_limit
= segments
+ axis
->num_segments
;
1520 FT_UInt num_strong_points
= 0;
1521 FT_UInt
* wrap_around_segment
;
1523 recorder
->font
= font
;
1524 recorder
->glyph
= glyph
;
1525 recorder
->num_segments
= axis
->num_segments
;
1527 recorder
->ip_before_points
= NULL
;
1528 recorder
->ip_after_points
= NULL
;
1529 recorder
->ip_on_point_array
= NULL
;
1530 recorder
->ip_between_point_array
= NULL
;
1532 recorder
->num_stack_elements
= 0;
1534 /* no need to clean up allocated arrays in case of error; */
1535 /* this is handled later by `TA_free_recorder' */
1537 recorder
->num_wrap_around_segments
= 0;
1538 for (seg
= segments
; seg
< seg_limit
; seg
++)
1539 if (seg
->first
> seg
->last
)
1540 recorder
->num_wrap_around_segments
++;
1542 recorder
->wrap_around_segments
=
1543 (FT_UInt
*)malloc(recorder
->num_wrap_around_segments
* sizeof (FT_UInt
));
1544 if (!recorder
->wrap_around_segments
)
1545 return FT_Err_Out_Of_Memory
;
1547 wrap_around_segment
= recorder
->wrap_around_segments
;
1548 for (seg
= segments
; seg
< seg_limit
; seg
++)
1549 if (seg
->first
> seg
->last
)
1550 *(wrap_around_segment
++) = seg
- segments
;
1552 /* get number of strong points */
1553 for (point
= points
; point
< point_limit
; point
++)
1555 /* actually, we need to test `TA_FLAG_TOUCH_Y' also; */
1556 /* however, this value isn't known yet */
1557 /* (or rather, it can vary between different pixel sizes) */
1558 if (point
->flags
& TA_FLAG_WEAK_INTERPOLATION
)
1561 num_strong_points
++;
1564 recorder
->num_strong_points
= num_strong_points
;
1566 recorder
->ip_before_points
=
1567 (FT_UInt
*)malloc(num_strong_points
* sizeof (FT_UInt
));
1568 if (!recorder
->ip_before_points
)
1569 return FT_Err_Out_Of_Memory
;
1571 recorder
->ip_after_points
=
1572 (FT_UInt
*)malloc(num_strong_points
* sizeof (FT_UInt
));
1573 if (!recorder
->ip_after_points
)
1574 return FT_Err_Out_Of_Memory
;
1576 /* actually, we need `hints->num_edges' for the array sizes; */
1577 /* however, this value isn't known yet */
1578 /* (or rather, it can vary between different pixel sizes) */
1579 recorder
->ip_on_point_array
=
1580 (FT_UInt
*)malloc(axis
->num_segments
1581 * num_strong_points
* sizeof (FT_UInt
));
1582 if (!recorder
->ip_on_point_array
)
1583 return FT_Err_Out_Of_Memory
;
1585 recorder
->ip_between_point_array
=
1586 (FT_UInt
*)malloc(axis
->num_segments
* axis
->num_segments
1587 * num_strong_points
* sizeof (FT_UInt
));
1588 if (!recorder
->ip_between_point_array
)
1589 return FT_Err_Out_Of_Memory
;
1596 TA_reset_recorder(Recorder
* recorder
,
1599 recorder
->hints_record
.buf
= bufp
;
1600 recorder
->hints_record
.num_actions
= 0;
1605 TA_rewind_recorder(Recorder
* recorder
,
1609 TA_reset_recorder(recorder
, bufp
);
1611 recorder
->hints_record
.size
= size
;
1613 /* We later check with MISSING (which expands to 0xFF bytes) */
1615 memset(recorder
->ip_before_points
, 0xFF,
1616 recorder
->num_strong_points
* sizeof (FT_UInt
));
1617 memset(recorder
->ip_after_points
, 0xFF,
1618 recorder
->num_strong_points
* sizeof (FT_UInt
));
1620 memset(recorder
->ip_on_point_array
, 0xFF,
1621 recorder
->num_segments
1622 * recorder
->num_strong_points
* sizeof (FT_UInt
));
1623 memset(recorder
->ip_between_point_array
, 0xFF,
1624 recorder
->num_segments
* recorder
->num_segments
1625 * recorder
->num_strong_points
* sizeof (FT_UInt
));
1630 TA_free_recorder(Recorder
* recorder
)
1632 free(recorder
->wrap_around_segments
);
1634 free(recorder
->ip_before_points
);
1635 free(recorder
->ip_after_points
);
1636 free(recorder
->ip_on_point_array
);
1637 free(recorder
->ip_between_point_array
);
1642 TA_sfnt_build_glyph_instructions(SFNT
* sfnt
,
1646 FT_Face face
= sfnt
->face
;
1654 SFNT_Table
* glyf_table
= &font
->tables
[sfnt
->glyf_idx
];
1655 glyf_Data
* data
= (glyf_Data
*)glyf_table
->data
;
1656 /* `idx' is never negative */
1657 GLYPH
* glyph
= &data
->glyphs
[idx
];
1659 TA_GlyphHints hints
;
1661 FT_UInt num_action_hints_records
;
1662 FT_UInt num_point_hints_records
;
1663 Hints_Record
* action_hints_records
;
1664 Hints_Record
* point_hints_records
;
1667 FT_UInt num_stack_elements
;
1668 FT_Bool optimize
= 0;
1670 FT_Int32 load_flags
;
1676 /* XXX: right now, we abuse this flag to control */
1677 /* the global behaviour of the auto-hinter */
1678 load_flags
= font
->fallback_script
<< 30;
1679 load_flags
|= 1 << 28; /* vertical hinting only */
1680 if (font
->increase_x_height
)
1681 load_flags
|= 1 << 29;
1682 if (!font
->pre_hinting
)
1683 load_flags
|= FT_LOAD_NO_SCALE
;
1685 /* computing the segments is resolution independent, */
1686 /* thus the pixel size in this call is arbitrary */
1687 error
= FT_Set_Pixel_Sizes(face
, 20, 20);
1691 ta_loader_register_hints_recorder(font
->loader
, NULL
, NULL
);
1692 error
= ta_loader_load_glyph(font
->loader
, face
, (FT_UInt
)idx
, load_flags
);
1696 /* do nothing if we have an empty glyph */
1697 if (!face
->glyph
->outline
.n_contours
)
1700 hints
= &font
->loader
->hints
;
1702 /* do nothing if the setup delivered the dummy module only */
1703 if (!hints
->num_points
)
1706 /* we allocate a buffer which is certainly large enough */
1707 /* to hold all of the created bytecode instructions; */
1708 /* later on it gets reallocated to its real size */
1709 ins_len
= hints
->num_points
* 1000;
1710 ins_buf
= (FT_Byte
*)malloc(ins_len
);
1712 return FT_Err_Out_Of_Memory
;
1714 /* initialize array with an invalid bytecode */
1715 /* so that we can easily find the array length at reallocation time */
1716 memset(ins_buf
, INS_A0
, ins_len
);
1718 /* handle composite glyph */
1719 if (font
->loader
->gloader
->base
.num_subglyphs
)
1721 bufp
= TA_font_build_subglyph_shifter(font
, ins_buf
);
1724 error
= FT_Err_Out_Of_Memory
;
1731 /* only scale the glyph if the dummy hinter has been used */
1732 if (font
->loader
->metrics
->clazz
== &ta_dummy_script_class
)
1734 /* since `TA_init_recorder' hasn't been called yet, */
1735 /* we manually initialize the `glyph' field */
1736 recorder
.glyph
= glyph
;
1738 bufp
= TA_sfnt_build_glyph_scaler(sfnt
, &recorder
, ins_buf
);
1741 error
= FT_Err_Out_Of_Memory
;
1748 error
= TA_init_recorder(&recorder
, font
, glyph
, hints
);
1752 /* loop over a large range of pixel sizes */
1753 /* to find hints records which get pushed onto the bytecode stack */
1760 num_chars
= fprintf(stderr
, "glyph %ld\n", idx
);
1761 for (i
= 0; i
< num_chars
- 1; i
++)
1763 fprintf(stderr
, "\n\n");
1768 /* we temporarily use `ins_buf' to record the current glyph hints */
1769 ta_loader_register_hints_recorder(font
->loader
,
1773 num_action_hints_records
= 0;
1774 num_point_hints_records
= 0;
1775 action_hints_records
= NULL
;
1776 point_hints_records
= NULL
;
1778 for (size
= font
->hinting_range_min
;
1779 size
<= font
->hinting_range_max
;
1787 TA_rewind_recorder(&recorder
, ins_buf
, size
);
1789 error
= FT_Set_Pixel_Sizes(face
, size
, size
);
1793 /* calling `ta_loader_load_glyph' uses the */
1794 /* `TA_hints_recorder' function as a callback, */
1795 /* modifying `hints_record' */
1796 error
= ta_loader_load_glyph(font
->loader
, face
, idx
, load_flags
);
1800 if (TA_hints_record_is_different(action_hints_records
,
1801 num_action_hints_records
,
1802 ins_buf
, recorder
.hints_record
.buf
))
1808 fprintf(stderr
, " size %d:\n", size
);
1810 ta_glyph_hints_dump_edges(_ta_debug_hints
);
1811 ta_glyph_hints_dump_segments(_ta_debug_hints
);
1812 ta_glyph_hints_dump_points(_ta_debug_hints
);
1814 fprintf(stderr
, " action hints record:\n");
1815 for (p
= ins_buf
; p
< recorder
.hints_record
.buf
; p
+= 2)
1816 fprintf(stderr
, " %2d", *p
* 256 + *(p
+ 1));
1817 fprintf(stderr
, "\n");
1821 error
= TA_add_hints_record(&action_hints_records
,
1822 &num_action_hints_records
,
1823 ins_buf
, recorder
.hints_record
);
1828 /* now handle point records */
1830 TA_reset_recorder(&recorder
, ins_buf
);
1832 /* use the point hints data collected in `TA_hints_recorder' */
1833 TA_build_point_hints(&recorder
, hints
);
1835 if (TA_hints_record_is_different(point_hints_records
,
1836 num_point_hints_records
,
1837 ins_buf
, recorder
.hints_record
.buf
))
1843 fprintf(stderr
, " size %d:\n", size
);
1845 ta_glyph_hints_dump_edges(_ta_debug_hints
);
1846 ta_glyph_hints_dump_segments(_ta_debug_hints
);
1847 ta_glyph_hints_dump_points(_ta_debug_hints
);
1850 fprintf(stderr
, " point hints record:\n");
1851 for (p
= ins_buf
; p
< recorder
.hints_record
.buf
; p
+= 2)
1852 fprintf(stderr
, " %2d", *p
* 256 + *(p
+ 1));
1853 fprintf(stderr
, "\n");
1857 error
= TA_add_hints_record(&point_hints_records
,
1858 &num_point_hints_records
,
1859 ins_buf
, recorder
.hints_record
);
1865 if (num_action_hints_records
== 1 && !action_hints_records
[0].num_actions
)
1867 /* since we only have a single empty record we just scale the glyph */
1868 bufp
= TA_sfnt_build_glyph_scaler(sfnt
, &recorder
, ins_buf
);
1871 error
= FT_Err_Out_Of_Memory
;
1875 /* clear the rest of the temporarily used part of `ins_buf' */
1877 while (*p
!= INS_A0
)
1883 /* if there is only a single record, */
1884 /* we do a global optimization later on */
1885 if (num_action_hints_records
> 1)
1888 /* store the hints records and handle stack depth */
1890 bufp
= TA_emit_hints_records(&recorder
,
1891 point_hints_records
,
1892 num_point_hints_records
,
1896 num_stack_elements
= recorder
.num_stack_elements
;
1897 recorder
.num_stack_elements
= 0;
1900 bufp
= TA_emit_hints_records(&recorder
,
1901 action_hints_records
,
1902 num_action_hints_records
,
1906 recorder
.num_stack_elements
+= num_stack_elements
;
1909 bufp
= TA_sfnt_build_glyph_segments(sfnt
, &recorder
, bufp
, optimize
);
1912 error
= FT_Err_Out_Of_Memory
;
1916 /* XXX improve handling of NPUSHW */
1917 if (num_action_hints_records
== 1
1918 && *(pos
[0]) != NPUSHW
&& *(pos
[1]) != NPUSHW
&& *(pos
[2]) != NPUSHW
)
1921 * we optimize two common cases, replacing
1923 * NPUSHB A ... NPUSHB B [... NPUSHB C] ... CALL
1927 * NPUSHB (A+B[+C]) ... CALL
1940 /* the point hints records block can be missing */
1941 if (pos
[0] == pos
[1])
1947 /* there are at least two NPUSHB instructions */
1948 /* (one of them directly at the start) */
1949 sizes
[0] = *(pos
[0] + 1);
1950 sizes
[1] = *(pos
[1] + 1);
1951 sizes
[2] = pos
[2] ? *(pos
[2] + 1) : 0;
1953 sum
= sizes
[0] + sizes
[1] + sizes
[2];
1956 goto Done2
; /* nothing to do since we need three NPUSHB */
1957 else if (!sizes
[2] && (sum
> 0xFF))
1958 goto Done2
; /* nothing to do since we need two NPUSHB */
1962 /* reduce three NPUSHB to two */
1964 new_size2
= sum
- 0xFF;
1968 /* reduce two or three NPUSHB to one */
1979 BCI(PUSHB_1
- 1 + new_size1
);
1985 for (i
= 0; i
< new_size1
; i
++)
1987 if (p
== pos
[pos_idx
])
1990 p
+= 2; /* skip old NPUSHB */
1998 BCI(PUSHB_1
- 1 + new_size2
);
2004 for (i
= 0; i
< new_size2
; i
++)
2006 if (p
== pos
[pos_idx
])
2019 /* clear the rest of the temporarily used part of `ins_buf' */
2021 while (*p
!= INS_A0
)
2025 TA_free_hints_records(action_hints_records
, num_action_hints_records
);
2026 TA_free_recorder(&recorder
);
2028 /* we are done, so reallocate the instruction array to its real size */
2029 if (*bufp
== INS_A0
)
2031 /* search backwards */
2032 while (*bufp
== INS_A0
)
2038 /* search forwards */
2039 while (*bufp
!= INS_A0
)
2044 ins_len
= bufp
- ins_buf
;
2046 if (ins_len
> sfnt
->max_instructions
)
2047 sfnt
->max_instructions
= ins_len
;
2049 glyph
->ins_buf
= (FT_Byte
*)realloc(ins_buf
, ins_len
);
2050 glyph
->ins_len
= ins_len
;
2055 TA_free_hints_records(action_hints_records
, num_action_hints_records
);
2056 TA_free_recorder(&recorder
);
2063 /* end of tabytecode.c */