/work/workdir/UnpackedTarball/harfbuzz/src/hb-subset-table-var.cc
Line | Count | Source |
1 | | #include "hb-subset-table.hh" |
2 | | |
3 | | #include "hb-ot-var-hvar-table.hh" |
4 | | #include "hb-ot-var-gvar-table.hh" |
5 | | #include "hb-ot-var-fvar-table.hh" |
6 | | #include "hb-ot-var-avar-table.hh" |
7 | | #include "hb-ot-var-cvar-table.hh" |
8 | | #include "hb-ot-var-mvar-table.hh" |
9 | | #ifndef HB_NO_VAR_COMPOSITES |
10 | | #include "OT/Var/VARC/VARC-subset.hh" |
11 | | #endif |
12 | | |
13 | | bool _hb_subset_table_var (hb_subset_plan_t *plan, hb_vector_t<char> &buf, hb_tag_t tag, bool *success) |
14 | 179k | { |
15 | 179k | #ifndef HB_NO_VAR |
16 | 179k | switch (tag) |
17 | 179k | { |
18 | 0 | case HB_TAG('H','V','A','R'): *success = _hb_subset_table<const OT::HVAR> (plan, buf); return true; |
19 | 0 | case HB_TAG('V','V','A','R'): *success = _hb_subset_table<const OT::VVAR> (plan, buf); return true; |
20 | 0 | case HB_TAG('g','v','a','r'): *success = _hb_subset_table<const OT::gvar> (plan, buf); return true; |
21 | | #ifndef HB_NO_BEYOND_64K |
22 | | case HB_TAG('G','V','A','R'): *success = _hb_subset_table<const OT::GVAR> (plan, buf); return true; |
23 | | #endif |
24 | 0 | #ifndef HB_NO_VAR_COMPOSITES |
25 | 0 | case HB_TAG('V','A','R','C'): *success = _hb_subset_table<const OT::VARC> (plan, buf); return true; |
26 | 0 | #endif |
27 | 0 | case HB_TAG('f','v','a','r'): |
28 | 0 | if (plan->user_axes_location.is_empty ()) |
29 | 0 | *success = _hb_subset_table_passthrough (plan, tag); |
30 | 0 | else |
31 | 0 | *success = _hb_subset_table<const OT::fvar> (plan, buf); |
32 | 0 | return true; |
33 | 0 | case HB_TAG('a','v','a','r'): |
34 | 0 | if (plan->user_axes_location.is_empty ()) |
35 | 0 | *success = _hb_subset_table_passthrough (plan, tag); |
36 | 0 | else |
37 | 0 | *success = _hb_subset_table<const OT::avar> (plan, buf); |
38 | 0 | return true; |
39 | 0 | case HB_TAG('c','v','a','r'): |
40 | | /* TODO: For avar2 partial instancing, cull unreachable tuple |
41 | | * variations (avar2_reachable_ranges) instead of passing through. */ |
42 | 0 | if (plan->user_axes_location.is_empty () || |
43 | 0 | (plan->has_avar2 && !plan->normalized_coords)) |
44 | 0 | *success = _hb_subset_table_passthrough (plan, tag); |
45 | 0 | else |
46 | 0 | *success = _hb_subset_table<const OT::cvar> (plan, buf); |
47 | 0 | return true; |
48 | 0 | case HB_TAG('M','V','A','R'): |
49 | | /* TODO: For avar2 partial instancing, cull unreachable VarStore |
50 | | * regions (avar2_reachable_ranges) instead of passing through. */ |
51 | 0 | if (plan->user_axes_location.is_empty () || |
52 | 0 | (plan->has_avar2 && !plan->normalized_coords)) |
53 | 0 | *success = _hb_subset_table_passthrough (plan, tag); |
54 | 0 | else |
55 | 0 | *success = _hb_subset_table<const OT::MVAR> (plan, buf); |
56 | 0 | return true; |
57 | 179k | } |
58 | 179k | #endif |
59 | 179k | return false; |
60 | 179k | } |