equal
deleted
inserted
replaced
318 } |
318 } |
319 |
319 |
320 JNIEXPORT TTLayoutTableCache* newLayoutTableCache() { |
320 JNIEXPORT TTLayoutTableCache* newLayoutTableCache() { |
321 TTLayoutTableCache* ltc = calloc(1, sizeof(TTLayoutTableCache)); |
321 TTLayoutTableCache* ltc = calloc(1, sizeof(TTLayoutTableCache)); |
322 if (ltc) { |
322 if (ltc) { |
323 ltc->gsub_len = -1; |
323 int i; |
324 ltc->gpos_len = -1; |
324 for(i=0;i<LAYOUTCACHE_ENTRIES;i++) { |
325 ltc->gdef_len = -1; |
325 ltc->entries[i].len = -1; |
326 ltc->mort_len = -1; |
326 } |
327 ltc->kern_len = -1; |
|
328 } |
327 } |
329 return ltc; |
328 return ltc; |
330 } |
329 } |
331 |
330 |
332 JNIEXPORT void freeLayoutTableCache(TTLayoutTableCache* ltc) { |
331 JNIEXPORT void freeLayoutTableCache(TTLayoutTableCache* ltc) { |
333 if (ltc) { |
332 if (ltc) { |
334 if (ltc->gsub) free(ltc->gsub); |
333 int i; |
335 if (ltc->gpos) free(ltc->gpos); |
334 for(i=0;i<LAYOUTCACHE_ENTRIES;i++) { |
336 if (ltc->gdef) free(ltc->gdef); |
335 if(ltc->entries[i].ptr) free (ltc->entries[i].ptr); |
337 if (ltc->mort) free(ltc->mort); |
336 } |
338 if (ltc->kern) free(ltc->kern); |
|
339 if (ltc->kernPairs) free(ltc->kernPairs); |
337 if (ltc->kernPairs) free(ltc->kernPairs); |
340 free(ltc); |
338 free(ltc); |
341 } |
339 } |
342 } |
340 } |