../3rdparty/harfbuzz/src/harfbuzz-gdef.c

Source codeSwitch to Preprocessed file
LineSource CodeCoverage
1/* -
2 * Copyright (C) 1998-2004 David Turner and Werner Lemberg -
3 * Copyright (C) 2006 Behdad Esfahbod -
4 * -
5 * This is part of HarfBuzz, an OpenType Layout engine library. -
6 * -
7 * Permission is hereby granted, without written agreement and without -
8 * license or royalty fees, to use, copy, modify, and distribute this -
9 * software and its documentation for any purpose, provided that the -
10 * above copyright notice and the following two paragraphs appear in -
11 * all copies of this software. -
12 * -
13 * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -
14 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -
15 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -
16 * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -
17 * DAMAGE. -
18 * -
19 * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -
20 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -
21 * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -
22 * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -
23 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. -
24 */ -
25 -
26#include "harfbuzz-impl.h" -
27#include "harfbuzz-gdef-private.h" -
28#include "harfbuzz-open-private.h" -
29 -
30static HB_Error Load_AttachList( HB_AttachList* al, -
31 HB_Stream stream ); -
32static HB_Error Load_LigCaretList( HB_LigCaretList* lcl, -
33 HB_Stream stream ); -
34 -
35static void Free_AttachList( HB_AttachList* al); -
36static void Free_LigCaretList( HB_LigCaretList* lcl); -
37 -
38static void Free_NewGlyphClasses( HB_GDEFHeader* gdef); -
39 -
40 -
41 -
42/* GDEF glyph classes */ -
43 -
44#define UNCLASSIFIED_GLYPH 0 -
45#define SIMPLE_GLYPH 1 -
46#define LIGATURE_GLYPH 2 -
47#define MARK_GLYPH 3 -
48#define COMPONENT_GLYPH 4 -
49 -
50 -
51 -
52 -
53 -
54 -
55HB_Error HB_New_GDEF_Table( HB_GDEFHeader** retptr ) -
56{ -
57 HB_Error error;
executed (the execution status of this line is deduced): HB_Error error;
-
58 -
59 HB_GDEFHeader* gdef;
executed (the execution status of this line is deduced): HB_GDEFHeader* gdef;
-
60 -
61 if ( !retptr )
partially evaluated: !retptr
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:136
0-136
62 return ERR(HB_Err_Invalid_Argument);
never executed: return _hb_err (HB_Err_Invalid_Argument);
0
63 -
64 if ( ALLOC( gdef, sizeof( *gdef ) ) )
partially evaluated: ( (gdef) = _hb_alloc( sizeof( *gdef ), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:136
0-136
65 return error;
never executed: return error;
0
66 -
67 gdef->GlyphClassDef.loaded = FALSE;
executed (the execution status of this line is deduced): gdef->GlyphClassDef.loaded = 0;
-
68 gdef->AttachList.loaded = FALSE;
executed (the execution status of this line is deduced): gdef->AttachList.loaded = 0;
-
69 gdef->LigCaretList.loaded = FALSE;
executed (the execution status of this line is deduced): gdef->LigCaretList.loaded = 0;
-
70 gdef->MarkAttachClassDef_offset = 0;
executed (the execution status of this line is deduced): gdef->MarkAttachClassDef_offset = 0;
-
71 gdef->MarkAttachClassDef.loaded = FALSE;
executed (the execution status of this line is deduced): gdef->MarkAttachClassDef.loaded = 0;
-
72 -
73 gdef->LastGlyph = 0;
executed (the execution status of this line is deduced): gdef->LastGlyph = 0;
-
74 gdef->NewGlyphClasses = NULL;
executed (the execution status of this line is deduced): gdef->NewGlyphClasses = ((void *)0);
-
75 -
76 *retptr = gdef;
executed (the execution status of this line is deduced): *retptr = gdef;
-
77 -
78 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:136
136
79} -
80 -
81 -
82HB_Error HB_Load_GDEF_Table( HB_Stream stream, -
83 HB_GDEFHeader** retptr ) -
84{ -
85 HB_Error error = HB_Err_Ok;
executed (the execution status of this line is deduced): HB_Error error = HB_Err_Ok;
-
86 HB_UInt cur_offset, new_offset, base_offset;
executed (the execution status of this line is deduced): HB_UInt cur_offset, new_offset, base_offset;
-
87 -
88 HB_GDEFHeader* gdef;
executed (the execution status of this line is deduced): HB_GDEFHeader* gdef;
-
89 -
90 -
91 if ( !retptr )
partially evaluated: !retptr
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:136
0-136
92 return ERR(HB_Err_Invalid_Argument);
never executed: return _hb_err (HB_Err_Invalid_Argument);
0
93 -
94 if ( GOTO_Table( TTAG_GDEF ) )
partially evaluated: (0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:136
0-136
95 return error;
never executed: return error;
0
96 -
97 if (( error = HB_New_GDEF_Table ( &gdef ) ))
partially evaluated: ( error = HB_New_GDEF_Table ( &gdef ) )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:136
0-136
98 return error;
never executed: return error;
0
99 -
100 base_offset = FILE_Pos();
executed (the execution status of this line is deduced): base_offset = _hb_stream_pos( stream );
-
101 -
102 /* skip version */ -
103 -
104 if ( FILE_Seek( base_offset + 4L ) ||
partially evaluated: ( (error = (_hb_stream_seek( stream, base_offset + 4L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:136
0-136
105 ACCESS_Frame( 2L ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:136
0-136
106 goto Fail0;
never executed: goto Fail0;
0
107 -
108 new_offset = GET_UShort();
executed (the execution status of this line is deduced): new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
109 -
110 FORGET_Frame();
executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
111 -
112 /* all GDEF subtables are optional */ -
113 -
114 if ( new_offset )
partially evaluated: new_offset
TRUEFALSE
yes
Evaluation Count:136
no
Evaluation Count:0
0-136
115 { -
116 new_offset += base_offset;
executed (the execution status of this line is deduced): new_offset += base_offset;
-
117 -
118 /* only classes 1-4 are allowed here */ -
119 -
120 cur_offset = FILE_Pos();
executed (the execution status of this line is deduced): cur_offset = _hb_stream_pos( stream );
-
121 if ( FILE_Seek( new_offset ) ||
partially evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:136
0-136
122 ( error = _HB_OPEN_Load_ClassDefinition( &gdef->GlyphClassDef, 5,
partially evaluated: ( error = _HB_OPEN_Load_ClassDefinition( &gdef->GlyphClassDef, 5, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:136
0-136
123 stream ) ) != HB_Err_Ok )
partially evaluated: ( error = _HB_OPEN_Load_ClassDefinition( &gdef->GlyphClassDef, 5, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:136
0-136
124 goto Fail0;
never executed: goto Fail0;
0
125 (void)FILE_Seek( cur_offset );
executed (the execution status of this line is deduced): (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 );
-
126 }
executed: }
Execution Count:136
136
127 -
128 if ( ACCESS_Frame( 2L ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:136
0-136
129 goto Fail1;
never executed: goto Fail1;
0
130 -
131 new_offset = GET_UShort();
executed (the execution status of this line is deduced): new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
132 -
133 FORGET_Frame();
executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
134 -
135 if ( new_offset )
partially evaluated: new_offset
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:136
0-136
136 { -
137 new_offset += base_offset;
never executed (the execution status of this line is deduced): new_offset += base_offset;
-
138 -
139 cur_offset = FILE_Pos();
never executed (the execution status of this line is deduced): cur_offset = _hb_stream_pos( stream );
-
140 if ( FILE_Seek( new_offset ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
141 ( error = Load_AttachList( &gdef->AttachList,
never evaluated: ( error = Load_AttachList( &gdef->AttachList, stream ) ) != HB_Err_Ok
0
142 stream ) ) != HB_Err_Ok )
never evaluated: ( error = Load_AttachList( &gdef->AttachList, stream ) ) != HB_Err_Ok
0
143 goto Fail1;
never executed: goto Fail1;
0
144 (void)FILE_Seek( cur_offset );
never executed (the execution status of this line is deduced): (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 );
-
145 }
never executed: }
0
146 -
147 if ( ACCESS_Frame( 2L ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:136
0-136
148 goto Fail2;
never executed: goto Fail2;
0
149 -
150 new_offset = GET_UShort();
executed (the execution status of this line is deduced): new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
151 -
152 FORGET_Frame();
executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
153 -
154 if ( new_offset )
partially evaluated: new_offset
TRUEFALSE
yes
Evaluation Count:136
no
Evaluation Count:0
0-136
155 { -
156 new_offset += base_offset;
executed (the execution status of this line is deduced): new_offset += base_offset;
-
157 -
158 cur_offset = FILE_Pos();
executed (the execution status of this line is deduced): cur_offset = _hb_stream_pos( stream );
-
159 if ( FILE_Seek( new_offset ) ||
partially evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:136
0-136
160 ( error = Load_LigCaretList( &gdef->LigCaretList,
partially evaluated: ( error = Load_LigCaretList( &gdef->LigCaretList, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:136
0-136
161 stream ) ) != HB_Err_Ok )
partially evaluated: ( error = Load_LigCaretList( &gdef->LigCaretList, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:136
0-136
162 goto Fail2;
never executed: goto Fail2;
0
163 (void)FILE_Seek( cur_offset );
executed (the execution status of this line is deduced): (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 );
-
164 }
executed: }
Execution Count:136
136
165 -
166 /* OpenType 1.2 has introduced the `MarkAttachClassDef' field. We -
167 first have to scan the LookupFlag values to find out whether we -
168 must load it or not. Here we only store the offset of the table. */ -
169 -
170 if ( ACCESS_Frame( 2L ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:136
0-136
171 goto Fail3;
never executed: goto Fail3;
0
172 -
173 new_offset = GET_UShort();
executed (the execution status of this line is deduced): new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
174 -
175 FORGET_Frame();
executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
176 -
177 if ( new_offset )
evaluated: new_offset
TRUEFALSE
yes
Evaluation Count:90
yes
Evaluation Count:46
46-90
178 gdef->MarkAttachClassDef_offset = new_offset + base_offset;
executed: gdef->MarkAttachClassDef_offset = new_offset + base_offset;
Execution Count:90
90
179 else -
180 gdef->MarkAttachClassDef_offset = 0;
executed: gdef->MarkAttachClassDef_offset = 0;
Execution Count:46
46
181 -
182 *retptr = gdef;
executed (the execution status of this line is deduced): *retptr = gdef;
-
183 -
184 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:136
136
185 -
186Fail3: -
187 Free_LigCaretList( &gdef->LigCaretList );
never executed (the execution status of this line is deduced): Free_LigCaretList( &gdef->LigCaretList );
-
188 -
189Fail2:
code before this statement never executed: Fail2:
0
190 Free_AttachList( &gdef->AttachList );
never executed (the execution status of this line is deduced): Free_AttachList( &gdef->AttachList );
-
191 -
192Fail1:
code before this statement never executed: Fail1:
0
193 _HB_OPEN_Free_ClassDefinition( &gdef->GlyphClassDef );
never executed (the execution status of this line is deduced): _HB_OPEN_Free_ClassDefinition( &gdef->GlyphClassDef );
-
194 -
195Fail0:
code before this statement never executed: Fail0:
0
196 FREE( gdef );
never executed: }
never executed: }
never evaluated: (gdef)
never evaluated: 0
0
197 -
198 return error;
never executed: return error;
0
199} -
200 -
201 -
202HB_Error HB_Done_GDEF_Table ( HB_GDEFHeader* gdef ) -
203{ -
204 Free_LigCaretList( &gdef->LigCaretList );
executed (the execution status of this line is deduced): Free_LigCaretList( &gdef->LigCaretList );
-
205 Free_AttachList( &gdef->AttachList );
executed (the execution status of this line is deduced): Free_AttachList( &gdef->AttachList );
-
206 _HB_OPEN_Free_ClassDefinition( &gdef->GlyphClassDef );
executed (the execution status of this line is deduced): _HB_OPEN_Free_ClassDefinition( &gdef->GlyphClassDef );
-
207 _HB_OPEN_Free_ClassDefinition( &gdef->MarkAttachClassDef );
executed (the execution status of this line is deduced): _HB_OPEN_Free_ClassDefinition( &gdef->MarkAttachClassDef );
-
208 -
209 Free_NewGlyphClasses( gdef );
executed (the execution status of this line is deduced): Free_NewGlyphClasses( gdef );
-
210 -
211 FREE( gdef );
executed: }
Execution Count:129
executed: }
Execution Count:129
partially evaluated: (gdef)
TRUEFALSE
yes
Evaluation Count:129
no
Evaluation Count:0
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:129
0-129
212 -
213 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:129
129
214} -
215 -
216 -
217 -
218 -
219/******************************* -
220 * AttachList related functions -
221 *******************************/ -
222 -
223 -
224/* AttachPoint */ -
225 -
226static HB_Error Load_AttachPoint( HB_AttachPoint* ap, -
227 HB_Stream stream ) -
228{ -
229 HB_Error error;
never executed (the execution status of this line is deduced): HB_Error error;
-
230 -
231 HB_UShort n, count;
never executed (the execution status of this line is deduced): HB_UShort n, count;
-
232 HB_UShort* pi;
never executed (the execution status of this line is deduced): HB_UShort* pi;
-
233 -
234 -
235 if ( ACCESS_Frame( 2L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
236 return error;
never executed: return error;
0
237 -
238 count = ap->PointCount = GET_UShort();
never executed (the execution status of this line is deduced): count = ap->PointCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
239 -
240 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
241 -
242 ap->PointIndex = NULL;
never executed (the execution status of this line is deduced): ap->PointIndex = ((void *)0);
-
243 -
244 if ( count )
never evaluated: count
0
245 { -
246 if ( ALLOC_ARRAY( ap->PointIndex, count, HB_UShort ) )
never evaluated: ( (ap->PointIndex) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 )
0
247 return error;
never executed: return error;
0
248 -
249 pi = ap->PointIndex;
never executed (the execution status of this line is deduced): pi = ap->PointIndex;
-
250 -
251 if ( ACCESS_Frame( count * 2L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 )
0
252 { -
253 FREE( pi );
never executed: }
never executed: }
never evaluated: (pi)
never evaluated: 0
0
254 return error;
never executed: return error;
0
255 } -
256 -
257 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
258 pi[n] = GET_UShort();
never executed: pi[n] = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
0
259 -
260 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
261 }
never executed: }
0
262 -
263 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
264} -
265 -
266 -
267static void Free_AttachPoint( HB_AttachPoint* ap ) -
268{ -
269 FREE( ap->PointIndex );
never executed: }
never executed: }
never evaluated: (ap->PointIndex)
never evaluated: 0
0
270}
never executed: }
0
271 -
272 -
273/* AttachList */ -
274 -
275static HB_Error Load_AttachList( HB_AttachList* al, -
276 HB_Stream stream ) -
277{ -
278 HB_Error error;
never executed (the execution status of this line is deduced): HB_Error error;
-
279 -
280 HB_UShort n, m, count;
never executed (the execution status of this line is deduced): HB_UShort n, m, count;
-
281 HB_UInt cur_offset, new_offset, base_offset;
never executed (the execution status of this line is deduced): HB_UInt cur_offset, new_offset, base_offset;
-
282 -
283 HB_AttachPoint* ap;
never executed (the execution status of this line is deduced): HB_AttachPoint* ap;
-
284 -
285 -
286 base_offset = FILE_Pos();
never executed (the execution status of this line is deduced): base_offset = _hb_stream_pos( stream );
-
287 -
288 if ( ACCESS_Frame( 2L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
289 return error;
never executed: return error;
0
290 -
291 new_offset = GET_UShort() + base_offset;
never executed (the execution status of this line is deduced): new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset;
-
292 -
293 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
294 -
295 cur_offset = FILE_Pos();
never executed (the execution status of this line is deduced): cur_offset = _hb_stream_pos( stream );
-
296 if ( FILE_Seek( new_offset ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
297 ( error = _HB_OPEN_Load_Coverage( &al->Coverage, stream ) ) != HB_Err_Ok )
never evaluated: ( error = _HB_OPEN_Load_Coverage( &al->Coverage, stream ) ) != HB_Err_Ok
0
298 return error;
never executed: return error;
0
299 (void)FILE_Seek( cur_offset );
never executed (the execution status of this line is deduced): (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 );
-
300 -
301 if ( ACCESS_Frame( 2L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
302 goto Fail2;
never executed: goto Fail2;
0
303 -
304 count = al->GlyphCount = GET_UShort();
never executed (the execution status of this line is deduced): count = al->GlyphCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
305 -
306 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
307 -
308 al->AttachPoint = NULL;
never executed (the execution status of this line is deduced): al->AttachPoint = ((void *)0);
-
309 -
310 if ( ALLOC_ARRAY( al->AttachPoint, count, HB_AttachPoint ) )
never evaluated: ( (al->AttachPoint) = _hb_alloc( (count)*sizeof(HB_AttachPoint), &error ), error != 0 )
0
311 goto Fail2;
never executed: goto Fail2;
0
312 -
313 ap = al->AttachPoint;
never executed (the execution status of this line is deduced): ap = al->AttachPoint;
-
314 -
315 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
316 { -
317 if ( ACCESS_Frame( 2L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
318 goto Fail1;
never executed: goto Fail1;
0
319 -
320 new_offset = GET_UShort() + base_offset;
never executed (the execution status of this line is deduced): new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset;
-
321 -
322 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
323 -
324 cur_offset = FILE_Pos();
never executed (the execution status of this line is deduced): cur_offset = _hb_stream_pos( stream );
-
325 if ( FILE_Seek( new_offset ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
326 ( error = Load_AttachPoint( &ap[n], stream ) ) != HB_Err_Ok )
never evaluated: ( error = Load_AttachPoint( &ap[n], stream ) ) != HB_Err_Ok
0
327 goto Fail1;
never executed: goto Fail1;
0
328 (void)FILE_Seek( cur_offset );
never executed (the execution status of this line is deduced): (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 );
-
329 }
never executed: }
0
330 -
331 al->loaded = TRUE;
never executed (the execution status of this line is deduced): al->loaded = (!0);
-
332 -
333 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
334 -
335Fail1: -
336 for ( m = 0; m < n; m++ )
never evaluated: m < n
0
337 Free_AttachPoint( &ap[m] );
never executed: Free_AttachPoint( &ap[m] );
0
338 -
339 FREE( ap );
never executed: }
never executed: }
never evaluated: (ap)
never evaluated: 0
0
340 -
341Fail2:
code before this statement never executed: Fail2:
0
342 _HB_OPEN_Free_Coverage( &al->Coverage );
never executed (the execution status of this line is deduced): _HB_OPEN_Free_Coverage( &al->Coverage );
-
343 return error;
never executed: return error;
0
344} -
345 -
346 -
347static void Free_AttachList( HB_AttachList* al) -
348{ -
349 HB_UShort n, count;
executed (the execution status of this line is deduced): HB_UShort n, count;
-
350 -
351 HB_AttachPoint* ap;
executed (the execution status of this line is deduced): HB_AttachPoint* ap;
-
352 -
353 -
354 if ( !al->loaded )
partially evaluated: !al->loaded
TRUEFALSE
yes
Evaluation Count:129
no
Evaluation Count:0
0-129
355 return;
executed: return;
Execution Count:129
129
356 -
357 if ( al->AttachPoint )
never evaluated: al->AttachPoint
0
358 { -
359 count = al->GlyphCount;
never executed (the execution status of this line is deduced): count = al->GlyphCount;
-
360 ap = al->AttachPoint;
never executed (the execution status of this line is deduced): ap = al->AttachPoint;
-
361 -
362 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
363 Free_AttachPoint( &ap[n] );
never executed: Free_AttachPoint( &ap[n] );
0
364 -
365 FREE( ap );
never executed: }
never executed: }
never evaluated: (ap)
never evaluated: 0
0
366 }
never executed: }
0
367 -
368 _HB_OPEN_Free_Coverage( &al->Coverage );
never executed (the execution status of this line is deduced): _HB_OPEN_Free_Coverage( &al->Coverage );
-
369}
never executed: }
0
370 -
371 -
372 -
373/********************************* -
374 * LigCaretList related functions -
375 *********************************/ -
376 -
377 -
378/* CaretValueFormat1 */ -
379/* CaretValueFormat2 */ -
380/* CaretValueFormat3 */ -
381/* CaretValueFormat4 */ -
382 -
383static HB_Error Load_CaretValue( HB_CaretValue* cv, -
384 HB_Stream stream ) -
385{ -
386 HB_Error error;
executed (the execution status of this line is deduced): HB_Error error;
-
387 -
388 HB_UInt cur_offset, new_offset, base_offset;
executed (the execution status of this line is deduced): HB_UInt cur_offset, new_offset, base_offset;
-
389 -
390 -
391 base_offset = FILE_Pos();
executed (the execution status of this line is deduced): base_offset = _hb_stream_pos( stream );
-
392 -
393 if ( ACCESS_Frame( 2L ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:8
0-8
394 return error;
never executed: return error;
0
395 -
396 cv->CaretValueFormat = GET_UShort();
executed (the execution status of this line is deduced): cv->CaretValueFormat = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
397 -
398 FORGET_Frame();
executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
399 -
400 switch ( cv->CaretValueFormat ) -
401 { -
402 case 1: -
403 if ( ACCESS_Frame( 2L ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:8
0-8
404 return error;
never executed: return error;
0
405 -
406 cv->cvf.cvf1.Coordinate = GET_Short();
executed (the execution status of this line is deduced): cv->cvf.cvf1.Coordinate = (stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ));
-
407 -
408 FORGET_Frame();
executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
409 -
410 break;
executed: break;
Execution Count:8
8
411 -
412 case 2: -
413 if ( ACCESS_Frame( 2L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
414 return error;
never executed: return error;
0
415 -
416 cv->cvf.cvf2.CaretValuePoint = GET_UShort();
never executed (the execution status of this line is deduced): cv->cvf.cvf2.CaretValuePoint = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
417 -
418 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
419 -
420 break;
never executed: break;
0
421 -
422 case 3: -
423 if ( ACCESS_Frame( 4L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 4L ))) != 0 )
0
424 return error;
never executed: return error;
0
425 -
426 cv->cvf.cvf3.Coordinate = GET_Short();
never executed (the execution status of this line is deduced): cv->cvf.cvf3.Coordinate = (stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ));
-
427 -
428 new_offset = GET_UShort() + base_offset;
never executed (the execution status of this line is deduced): new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset;
-
429 -
430 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
431 -
432 cur_offset = FILE_Pos();
never executed (the execution status of this line is deduced): cur_offset = _hb_stream_pos( stream );
-
433 if ( FILE_Seek( new_offset ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
434 ( error = _HB_OPEN_Load_Device( &cv->cvf.cvf3.Device,
never evaluated: ( error = _HB_OPEN_Load_Device( &cv->cvf.cvf3.Device, stream ) ) != HB_Err_Ok
0
435 stream ) ) != HB_Err_Ok )
never evaluated: ( error = _HB_OPEN_Load_Device( &cv->cvf.cvf3.Device, stream ) ) != HB_Err_Ok
0
436 return error;
never executed: return error;
0
437 (void)FILE_Seek( cur_offset );
never executed (the execution status of this line is deduced): (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 );
-
438 -
439 break;
never executed: break;
0
440 -
441 case 4: -
442 if ( ACCESS_Frame( 2L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
443 return error;
never executed: return error;
0
444 -
445#ifdef HB_SUPPORT_MULTIPLE_MASTER -
446 cv->cvf.cvf4.IdCaretValue = GET_UShort(); -
447#else -
448 (void) GET_UShort();
never executed (the execution status of this line is deduced): (void) ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
449#endif -
450 -
451 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
452 break;
never executed: break;
0
453 -
454 default: -
455 return ERR(HB_Err_Invalid_SubTable_Format);
never executed: return _hb_err (HB_Err_Invalid_SubTable_Format);
0
456 } -
457 -
458 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:8
8
459} -
460 -
461 -
462static void Free_CaretValue( HB_CaretValue* cv) -
463{ -
464 if ( cv->CaretValueFormat == 3 )
partially evaluated: cv->CaretValueFormat == 3
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:8
0-8
465 _HB_OPEN_Free_Device( cv->cvf.cvf3.Device );
never executed: _HB_OPEN_Free_Device( cv->cvf.cvf3.Device );
0
466}
executed: }
Execution Count:8
8
467 -
468 -
469/* LigGlyph */ -
470 -
471static HB_Error Load_LigGlyph( HB_LigGlyph* lg, -
472 HB_Stream stream ) -
473{ -
474 HB_Error error;
executed (the execution status of this line is deduced): HB_Error error;
-
475 -
476 HB_UShort n, m, count;
executed (the execution status of this line is deduced): HB_UShort n, m, count;
-
477 HB_UInt cur_offset, new_offset, base_offset;
executed (the execution status of this line is deduced): HB_UInt cur_offset, new_offset, base_offset;
-
478 -
479 HB_CaretValue* cv;
executed (the execution status of this line is deduced): HB_CaretValue* cv;
-
480 -
481 -
482 base_offset = FILE_Pos();
executed (the execution status of this line is deduced): base_offset = _hb_stream_pos( stream );
-
483 -
484 if ( ACCESS_Frame( 2L ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:8
0-8
485 return error;
never executed: return error;
0
486 -
487 count = lg->CaretCount = GET_UShort();
executed (the execution status of this line is deduced): count = lg->CaretCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
488 -
489 FORGET_Frame();
executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
490 -
491 lg->CaretValue = NULL;
executed (the execution status of this line is deduced): lg->CaretValue = ((void *)0);
-
492 -
493 if ( ALLOC_ARRAY( lg->CaretValue, count, HB_CaretValue ) )
partially evaluated: ( (lg->CaretValue) = _hb_alloc( (count)*sizeof(HB_CaretValue), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:8
0-8
494 return error;
never executed: return error;
0
495 -
496 cv = lg->CaretValue;
executed (the execution status of this line is deduced): cv = lg->CaretValue;
-
497 -
498 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:8
yes
Evaluation Count:8
8
499 { -
500 if ( ACCESS_Frame( 2L ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:8
0-8
501 goto Fail;
never executed: goto Fail;
0
502 -
503 new_offset = GET_UShort() + base_offset;
executed (the execution status of this line is deduced): new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset;
-
504 -
505 FORGET_Frame();
executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
506 -
507 cur_offset = FILE_Pos();
executed (the execution status of this line is deduced): cur_offset = _hb_stream_pos( stream );
-
508 if ( FILE_Seek( new_offset ) ||
partially evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:8
0-8
509 ( error = Load_CaretValue( &cv[n], stream ) ) != HB_Err_Ok )
partially evaluated: ( error = Load_CaretValue( &cv[n], stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:8
0-8
510 goto Fail;
never executed: goto Fail;
0
511 (void)FILE_Seek( cur_offset );
executed (the execution status of this line is deduced): (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 );
-
512 }
executed: }
Execution Count:8
8
513 -
514 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:8
8
515 -
516Fail: -
517 for ( m = 0; m < n; m++ )
never evaluated: m < n
0
518 Free_CaretValue( &cv[m] );
never executed: Free_CaretValue( &cv[m] );
0
519 -
520 FREE( cv );
never executed: }
never executed: }
never evaluated: (cv)
never evaluated: 0
0
521 return error;
never executed: return error;
0
522} -
523 -
524 -
525static void Free_LigGlyph( HB_LigGlyph* lg) -
526{ -
527 HB_UShort n, count;
executed (the execution status of this line is deduced): HB_UShort n, count;
-
528 -
529 HB_CaretValue* cv;
executed (the execution status of this line is deduced): HB_CaretValue* cv;
-
530 -
531 -
532 if ( lg->CaretValue )
partially evaluated: lg->CaretValue
TRUEFALSE
yes
Evaluation Count:8
no
Evaluation Count:0
0-8
533 { -
534 count = lg->CaretCount;
executed (the execution status of this line is deduced): count = lg->CaretCount;
-
535 cv = lg->CaretValue;
executed (the execution status of this line is deduced): cv = lg->CaretValue;
-
536 -
537 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:8
yes
Evaluation Count:8
8
538 Free_CaretValue( &cv[n] );
executed: Free_CaretValue( &cv[n] );
Execution Count:8
8
539 -
540 FREE( cv );
executed: }
Execution Count:8
executed: }
Execution Count:8
partially evaluated: (cv)
TRUEFALSE
yes
Evaluation Count:8
no
Evaluation Count:0
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:8
0-8
541 }
executed: }
Execution Count:8
8
542}
executed: }
Execution Count:8
8
543 -
544 -
545/* LigCaretList */ -
546 -
547static HB_Error Load_LigCaretList( HB_LigCaretList* lcl, -
548 HB_Stream stream ) -
549{ -
550 HB_Error error;
executed (the execution status of this line is deduced): HB_Error error;
-
551 -
552 HB_UShort m, n, count;
executed (the execution status of this line is deduced): HB_UShort m, n, count;
-
553 HB_UInt cur_offset, new_offset, base_offset;
executed (the execution status of this line is deduced): HB_UInt cur_offset, new_offset, base_offset;
-
554 -
555 HB_LigGlyph* lg;
executed (the execution status of this line is deduced): HB_LigGlyph* lg;
-
556 -
557 -
558 base_offset = FILE_Pos();
executed (the execution status of this line is deduced): base_offset = _hb_stream_pos( stream );
-
559 -
560 if ( ACCESS_Frame( 2L ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:136
0-136
561 return error;
never executed: return error;
0
562 -
563 new_offset = GET_UShort() + base_offset;
executed (the execution status of this line is deduced): new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset;
-
564 -
565 FORGET_Frame();
executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
566 -
567 cur_offset = FILE_Pos();
executed (the execution status of this line is deduced): cur_offset = _hb_stream_pos( stream );
-
568 if ( FILE_Seek( new_offset ) ||
partially evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:136
0-136
569 ( error = _HB_OPEN_Load_Coverage( &lcl->Coverage, stream ) ) != HB_Err_Ok )
partially evaluated: ( error = _HB_OPEN_Load_Coverage( &lcl->Coverage, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:136
0-136
570 return error;
never executed: return error;
0
571 (void)FILE_Seek( cur_offset );
executed (the execution status of this line is deduced): (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 );
-
572 -
573 if ( ACCESS_Frame( 2L ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:136
0-136
574 goto Fail2;
never executed: goto Fail2;
0
575 -
576 count = lcl->LigGlyphCount = GET_UShort();
executed (the execution status of this line is deduced): count = lcl->LigGlyphCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
577 -
578 FORGET_Frame();
executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
579 -
580 lcl->LigGlyph = NULL;
executed (the execution status of this line is deduced): lcl->LigGlyph = ((void *)0);
-
581 -
582 if ( ALLOC_ARRAY( lcl->LigGlyph, count, HB_LigGlyph ) )
partially evaluated: ( (lcl->LigGlyph) = _hb_alloc( (count)*sizeof(HB_LigGlyph), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:136
0-136
583 goto Fail2;
never executed: goto Fail2;
0
584 -
585 lg = lcl->LigGlyph;
executed (the execution status of this line is deduced): lg = lcl->LigGlyph;
-
586 -
587 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:8
yes
Evaluation Count:136
8-136
588 { -
589 if ( ACCESS_Frame( 2L ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:8
0-8
590 goto Fail1;
never executed: goto Fail1;
0
591 -
592 new_offset = GET_UShort() + base_offset;
executed (the execution status of this line is deduced): new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset;
-
593 -
594 FORGET_Frame();
executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
595 -
596 cur_offset = FILE_Pos();
executed (the execution status of this line is deduced): cur_offset = _hb_stream_pos( stream );
-
597 if ( FILE_Seek( new_offset ) ||
partially evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:8
0-8
598 ( error = Load_LigGlyph( &lg[n], stream ) ) != HB_Err_Ok )
partially evaluated: ( error = Load_LigGlyph( &lg[n], stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:8
0-8
599 goto Fail1;
never executed: goto Fail1;
0
600 (void)FILE_Seek( cur_offset );
executed (the execution status of this line is deduced): (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 );
-
601 }
executed: }
Execution Count:8
8
602 -
603 lcl->loaded = TRUE;
executed (the execution status of this line is deduced): lcl->loaded = (!0);
-
604 -
605 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:136
136
606 -
607Fail1: -
608 for ( m = 0; m < n; m++ )
never evaluated: m < n
0
609 Free_LigGlyph( &lg[m] );
never executed: Free_LigGlyph( &lg[m] );
0
610 -
611 FREE( lg );
never executed: }
never executed: }
never evaluated: (lg)
never evaluated: 0
0
612 -
613Fail2:
code before this statement never executed: Fail2:
0
614 _HB_OPEN_Free_Coverage( &lcl->Coverage );
never executed (the execution status of this line is deduced): _HB_OPEN_Free_Coverage( &lcl->Coverage );
-
615 return error;
never executed: return error;
0
616} -
617 -
618 -
619static void Free_LigCaretList( HB_LigCaretList* lcl ) -
620{ -
621 HB_UShort n, count;
executed (the execution status of this line is deduced): HB_UShort n, count;
-
622 -
623 HB_LigGlyph* lg;
executed (the execution status of this line is deduced): HB_LigGlyph* lg;
-
624 -
625 -
626 if ( !lcl->loaded )
partially evaluated: !lcl->loaded
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:129
0-129
627 return;
never executed: return;
0
628 -
629 if ( lcl->LigGlyph )
evaluated: lcl->LigGlyph
TRUEFALSE
yes
Evaluation Count:5
yes
Evaluation Count:124
5-124
630 { -
631 count = lcl->LigGlyphCount;
executed (the execution status of this line is deduced): count = lcl->LigGlyphCount;
-
632 lg = lcl->LigGlyph;
executed (the execution status of this line is deduced): lg = lcl->LigGlyph;
-
633 -
634 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:8
yes
Evaluation Count:5
5-8
635 Free_LigGlyph( &lg[n] );
executed: Free_LigGlyph( &lg[n] );
Execution Count:8
8
636 -
637 FREE( lg );
executed: }
Execution Count:5
executed: }
Execution Count:5
partially evaluated: (lg)
TRUEFALSE
yes
Evaluation Count:5
no
Evaluation Count:0
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5
0-5
638 }
executed: }
Execution Count:5
5
639 -
640 _HB_OPEN_Free_Coverage( &lcl->Coverage );
executed (the execution status of this line is deduced): _HB_OPEN_Free_Coverage( &lcl->Coverage );
-
641}
executed: }
Execution Count:129
129
642 -
643 -
644 -
645/*********** -
646 * GDEF API -
647 ***********/ -
648 -
649 -
650static HB_UShort Get_New_Class( HB_GDEFHeader* gdef, -
651 HB_UShort glyphID, -
652 HB_UShort index ) -
653{ -
654 HB_UShort glyph_index, array_index, count;
never executed (the execution status of this line is deduced): HB_UShort glyph_index, array_index, count;
-
655 HB_UShort byte, bits;
never executed (the execution status of this line is deduced): HB_UShort byte, bits;
-
656 -
657 HB_ClassRangeRecord* gcrr;
never executed (the execution status of this line is deduced): HB_ClassRangeRecord* gcrr;
-
658 HB_UShort** ngc;
never executed (the execution status of this line is deduced): HB_UShort** ngc;
-
659 -
660 -
661 if ( glyphID >= gdef->LastGlyph )
never evaluated: glyphID >= gdef->LastGlyph
0
662 return 0;
never executed: return 0;
0
663 -
664 count = gdef->GlyphClassDef.cd.cd2.ClassRangeCount;
never executed (the execution status of this line is deduced): count = gdef->GlyphClassDef.cd.cd2.ClassRangeCount;
-
665 gcrr = gdef->GlyphClassDef.cd.cd2.ClassRangeRecord;
never executed (the execution status of this line is deduced): gcrr = gdef->GlyphClassDef.cd.cd2.ClassRangeRecord;
-
666 ngc = gdef->NewGlyphClasses;
never executed (the execution status of this line is deduced): ngc = gdef->NewGlyphClasses;
-
667 -
668 if ( index < count && glyphID < gcrr[index].Start )
never evaluated: index < count
never evaluated: glyphID < gcrr[index].Start
0
669 { -
670 array_index = index;
never executed (the execution status of this line is deduced): array_index = index;
-
671 if ( index == 0 )
never evaluated: index == 0
0
672 glyph_index = glyphID;
never executed: glyph_index = glyphID;
0
673 else -
674 glyph_index = glyphID - gcrr[index - 1].End - 1;
never executed: glyph_index = glyphID - gcrr[index - 1].End - 1;
0
675 } -
676 else -
677 { -
678 array_index = index + 1;
never executed (the execution status of this line is deduced): array_index = index + 1;
-
679 glyph_index = glyphID - gcrr[index].End - 1;
never executed (the execution status of this line is deduced): glyph_index = glyphID - gcrr[index].End - 1;
-
680 }
never executed: }
0
681 -
682 byte = ngc[array_index][glyph_index / 4];
never executed (the execution status of this line is deduced): byte = ngc[array_index][glyph_index / 4];
-
683 bits = byte >> ( 16 - ( glyph_index % 4 + 1 ) * 4 );
never executed (the execution status of this line is deduced): bits = byte >> ( 16 - ( glyph_index % 4 + 1 ) * 4 );
-
684 -
685 return bits & 0x000F;
never executed: return bits & 0x000F;
0
686} -
687 -
688 -
689 -
690HB_Error HB_GDEF_Get_Glyph_Property( HB_GDEFHeader* gdef, -
691 HB_UShort glyphID, -
692 HB_UShort* property ) -
693{ -
694 HB_UShort class = 0, index = 0; /* shut compiler up */
executed (the execution status of this line is deduced): HB_UShort class = 0, index = 0;
-
695 -
696 HB_Error error;
executed (the execution status of this line is deduced): HB_Error error;
-
697 -
698 -
699 if ( !gdef || !property )
partially evaluated: !gdef
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3541657
partially evaluated: !property
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3541657
0-3541657
700 return ERR(HB_Err_Invalid_Argument);
never executed: return _hb_err (HB_Err_Invalid_Argument);
0
701 -
702 /* first, we check for mark attach classes */ -
703 -
704 if ( gdef->MarkAttachClassDef.loaded )
partially evaluated: gdef->MarkAttachClassDef.loaded
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3541657
0-3541657
705 { -
706 error = _HB_OPEN_Get_Class( &gdef->MarkAttachClassDef, glyphID, &class, &index );
never executed (the execution status of this line is deduced): error = _HB_OPEN_Get_Class( &gdef->MarkAttachClassDef, glyphID, &class, &index );
-
707 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
708 return error;
never executed: return error;
0
709 if ( !error )
never evaluated: !error
0
710 { -
711 *property = class << 8;
never executed (the execution status of this line is deduced): *property = class << 8;
-
712 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
713 } -
714 }
never executed: }
0
715 -
716 error = _HB_OPEN_Get_Class( &gdef->GlyphClassDef, glyphID, &class, &index );
executed (the execution status of this line is deduced): error = _HB_OPEN_Get_Class( &gdef->GlyphClassDef, glyphID, &class, &index );
-
717 if ( error && error != HB_Err_Not_Covered )
evaluated: error
TRUEFALSE
yes
Evaluation Count:10876
yes
Evaluation Count:3530781
partially evaluated: error != HB_Err_Not_Covered
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:10876
0-3530781
718 return error;
never executed: return error;
0
719 -
720 /* if we have a constructed class table, check whether additional -
721 values have been assigned */ -
722 -
723 if ( error == HB_Err_Not_Covered && gdef->NewGlyphClasses )
evaluated: error == HB_Err_Not_Covered
TRUEFALSE
yes
Evaluation Count:10876
yes
Evaluation Count:3530781
partially evaluated: gdef->NewGlyphClasses
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:10876
0-3530781
724 class = Get_New_Class( gdef, glyphID, index );
never executed: class = Get_New_Class( gdef, glyphID, index );
0
725 -
726 switch ( class ) -
727 { -
728 default: -
729 case UNCLASSIFIED_GLYPH: -
730 *property = 0;
executed (the execution status of this line is deduced): *property = 0;
-
731 break;
executed: break;
Execution Count:10876
10876
732 -
733 case SIMPLE_GLYPH: -
734 *property = HB_GDEF_BASE_GLYPH;
executed (the execution status of this line is deduced): *property = 0x0002;
-
735 break;
executed: break;
Execution Count:3315737
3315737
736 -
737 case LIGATURE_GLYPH: -
738 *property = HB_GDEF_LIGATURE;
executed (the execution status of this line is deduced): *property = 0x0004;
-
739 break;
executed: break;
Execution Count:9979
9979
740 -
741 case MARK_GLYPH: -
742 *property = HB_GDEF_MARK;
executed (the execution status of this line is deduced): *property = 0x0008;
-
743 break;
executed: break;
Execution Count:205065
205065
744 -
745 case COMPONENT_GLYPH: -
746 *property = HB_GDEF_COMPONENT;
never executed (the execution status of this line is deduced): *property = 0x0010;
-
747 break;
never executed: break;
0
748 } -
749 -
750 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:3541657
3541657
751} -
752 -
753 -
754static HB_Error Make_ClassRange( HB_ClassDefinition* cd, -
755 HB_UShort start, -
756 HB_UShort end, -
757 HB_UShort class ) -
758{ -
759 HB_Error error;
never executed (the execution status of this line is deduced): HB_Error error;
-
760 HB_UShort index;
never executed (the execution status of this line is deduced): HB_UShort index;
-
761 -
762 HB_ClassDefFormat2* cdf2;
never executed (the execution status of this line is deduced): HB_ClassDefFormat2* cdf2;
-
763 HB_ClassRangeRecord* crr;
never executed (the execution status of this line is deduced): HB_ClassRangeRecord* crr;
-
764 -
765 -
766 cdf2 = &cd->cd.cd2;
never executed (the execution status of this line is deduced): cdf2 = &cd->cd.cd2;
-
767 -
768 if ( REALLOC_ARRAY( cdf2->ClassRangeRecord,
never evaluated: ( (cdf2->ClassRangeRecord) = _hb_realloc( (cdf2->ClassRangeRecord), ((cdf2->ClassRangeCount + 1)*sizeof(HB_ClassRangeRecord)), &error ), error != 0 )
0
769 cdf2->ClassRangeCount + 1 , -
770 HB_ClassRangeRecord ) ) -
771 return error;
never executed: return error;
0
772 -
773 cdf2->ClassRangeCount++;
never executed (the execution status of this line is deduced): cdf2->ClassRangeCount++;
-
774 -
775 crr = cdf2->ClassRangeRecord;
never executed (the execution status of this line is deduced): crr = cdf2->ClassRangeRecord;
-
776 index = cdf2->ClassRangeCount - 1;
never executed (the execution status of this line is deduced): index = cdf2->ClassRangeCount - 1;
-
777 -
778 crr[index].Start = start;
never executed (the execution status of this line is deduced): crr[index].Start = start;
-
779 crr[index].End = end;
never executed (the execution status of this line is deduced): crr[index].End = end;
-
780 crr[index].Class = class;
never executed (the execution status of this line is deduced): crr[index].Class = class;
-
781 -
782 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
783} -
784 -
785 -
786 -
787HB_Error HB_GDEF_Build_ClassDefinition( HB_GDEFHeader* gdef, -
788 HB_UShort num_glyphs, -
789 HB_UShort glyph_count, -
790 HB_UShort* glyph_array, -
791 HB_UShort* class_array ) -
792{ -
793 HB_UShort start, curr_glyph, curr_class;
never executed (the execution status of this line is deduced): HB_UShort start, curr_glyph, curr_class;
-
794 HB_UShort n, m, count;
never executed (the execution status of this line is deduced): HB_UShort n, m, count;
-
795 HB_Error error;
never executed (the execution status of this line is deduced): HB_Error error;
-
796 -
797 HB_ClassDefinition* gcd;
never executed (the execution status of this line is deduced): HB_ClassDefinition* gcd;
-
798 HB_ClassRangeRecord* gcrr;
never executed (the execution status of this line is deduced): HB_ClassRangeRecord* gcrr;
-
799 HB_UShort** ngc;
never executed (the execution status of this line is deduced): HB_UShort** ngc;
-
800 -
801 -
802 if ( !gdef || !glyph_array || !class_array )
never evaluated: !gdef
never evaluated: !glyph_array
never evaluated: !class_array
0
803 return ERR(HB_Err_Invalid_Argument);
never executed: return _hb_err (HB_Err_Invalid_Argument);
0
804 -
805 gcd = &gdef->GlyphClassDef;
never executed (the execution status of this line is deduced): gcd = &gdef->GlyphClassDef;
-
806 -
807 /* We build a format 2 table */ -
808 -
809 gcd->ClassFormat = 2;
never executed (the execution status of this line is deduced): gcd->ClassFormat = 2;
-
810 -
811 gcd->cd.cd2.ClassRangeCount = 0;
never executed (the execution status of this line is deduced): gcd->cd.cd2.ClassRangeCount = 0;
-
812 gcd->cd.cd2.ClassRangeRecord = NULL;
never executed (the execution status of this line is deduced): gcd->cd.cd2.ClassRangeRecord = ((void *)0);
-
813 -
814 start = glyph_array[0];
never executed (the execution status of this line is deduced): start = glyph_array[0];
-
815 curr_class = class_array[0];
never executed (the execution status of this line is deduced): curr_class = class_array[0];
-
816 curr_glyph = start;
never executed (the execution status of this line is deduced): curr_glyph = start;
-
817 -
818 if ( curr_class >= 5 )
never evaluated: curr_class >= 5
0
819 { -
820 error = ERR(HB_Err_Invalid_Argument);
never executed (the execution status of this line is deduced): error = _hb_err (HB_Err_Invalid_Argument);
-
821 goto Fail4;
never executed: goto Fail4;
0
822 } -
823 -
824 glyph_count--;
never executed (the execution status of this line is deduced): glyph_count--;
-
825 -
826 for ( n = 0; n < glyph_count + 1; n++ )
never evaluated: n < glyph_count + 1
0
827 { -
828 if ( curr_glyph == glyph_array[n] && curr_class == class_array[n] )
never evaluated: curr_glyph == glyph_array[n]
never evaluated: curr_class == class_array[n]
0
829 { -
830 if ( n == glyph_count )
never evaluated: n == glyph_count
0
831 { -
832 if ( ( error = Make_ClassRange( gcd, start,
never evaluated: ( error = Make_ClassRange( gcd, start, curr_glyph, curr_class) ) != HB_Err_Ok
0
833 curr_glyph,
never evaluated: ( error = Make_ClassRange( gcd, start, curr_glyph, curr_class) ) != HB_Err_Ok
0
834 curr_class) ) != HB_Err_Ok )
never evaluated: ( error = Make_ClassRange( gcd, start, curr_glyph, curr_class) ) != HB_Err_Ok
0
835 goto Fail3;
never executed: goto Fail3;
0
836 }
never executed: }
0
837 else -
838 { -
839 if ( curr_glyph == 0xFFFF )
never evaluated: curr_glyph == 0xFFFF
0
840 { -
841 error = ERR(HB_Err_Invalid_Argument);
never executed (the execution status of this line is deduced): error = _hb_err (HB_Err_Invalid_Argument);
-
842 goto Fail3;
never executed: goto Fail3;
0
843 } -
844 else -
845 curr_glyph++;
never executed: curr_glyph++;
0
846 } -
847 } -
848 else -
849 { -
850 if ( ( error = Make_ClassRange( gcd, start,
never evaluated: ( error = Make_ClassRange( gcd, start, curr_glyph - 1, curr_class) ) != HB_Err_Ok
0
851 curr_glyph - 1,
never evaluated: ( error = Make_ClassRange( gcd, start, curr_glyph - 1, curr_class) ) != HB_Err_Ok
0
852 curr_class) ) != HB_Err_Ok )
never evaluated: ( error = Make_ClassRange( gcd, start, curr_glyph - 1, curr_class) ) != HB_Err_Ok
0
853 goto Fail3;
never executed: goto Fail3;
0
854 -
855 if ( curr_glyph > glyph_array[n] )
never evaluated: curr_glyph > glyph_array[n]
0
856 { -
857 error = ERR(HB_Err_Invalid_Argument);
never executed (the execution status of this line is deduced): error = _hb_err (HB_Err_Invalid_Argument);
-
858 goto Fail3;
never executed: goto Fail3;
0
859 } -
860 -
861 start = glyph_array[n];
never executed (the execution status of this line is deduced): start = glyph_array[n];
-
862 curr_class = class_array[n];
never executed (the execution status of this line is deduced): curr_class = class_array[n];
-
863 curr_glyph = start;
never executed (the execution status of this line is deduced): curr_glyph = start;
-
864 -
865 if ( curr_class >= 5 )
never evaluated: curr_class >= 5
0
866 { -
867 error = ERR(HB_Err_Invalid_Argument);
never executed (the execution status of this line is deduced): error = _hb_err (HB_Err_Invalid_Argument);
-
868 goto Fail3;
never executed: goto Fail3;
0
869 } -
870 -
871 if ( n == glyph_count )
never evaluated: n == glyph_count
0
872 { -
873 if ( ( error = Make_ClassRange( gcd, start,
never evaluated: ( error = Make_ClassRange( gcd, start, curr_glyph, curr_class) ) != HB_Err_Ok
0
874 curr_glyph,
never evaluated: ( error = Make_ClassRange( gcd, start, curr_glyph, curr_class) ) != HB_Err_Ok
0
875 curr_class) ) != HB_Err_Ok )
never evaluated: ( error = Make_ClassRange( gcd, start, curr_glyph, curr_class) ) != HB_Err_Ok
0
876 goto Fail3;
never executed: goto Fail3;
0
877 }
never executed: }
0
878 else -
879 { -
880 if ( curr_glyph == 0xFFFF )
never evaluated: curr_glyph == 0xFFFF
0
881 { -
882 error = ERR(HB_Err_Invalid_Argument);
never executed (the execution status of this line is deduced): error = _hb_err (HB_Err_Invalid_Argument);
-
883 goto Fail3;
never executed: goto Fail3;
0
884 } -
885 else -
886 curr_glyph++;
never executed: curr_glyph++;
0
887 } -
888 } -
889 } -
890 -
891 /* now prepare the arrays for class values assigned during the lookup -
892 process */ -
893 -
894 if ( ALLOC_ARRAY( gdef->NewGlyphClasses,
never evaluated: ( (gdef->NewGlyphClasses) = _hb_alloc( (gcd->cd.cd2.ClassRangeCount + 1)*sizeof(HB_UShort*), &error ), error != 0 )
0
895 gcd->cd.cd2.ClassRangeCount + 1, HB_UShort* ) ) -
896 goto Fail3;
never executed: goto Fail3;
0
897 -
898 count = gcd->cd.cd2.ClassRangeCount;
never executed (the execution status of this line is deduced): count = gcd->cd.cd2.ClassRangeCount;
-
899 gcrr = gcd->cd.cd2.ClassRangeRecord;
never executed (the execution status of this line is deduced): gcrr = gcd->cd.cd2.ClassRangeRecord;
-
900 ngc = gdef->NewGlyphClasses;
never executed (the execution status of this line is deduced): ngc = gdef->NewGlyphClasses;
-
901 -
902 /* We allocate arrays for all glyphs not covered by the class range -
903 records. Each element holds four class values. */ -
904 -
905 if ( count > 0 )
never evaluated: count > 0
0
906 { -
907 if ( gcrr[0].Start )
never evaluated: gcrr[0].Start
0
908 { -
909 if ( ALLOC_ARRAY( ngc[0], ( gcrr[0].Start + 3 ) / 4, HB_UShort ) )
never evaluated: ( (ngc[0]) = _hb_alloc( (( gcrr[0].Start + 3 ) / 4)*sizeof(HB_UShort), &error ), error != 0 )
0
910 goto Fail2;
never executed: goto Fail2;
0
911 }
never executed: }
0
912 -
913 for ( n = 1; n < count; n++ )
never evaluated: n < count
0
914 { -
915 if ( gcrr[n].Start - gcrr[n - 1].End > 1 )
never evaluated: gcrr[n].Start - gcrr[n - 1].End > 1
0
916 if ( ALLOC_ARRAY( ngc[n],
never evaluated: ( (ngc[n]) = _hb_alloc( (( gcrr[n].Start - gcrr[n - 1].End + 2 ) / 4)*sizeof(HB_UShort), &error ), error != 0 )
0
917 ( gcrr[n].Start - gcrr[n - 1].End + 2 ) / 4, -
918 HB_UShort ) ) -
919 goto Fail1;
never executed: goto Fail1;
0
920 }
never executed: }
0
921 -
922 if ( gcrr[count - 1].End != num_glyphs - 1 )
never evaluated: gcrr[count - 1].End != num_glyphs - 1
0
923 { -
924 if ( ALLOC_ARRAY( ngc[count],
never evaluated: ( (ngc[count]) = _hb_alloc( (( num_glyphs - gcrr[count - 1].End + 2 ) / 4)*sizeof(HB_UShort), &error ), error != 0 )
0
925 ( num_glyphs - gcrr[count - 1].End + 2 ) / 4, -
926 HB_UShort ) ) -
927 goto Fail1;
never executed: goto Fail1;
0
928 }
never executed: }
0
929 }
never executed: }
0
930 else if ( num_glyphs > 0 )
never evaluated: num_glyphs > 0
0
931 { -
932 if ( ALLOC_ARRAY( ngc[count],
never evaluated: ( (ngc[count]) = _hb_alloc( (( num_glyphs + 3 ) / 4)*sizeof(HB_UShort), &error ), error != 0 )
0
933 ( num_glyphs + 3 ) / 4, -
934 HB_UShort ) ) -
935 goto Fail2;
never executed: goto Fail2;
0
936 }
never executed: }
0
937 -
938 gdef->LastGlyph = num_glyphs - 1;
never executed (the execution status of this line is deduced): gdef->LastGlyph = num_glyphs - 1;
-
939 -
940 gdef->MarkAttachClassDef_offset = 0L;
never executed (the execution status of this line is deduced): gdef->MarkAttachClassDef_offset = 0L;
-
941 gdef->MarkAttachClassDef.loaded = FALSE;
never executed (the execution status of this line is deduced): gdef->MarkAttachClassDef.loaded = 0;
-
942 -
943 gcd->loaded = TRUE;
never executed (the execution status of this line is deduced): gcd->loaded = (!0);
-
944 -
945 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
946 -
947Fail1: -
948 for ( m = 0; m < n; m++ )
never evaluated: m < n
0
949 FREE( ngc[m] );
never executed: }
never executed: }
never evaluated: (ngc[m])
never evaluated: 0
0
950 -
951Fail2:
code before this statement never executed: Fail2:
0
952 FREE( gdef->NewGlyphClasses );
never executed: }
never executed: }
never evaluated: (gdef->NewGlyphClasses)
never evaluated: 0
0
953 -
954Fail3:
code before this statement never executed: Fail3:
0
955 FREE( gcd->cd.cd2.ClassRangeRecord );
never executed: }
never executed: }
never evaluated: (gcd->cd.cd2.ClassRangeRecord)
never evaluated: 0
0
956 -
957Fail4: -
958 return error;
never executed: return error;
0
959} -
960 -
961 -
962static void Free_NewGlyphClasses( HB_GDEFHeader* gdef ) -
963{ -
964 HB_UShort** ngc;
executed (the execution status of this line is deduced): HB_UShort** ngc;
-
965 HB_UShort n, count;
executed (the execution status of this line is deduced): HB_UShort n, count;
-
966 -
967 -
968 if ( gdef->NewGlyphClasses )
partially evaluated: gdef->NewGlyphClasses
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:129
0-129
969 { -
970 count = gdef->GlyphClassDef.cd.cd2.ClassRangeCount + 1;
never executed (the execution status of this line is deduced): count = gdef->GlyphClassDef.cd.cd2.ClassRangeCount + 1;
-
971 ngc = gdef->NewGlyphClasses;
never executed (the execution status of this line is deduced): ngc = gdef->NewGlyphClasses;
-
972 -
973 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
974 FREE( ngc[n] );
never executed: }
never executed: }
never evaluated: (ngc[n])
never evaluated: 0
0
975 -
976 FREE( ngc );
never executed: }
never executed: }
never evaluated: (ngc)
never evaluated: 0
0
977 }
never executed: }
0
978}
executed: }
Execution Count:129
129
979 -
980 -
981HB_INTERNAL HB_Error -
982_HB_GDEF_Add_Glyph_Property( HB_GDEFHeader* gdef, -
983 HB_UShort glyphID, -
984 HB_UShort property ) -
985{ -
986 HB_Error error;
never executed (the execution status of this line is deduced): HB_Error error;
-
987 HB_UShort class, new_class, index = 0; /* shut compiler up */
never executed (the execution status of this line is deduced): HB_UShort class, new_class, index = 0;
-
988 HB_UShort byte, bits, mask;
never executed (the execution status of this line is deduced): HB_UShort byte, bits, mask;
-
989 HB_UShort array_index, glyph_index, count;
never executed (the execution status of this line is deduced): HB_UShort array_index, glyph_index, count;
-
990 -
991 HB_ClassRangeRecord* gcrr;
never executed (the execution status of this line is deduced): HB_ClassRangeRecord* gcrr;
-
992 HB_UShort** ngc;
never executed (the execution status of this line is deduced): HB_UShort** ngc;
-
993 -
994 -
995 error = _HB_OPEN_Get_Class( &gdef->GlyphClassDef, glyphID, &class, &index );
never executed (the execution status of this line is deduced): error = _HB_OPEN_Get_Class( &gdef->GlyphClassDef, glyphID, &class, &index );
-
996 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
997 return error;
never executed: return error;
0
998 -
999 /* we don't accept glyphs covered in `GlyphClassDef' */ -
1000 -
1001 if ( !error )
never evaluated: !error
0
1002 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
1003 -
1004 switch ( property ) -
1005 { -
1006 case 0: -
1007 new_class = UNCLASSIFIED_GLYPH;
never executed (the execution status of this line is deduced): new_class = 0;
-
1008 break;
never executed: break;
0
1009 -
1010 case HB_GDEF_BASE_GLYPH: -
1011 new_class = SIMPLE_GLYPH;
never executed (the execution status of this line is deduced): new_class = 1;
-
1012 break;
never executed: break;
0
1013 -
1014 case HB_GDEF_LIGATURE: -
1015 new_class = LIGATURE_GLYPH;
never executed (the execution status of this line is deduced): new_class = 2;
-
1016 break;
never executed: break;
0
1017 -
1018 case HB_GDEF_MARK: -
1019 new_class = MARK_GLYPH;
never executed (the execution status of this line is deduced): new_class = 3;
-
1020 break;
never executed: break;
0
1021 -
1022 case HB_GDEF_COMPONENT: -
1023 new_class = COMPONENT_GLYPH;
never executed (the execution status of this line is deduced): new_class = 4;
-
1024 break;
never executed: break;
0
1025 -
1026 default: -
1027 return ERR(HB_Err_Invalid_Argument);
never executed: return _hb_err (HB_Err_Invalid_Argument);
0
1028 } -
1029 -
1030 count = gdef->GlyphClassDef.cd.cd2.ClassRangeCount;
never executed (the execution status of this line is deduced): count = gdef->GlyphClassDef.cd.cd2.ClassRangeCount;
-
1031 gcrr = gdef->GlyphClassDef.cd.cd2.ClassRangeRecord;
never executed (the execution status of this line is deduced): gcrr = gdef->GlyphClassDef.cd.cd2.ClassRangeRecord;
-
1032 ngc = gdef->NewGlyphClasses;
never executed (the execution status of this line is deduced): ngc = gdef->NewGlyphClasses;
-
1033 -
1034 if ( index < count && glyphID < gcrr[index].Start )
never evaluated: index < count
never evaluated: glyphID < gcrr[index].Start
0
1035 { -
1036 array_index = index;
never executed (the execution status of this line is deduced): array_index = index;
-
1037 if ( index == 0 )
never evaluated: index == 0
0
1038 glyph_index = glyphID;
never executed: glyph_index = glyphID;
0
1039 else -
1040 glyph_index = glyphID - gcrr[index - 1].End - 1;
never executed: glyph_index = glyphID - gcrr[index - 1].End - 1;
0
1041 } -
1042 else -
1043 { -
1044 array_index = index + 1;
never executed (the execution status of this line is deduced): array_index = index + 1;
-
1045 glyph_index = glyphID - gcrr[index].End - 1;
never executed (the execution status of this line is deduced): glyph_index = glyphID - gcrr[index].End - 1;
-
1046 }
never executed: }
0
1047 -
1048 byte = ngc[array_index][glyph_index / 4];
never executed (the execution status of this line is deduced): byte = ngc[array_index][glyph_index / 4];
-
1049 bits = byte >> ( 16 - ( glyph_index % 4 + 1 ) * 4 );
never executed (the execution status of this line is deduced): bits = byte >> ( 16 - ( glyph_index % 4 + 1 ) * 4 );
-
1050 class = bits & 0x000F;
never executed (the execution status of this line is deduced): class = bits & 0x000F;
-
1051 -
1052 /* we don't overwrite existing entries */ -
1053 -
1054 if ( !class )
never evaluated: !class
0
1055 { -
1056 bits = new_class << ( 16 - ( glyph_index % 4 + 1 ) * 4 );
never executed (the execution status of this line is deduced): bits = new_class << ( 16 - ( glyph_index % 4 + 1 ) * 4 );
-
1057 mask = ~( 0x000F << ( 16 - ( glyph_index % 4 + 1 ) * 4 ) );
never executed (the execution status of this line is deduced): mask = ~( 0x000F << ( 16 - ( glyph_index % 4 + 1 ) * 4 ) );
-
1058 -
1059 ngc[array_index][glyph_index / 4] &= mask;
never executed (the execution status of this line is deduced): ngc[array_index][glyph_index / 4] &= mask;
-
1060 ngc[array_index][glyph_index / 4] |= bits;
never executed (the execution status of this line is deduced): ngc[array_index][glyph_index / 4] |= bits;
-
1061 }
never executed: }
0
1062 -
1063 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
1064} -
1065 -
1066 -
1067HB_INTERNAL HB_Error -
1068_HB_GDEF_Check_Property( HB_GDEFHeader* gdef, -
1069 HB_GlyphItem gitem, -
1070 HB_UShort flags, -
1071 HB_UShort* property ) -
1072{ -
1073 HB_Error error;
executed (the execution status of this line is deduced): HB_Error error;
-
1074 -
1075 if ( gdef )
evaluated: gdef
TRUEFALSE
yes
Evaluation Count:67971957
yes
Evaluation Count:54
54-67971957
1076 { -
1077 HB_UShort basic_glyph_class;
executed (the execution status of this line is deduced): HB_UShort basic_glyph_class;
-
1078 HB_UShort desired_attachment_class;
executed (the execution status of this line is deduced): HB_UShort desired_attachment_class;
-
1079 -
1080 if ( gitem->gproperties == HB_GLYPH_PROPERTIES_UNKNOWN )
evaluated: gitem->gproperties == 0xFFFF
TRUEFALSE
yes
Evaluation Count:3336533
yes
Evaluation Count:64635424
3336533-64635424
1081 { -
1082 error = HB_GDEF_Get_Glyph_Property( gdef, gitem->gindex, &gitem->gproperties );
executed (the execution status of this line is deduced): error = HB_GDEF_Get_Glyph_Property( gdef, gitem->gindex, &gitem->gproperties );
-
1083 if ( error )
partially evaluated: error
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3336533
0-3336533
1084 return error;
never executed: return error;
0
1085 }
executed: }
Execution Count:3336533
3336533
1086 -
1087 *property = gitem->gproperties;
executed (the execution status of this line is deduced): *property = gitem->gproperties;
-
1088 -
1089 /* If the glyph was found in the MarkAttachmentClass table, -
1090 * then that class value is the high byte of the result, -
1091 * otherwise the low byte contains the basic type of the glyph -
1092 * as defined by the GlyphClassDef table. -
1093 */ -
1094 if ( *property & HB_LOOKUP_FLAG_IGNORE_SPECIAL_MARKS )
partially evaluated: *property & 0xFF00
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:67971957
0-67971957
1095 basic_glyph_class = HB_GDEF_MARK;
never executed: basic_glyph_class = 0x0008;
0
1096 else -
1097 basic_glyph_class = *property;
executed: basic_glyph_class = *property;
Execution Count:67971957
67971957
1098 -
1099 /* Return Not_Covered, if, for example, basic_glyph_class -
1100 * is HB_GDEF_LIGATURE and LookFlags includes HB_LOOKUP_FLAG_IGNORE_LIGATURES -
1101 */ -
1102 if ( flags & basic_glyph_class )
evaluated: flags & basic_glyph_class
TRUEFALSE
yes
Evaluation Count:69314
yes
Evaluation Count:67902643
69314-67902643
1103 return HB_Err_Not_Covered;
executed: return HB_Err_Not_Covered;
Execution Count:69314
69314
1104 -
1105 /* The high byte of LookupFlags has the meaning -
1106 * "ignore marks of attachment type different than -
1107 * the attachment type specified." -
1108 */ -
1109 desired_attachment_class = flags & HB_LOOKUP_FLAG_IGNORE_SPECIAL_MARKS;
executed (the execution status of this line is deduced): desired_attachment_class = flags & 0xFF00;
-
1110 if ( desired_attachment_class )
partially evaluated: desired_attachment_class
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:67902643
0-67902643
1111 { -
1112 if ( basic_glyph_class == HB_GDEF_MARK &&
never evaluated: basic_glyph_class == 0x0008
0
1113 *property != desired_attachment_class )
never evaluated: *property != desired_attachment_class
0
1114 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
1115 }
never executed: }
0
1116 } else {
executed: }
Execution Count:67902643
67902643
1117 *property = 0;
executed (the execution status of this line is deduced): *property = 0;
-
1118 }
executed: }
Execution Count:54
54
1119 -
1120 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:67902697
67902697
1121} -
1122 -
1123HB_INTERNAL HB_Error -
1124_HB_GDEF_LoadMarkAttachClassDef_From_LookupFlags( HB_GDEFHeader* gdef, -
1125 HB_Stream stream, -
1126 HB_Lookup* lo, -
1127 HB_UShort num_lookups) -
1128{ -
1129 HB_Error error = HB_Err_Ok;
executed (the execution status of this line is deduced): HB_Error error = HB_Err_Ok;
-
1130 HB_UShort i;
executed (the execution status of this line is deduced): HB_UShort i;
-
1131 -
1132 /* We now check the LookupFlags for values larger than 0xFF to find -
1133 out whether we need to load the `MarkAttachClassDef' field of the -
1134 GDEF table -- this hack is necessary for OpenType 1.2 tables since -
1135 the version field of the GDEF table hasn't been incremented. -
1136 -
1137 For constructed GDEF tables, we only load it if -
1138 `MarkAttachClassDef_offset' is not zero (nevertheless, a build of -
1139 a constructed mark attach table is not supported currently). */ -
1140 -
1141 if ( gdef &&
evaluated: gdef
TRUEFALSE
yes
Evaluation Count:272
yes
Evaluation Count:6
6-272
1142 gdef->MarkAttachClassDef_offset && !gdef->MarkAttachClassDef.loaded )
evaluated: gdef->MarkAttachClassDef_offset
TRUEFALSE
yes
Evaluation Count:180
yes
Evaluation Count:92
partially evaluated: !gdef->MarkAttachClassDef.loaded
TRUEFALSE
yes
Evaluation Count:180
no
Evaluation Count:0
0-180
1143 { -
1144 for ( i = 0; i < num_lookups; i++ )
evaluated: i < num_lookups
TRUEFALSE
yes
Evaluation Count:4950
yes
Evaluation Count:180
180-4950
1145 { -
1146 -
1147 if ( lo[i].LookupFlag & HB_LOOKUP_FLAG_IGNORE_SPECIAL_MARKS )
partially evaluated: lo[i].LookupFlag & 0xFF00
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4950
0-4950
1148 { -
1149 if ( FILE_Seek( gdef->MarkAttachClassDef_offset ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, gdef->MarkAttachClassDef_offset ))) != 0 )
0
1150 ( error = _HB_OPEN_Load_ClassDefinition( &gdef->MarkAttachClassDef,
never evaluated: ( error = _HB_OPEN_Load_ClassDefinition( &gdef->MarkAttachClassDef, 256, stream ) ) != HB_Err_Ok
0
1151 256, stream ) ) != HB_Err_Ok )
never evaluated: ( error = _HB_OPEN_Load_ClassDefinition( &gdef->MarkAttachClassDef, 256, stream ) ) != HB_Err_Ok
0
1152 goto Done;
never executed: goto Done;
0
1153 -
1154 break;
never executed: break;
0
1155 } -
1156 }
executed: }
Execution Count:4950
4950
1157 }
executed: }
Execution Count:180
180
1158 -
1159Done: -
1160 return error;
executed: return error;
Execution Count:278
278
1161} -
1162 -
1163/* END */ -
1164 -
Source codeSwitch to Preprocessed file

Generated by Squish Coco Non-Commercial