| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright © 2017 Google, Inc. | 2 * Copyright © 2017 Google, Inc. |
| 3 * | 3 * |
| 4 * This is part of HarfBuzz, a text shaping library. | 4 * This is part of HarfBuzz, a text shaping library. |
| 5 * | 5 * |
| 6 * Permission is hereby granted, without written agreement and without | 6 * Permission is hereby granted, without written agreement and without |
| 7 * license or royalty fees, to use, copy, modify, and distribute this | 7 * license or royalty fees, to use, copy, modify, and distribute this |
| 8 * software and its documentation for any purpose, provided that the | 8 * software and its documentation for any purpose, provided that the |
| 9 * above copyright notice and the following two paragraphs appear in | 9 * above copyright notice and the following two paragraphs appear in |
| 10 * all copies of this software. | 10 * all copies of this software. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. | 22 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
| 23 * | 23 * |
| 24 * Google Author(s): Behdad Esfahbod | 24 * Google Author(s): Behdad Esfahbod |
| 25 */ | 25 */ |
| 26 | 26 |
| 27 #include "hb-open-type-private.hh" | 27 #include "hb-open-type-private.hh" |
| 28 | 28 |
| 29 #include "hb-ot-layout-private.hh" | 29 #include "hb-ot-layout-private.hh" |
| 30 #include "hb-ot-var-avar-table.hh" | 30 #include "hb-ot-var-avar-table.hh" |
| 31 #include "hb-ot-var-fvar-table.hh" | 31 #include "hb-ot-var-fvar-table.hh" |
| 32 #include "hb-ot-var-mvar-table.hh" |
| 32 #include "hb-ot-var.h" | 33 #include "hb-ot-var.h" |
| 33 | 34 |
| 34 HB_SHAPER_DATA_ENSURE_DECLARE(ot, face) | |
| 35 | |
| 36 /* | 35 /* |
| 37 * fvar/avar | 36 * fvar/avar |
| 38 */ | 37 */ |
| 39 | 38 |
| 40 static inline const OT::fvar& | 39 static inline const OT::fvar& |
| 41 _get_fvar (hb_face_t *face) | 40 _get_fvar (hb_face_t *face) |
| 42 { | 41 { |
| 43 if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return OT::Null(OT::fvar
); | 42 if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return OT::Null(OT::fvar
); |
| 44 hb_ot_layout_t * layout = hb_ot_layout_from_face (face); | 43 hb_ot_layout_t * layout = hb_ot_layout_from_face (face); |
| 45 return *(layout->fvar.get ()); | 44 return *(layout->fvar.get ()); |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 const float *design_coords, /* IN */ | 150 const float *design_coords, /* IN */ |
| 152 int *normalized_coords /* OUT */) | 151 int *normalized_coords /* OUT */) |
| 153 { | 152 { |
| 154 const OT::fvar &fvar = _get_fvar (face); | 153 const OT::fvar &fvar = _get_fvar (face); |
| 155 for (unsigned int i = 0; i < coords_length; i++) | 154 for (unsigned int i = 0; i < coords_length; i++) |
| 156 normalized_coords[i] = fvar.normalize_axis_value (i, design_coords[i]); | 155 normalized_coords[i] = fvar.normalize_axis_value (i, design_coords[i]); |
| 157 | 156 |
| 158 const OT::avar &avar = _get_avar (face); | 157 const OT::avar &avar = _get_avar (face); |
| 159 avar.map_coords (normalized_coords, coords_length); | 158 avar.map_coords (normalized_coords, coords_length); |
| 160 } | 159 } |
| OLD | NEW |