| line |
true |
false |
branch |
|
23
|
0 |
0 |
if (!ts) return; |
|
52
|
0 |
0 |
pdfmake_glyph_cache_t *cache = ts ? ts->cache : NULL; |
|
54
|
0 |
0 |
if (ts) ts->cache = cache; |
|
63
|
0 |
0 |
if (!ts || !font) return PDFMAKE_TEXT_ERR_NULL; |
|
|
0 |
0 |
if (!ts || !font) return PDFMAKE_TEXT_ERR_NULL; |
|
69
|
0 |
0 |
if (!ts->cache || ts->cache->glyph_count == 0) { |
|
|
0 |
0 |
if (!ts->cache || ts->cache->glyph_count == 0) { |
|
71
|
0 |
0 |
if (!ts->cache) return PDFMAKE_TEXT_ERR_MEMORY; |
|
81
|
0 |
0 |
if (!ts) return; |
|
95
|
0 |
0 |
if (!ts) return; |
|
104
|
0 |
0 |
if (!ts) return; |
|
127
|
0 |
0 |
if (!ts || !out) return; |
|
|
0 |
0 |
if (!ts || !out) return; |
|
133
|
0 |
0 |
if (ctx) { |
|
163
|
0 |
0 |
if (!ts || !out) return; |
|
|
0 |
0 |
if (!ts || !out) return; |
|
167
|
0 |
0 |
if (ts->font) { |
|
168
|
0 |
0 |
if (ts->font->type == PDFMAKE_FONT_TRUETYPE || |
|
169
|
0 |
0 |
ts->font->type == PDFMAKE_FONT_CID_TRUETYPE) { |
|
170
|
0 |
0 |
if (ts->font->ttf) { |
|
202
|
0 |
0 |
if (ctx) { |
|
225
|
0 |
0 |
if (!ts) return; |
|
231
|
0 |
0 |
if (is_space) { |
|
251
|
0 |
0 |
if (*p >= end) return 0xFFFD; |
|
255
|
0 |
0 |
if (c < 0x80) { |
|
259
|
0 |
0 |
if ((c & 0xE0) == 0xC0) { |
|
260
|
0 |
0 |
if (*p >= end) return 0xFFFD; |
|
262
|
0 |
0 |
if ((c2 & 0xC0) != 0x80) return 0xFFFD; |
|
266
|
0 |
0 |
if ((c & 0xF0) == 0xE0) { |
|
267
|
0 |
0 |
if (*p + 1 >= end) return 0xFFFD; |
|
270
|
0 |
0 |
if ((c2 & 0xC0) != 0x80 || (c3 & 0xC0) != 0x80) return 0xFFFD; |
|
|
0 |
0 |
if ((c2 & 0xC0) != 0x80 || (c3 & 0xC0) != 0x80) return 0xFFFD; |
|
274
|
0 |
0 |
if ((c & 0xF8) == 0xF0) { |
|
275
|
0 |
0 |
if (*p + 2 >= end) return 0xFFFD; |
|
279
|
0 |
0 |
if ((c2 & 0xC0) != 0x80 || (c3 & 0xC0) != 0x80 || |
|
|
0 |
0 |
if ((c2 & 0xC0) != 0x80 || (c3 & 0xC0) != 0x80 || |
|
280
|
0 |
0 |
(c4 & 0xC0) != 0x80) return 0xFFFD; |
|
301
|
0 |
0 |
if (!ctx || !ts || !ts->font) return PDFMAKE_TEXT_ERR_NULL; |
|
|
0 |
0 |
if (!ctx || !ts || !ts->font) return PDFMAKE_TEXT_ERR_NULL; |
|
|
0 |
0 |
if (!ctx || !ts || !ts->font) return PDFMAKE_TEXT_ERR_NULL; |
|
302
|
0 |
0 |
if (!ts->cache) return PDFMAKE_TEXT_ERR_INVALID_FONT; |
|
308
|
0 |
0 |
if (!outline) { |
|
314
|
0 |
0 |
if (ts->render_mode == PDFMAKE_TEXT_INVISIBLE) { |
|
322
|
0 |
0 |
if (outline && outline->path && outline->path->seg_count > 0) { |
|
|
0 |
0 |
if (outline && outline->path && outline->path->seg_count > 0) { |
|
|
0 |
0 |
if (outline && outline->path && outline->path->seg_count > 0) { |
|
337
|
0 |
0 |
if (transformed) { |
|
340
|
0 |
0 |
ts->render_mode == PDFMAKE_TEXT_FILL_STROKE || |
|
341
|
0 |
0 |
ts->render_mode == PDFMAKE_TEXT_FILL_CLIP || |
|
|
0 |
0 |
ts->render_mode == PDFMAKE_TEXT_FILL_CLIP || |
|
342
|
0 |
0 |
ts->render_mode == PDFMAKE_TEXT_FILL_STROKE_CLIP); |
|
345
|
0 |
0 |
ts->render_mode == PDFMAKE_TEXT_FILL_STROKE || |
|
346
|
0 |
0 |
ts->render_mode == PDFMAKE_TEXT_STROKE_CLIP || |
|
|
0 |
0 |
ts->render_mode == PDFMAKE_TEXT_STROKE_CLIP || |
|
347
|
0 |
0 |
ts->render_mode == PDFMAKE_TEXT_FILL_STROKE_CLIP); |
|
350
|
0 |
0 |
ts->render_mode == PDFMAKE_TEXT_STROKE_CLIP || |
|
351
|
0 |
0 |
ts->render_mode == PDFMAKE_TEXT_FILL_STROKE_CLIP || |
|
|
0 |
0 |
ts->render_mode == PDFMAKE_TEXT_FILL_STROKE_CLIP || |
|
352
|
0 |
0 |
ts->render_mode == PDFMAKE_TEXT_CLIP); |
|
355
|
0 |
0 |
if (do_fill) { |
|
360
|
0 |
0 |
if (do_stroke) { |
|
365
|
0 |
0 |
if (do_clip) { |
|
372
|
0 |
0 |
advance = outline ? outline->advance_width : 0; |
|
377
|
0 |
0 |
if (ts->font->type == PDFMAKE_FONT_TRUETYPE || |
|
378
|
0 |
0 |
ts->font->type == PDFMAKE_FONT_CID_TRUETYPE) { |
|
379
|
0 |
0 |
if (ts->font->ttf) { |
|
401
|
0 |
0 |
if (!ctx || !ts || !text) return PDFMAKE_TEXT_ERR_NULL; |
|
|
0 |
0 |
if (!ctx || !ts || !text) return PDFMAKE_TEXT_ERR_NULL; |
|
|
0 |
0 |
if (!ctx || !ts || !text) return PDFMAKE_TEXT_ERR_NULL; |
|
402
|
0 |
0 |
if (!ts->font) return PDFMAKE_TEXT_ERR_INVALID_FONT; |
|
405
|
0 |
0 |
for (i = 0; i < len; i++) { |
|
416
|
0 |
0 |
if (err != PDFMAKE_TEXT_OK) return err; |
|
419
|
0 |
0 |
if (is_space) { |
|
437
|
0 |
0 |
if (!ctx || !ts || !text) return PDFMAKE_TEXT_ERR_NULL; |
|
|
0 |
0 |
if (!ctx || !ts || !text) return PDFMAKE_TEXT_ERR_NULL; |
|
|
0 |
0 |
if (!ctx || !ts || !text) return PDFMAKE_TEXT_ERR_NULL; |
|
438
|
0 |
0 |
if (!ts->font) return PDFMAKE_TEXT_ERR_INVALID_FONT; |
|
443
|
0 |
0 |
while (p < end) { |
|
448
|
0 |
0 |
if (unicode == 0xFFFD) continue; |
|
458
|
0 |
0 |
if (err != PDFMAKE_TEXT_OK) return err; |
|
461
|
0 |
0 |
if (is_space) { |
|
478
|
0 |
0 |
if (!ctx || !ts || !elements) return PDFMAKE_TEXT_ERR_NULL; |
|
|
0 |
0 |
if (!ctx || !ts || !elements) return PDFMAKE_TEXT_ERR_NULL; |
|
|
0 |
0 |
if (!ctx || !ts || !elements) return PDFMAKE_TEXT_ERR_NULL; |
|
479
|
0 |
0 |
if (!ts->font) return PDFMAKE_TEXT_ERR_INVALID_FONT; |
|
481
|
0 |
0 |
for (i = 0; i < count; i++) { |
|
484
|
0 |
0 |
if (elem->type == PDFMAKE_TEXT_ELEM_STRING) { |
|
488
|
0 |
0 |
if (err != PDFMAKE_TEXT_OK) return err; |
|
489
|
0 |
0 |
} else if (elem->type == PDFMAKE_TEXT_ELEM_ADJUST) { |
|
519
|
0 |
0 |
if (!ctx || !ts || !text) return PDFMAKE_TEXT_ERR_NULL; |
|
|
0 |
0 |
if (!ctx || !ts || !text) return PDFMAKE_TEXT_ERR_NULL; |
|
|
0 |
0 |
if (!ctx || !ts || !text) return PDFMAKE_TEXT_ERR_NULL; |
|
542
|
0 |
0 |
if (!ts || !ts->font || !text) { |
|
|
0 |
0 |
if (!ts || !ts->font || !text) { |
|
|
0 |
0 |
if (!ts || !ts->font || !text) { |
|
543
|
0 |
0 |
if (out_width) *out_width = 0; |
|
544
|
0 |
0 |
if (out_height) *out_height = 0; |
|
545
|
0 |
0 |
if (out_descent) *out_descent = 0; |
|
551
|
0 |
0 |
if (out_width) *out_width = width; |
|
556
|
0 |
0 |
if (metrics) { |
|
559
|
0 |
0 |
if (out_height) { |
|
562
|
0 |
0 |
if (out_descent) { |
|
567
|
0 |
0 |
if (out_height) *out_height = ts->font_size; |
|
568
|
0 |
0 |
if (out_descent) *out_descent = -ts->font_size * 0.2; |