Garret Rieger | af46a4d | 2018-02-05 17:14:46 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright © 2018 Google, Inc. |
| 3 | * |
| 4 | * This is part of HarfBuzz, a text shaping library. |
| 5 | * |
| 6 | * Permission is hereby granted, without written agreement and without |
| 7 | * license or royalty fees, to use, copy, modify, and distribute this |
| 8 | * software and its documentation for any purpose, provided that the |
| 9 | * above copyright notice and the following two paragraphs appear in |
| 10 | * all copies of this software. |
| 11 | * |
| 12 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR |
| 13 | * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES |
| 14 | * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN |
| 15 | * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH |
| 16 | * DAMAGE. |
| 17 | * |
| 18 | * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, |
| 19 | * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND |
| 20 | * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS |
| 21 | * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO |
| 22 | * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
| 23 | * |
Rod Sheeter | d0ce3c6 | 2018-02-06 16:58:35 -0800 | [diff] [blame] | 24 | * Google Author(s): Garret Rieger, Roderick Sheeter |
Garret Rieger | af46a4d | 2018-02-05 17:14:46 -0800 | [diff] [blame] | 25 | */ |
| 26 | |
Behdad Esfahbod | c77ae40 | 2018-08-25 22:36:36 -0700 | [diff] [blame] | 27 | #ifndef HB_SUBSET_HH |
| 28 | #define HB_SUBSET_HH |
Garret Rieger | af46a4d | 2018-02-05 17:14:46 -0800 | [diff] [blame] | 29 | |
Rod Sheeter | d0ce3c6 | 2018-02-06 16:58:35 -0800 | [diff] [blame] | 30 | |
Behdad Esfahbod | c77ae40 | 2018-08-25 22:36:36 -0700 | [diff] [blame] | 31 | #include "hb.hh" |
Garret Rieger | af46a4d | 2018-02-05 17:14:46 -0800 | [diff] [blame] | 32 | |
Behdad Esfahbod | 0bff699 | 2018-02-19 11:51:25 -0800 | [diff] [blame] | 33 | #include "hb-subset.h" |
Rod Sheeter | d0ce3c6 | 2018-02-06 16:58:35 -0800 | [diff] [blame] | 34 | |
Behdad Esfahbod | d1f2990 | 2018-08-31 16:31:00 -0700 | [diff] [blame] | 35 | #include "hb-machinery.hh" |
Behdad Esfahbod | aba0a94 | 2018-08-31 13:25:19 -0700 | [diff] [blame] | 36 | #include "hb-subset-input.hh" |
| 37 | #include "hb-subset-plan.hh" |
Rod Sheeter | d0ce3c6 | 2018-02-06 16:58:35 -0800 | [diff] [blame] | 38 | |
Behdad Esfahbod | d1f2990 | 2018-08-31 16:31:00 -0700 | [diff] [blame] | 39 | struct hb_subset_context_t : |
Behdad Esfahbod | e58b190 | 2018-08-31 16:46:35 -0700 | [diff] [blame] | 40 | hb_dispatch_context_t<hb_subset_context_t, bool, HB_DEBUG_SUBSET> |
Behdad Esfahbod | d1f2990 | 2018-08-31 16:31:00 -0700 | [diff] [blame] | 41 | { |
| 42 | inline const char *get_name (void) { return "SUBSET"; } |
| 43 | template <typename T> |
| 44 | inline bool dispatch (const T &obj) { return obj.subset (this); } |
| 45 | static bool default_return_value (void) { return true; } |
| 46 | bool stop_sublookup_iteration (bool r) const { return false; } |
| 47 | |
| 48 | hb_subset_plan_t *plan; |
Behdad Esfahbod | e58b190 | 2018-08-31 16:46:35 -0700 | [diff] [blame] | 49 | hb_serialize_context_t *serializer; |
Behdad Esfahbod | d1f2990 | 2018-08-31 16:31:00 -0700 | [diff] [blame] | 50 | unsigned int debug_depth; |
| 51 | |
| 52 | hb_subset_context_t (hb_subset_plan_t *plan_, |
Behdad Esfahbod | e58b190 | 2018-08-31 16:46:35 -0700 | [diff] [blame] | 53 | hb_serialize_context_t *serializer_) : |
Behdad Esfahbod | d1f2990 | 2018-08-31 16:31:00 -0700 | [diff] [blame] | 54 | plan (plan_), |
| 55 | serializer (serializer_), |
| 56 | debug_depth (0) {} |
| 57 | }; |
Garret Rieger | af46a4d | 2018-02-05 17:14:46 -0800 | [diff] [blame] | 58 | |
Rod Sheeter | fa87770 | 2018-02-14 14:16:25 -0800 | [diff] [blame] | 59 | |
Behdad Esfahbod | c77ae40 | 2018-08-25 22:36:36 -0700 | [diff] [blame] | 60 | #endif /* HB_SUBSET_HH */ |