Debian Codegraph @

texk/web2c/mfluadir/otfcc/lib/support/options.c

raw
1 #include "otfcc/options.h"
2 #include "support/otfcc-alloc.h"
3
4 otfcc_Options *otfcc_newOptions() {
5 otfcc_Options *options;
6 NEW(options);
7 return options;
8 }
9 void otfcc_deleteOptions(otfcc_Options *options) {
10 if (options) {
11 FREE(options->glyph_name_prefix);
12 if (options->logger) options->logger->dispose(options->logger);
13 }
14 FREE(options);
15 }
16 void otfcc_Options_optimizeTo(otfcc_Options *options, uint8_t level) {
17 options->cff_rollCharString = false;
18 options->short_post = false;
19 options->ignore_glyph_order = false;
20 options->cff_short_vmtx = false;
21 options->merge_features = false;
22 options->force_cid = false;
23 options->cff_doSubroutinize = false;
24
25 if (level >= 1) {
26 options->cff_rollCharString = true;
27 options->cff_short_vmtx = true;
28 }
29 if (level >= 2) {
30 options->short_post = true;
31 options->cff_doSubroutinize = true;
32 options->merge_features = true;
33 }
34 if (level >= 3) {
35 options->ignore_glyph_order = true;
36 options->force_cid = true;
37 }
38 }