2012-04-05 23:25:19 +02:00
|
|
|
/*
|
|
|
|
* Copyright © 2012 Google, Inc.
|
|
|
|
*
|
|
|
|
* This is part of HarfBuzz, a text shaping library.
|
|
|
|
*
|
|
|
|
* Permission is hereby granted, without written agreement and without
|
|
|
|
* license or royalty fees, to use, copy, modify, and distribute this
|
|
|
|
* software and its documentation for any purpose, provided that the
|
|
|
|
* above copyright notice and the following two paragraphs appear in
|
|
|
|
* all copies of this software.
|
|
|
|
*
|
|
|
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
|
|
|
|
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
|
|
|
|
* ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
|
|
|
|
* IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
|
|
|
* DAMAGE.
|
|
|
|
*
|
|
|
|
* THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
|
|
|
|
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
|
|
|
|
* ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
|
|
|
|
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
|
|
|
|
*
|
|
|
|
* Google Author(s): Behdad Esfahbod
|
|
|
|
*/
|
|
|
|
|
2018-08-26 07:36:36 +02:00
|
|
|
#ifndef HB_OT_SHAPE_NORMALIZE_HH
|
|
|
|
#define HB_OT_SHAPE_NORMALIZE_HH
|
2012-04-05 23:25:19 +02:00
|
|
|
|
2018-08-26 07:36:36 +02:00
|
|
|
#include "hb.hh"
|
2012-04-05 23:25:19 +02:00
|
|
|
|
|
|
|
|
2012-08-10 04:33:32 +02:00
|
|
|
/* buffer var allocations, used during the normalization process */
|
|
|
|
#define glyph_index() var1.u32
|
2012-04-05 23:25:19 +02:00
|
|
|
|
2012-11-16 21:39:23 +01:00
|
|
|
struct hb_ot_shape_plan_t;
|
2012-11-13 21:35:35 +01:00
|
|
|
|
2012-04-05 23:25:19 +02:00
|
|
|
enum hb_ot_shape_normalization_mode_t {
|
2014-01-02 10:04:04 +01:00
|
|
|
HB_OT_SHAPE_NORMALIZATION_MODE_NONE,
|
2012-04-05 23:25:19 +02:00
|
|
|
HB_OT_SHAPE_NORMALIZATION_MODE_DECOMPOSED,
|
2018-09-24 03:32:18 +02:00
|
|
|
HB_OT_SHAPE_NORMALIZATION_MODE_COMPOSED_DIACRITICS, /* Never composes base-to-base */
|
|
|
|
HB_OT_SHAPE_NORMALIZATION_MODE_COMPOSED_DIACRITICS_NO_SHORT_CIRCUIT, /* Always fully decomposes and then recompose back */
|
2012-07-31 03:08:51 +02:00
|
|
|
|
2018-10-08 22:41:08 +02:00
|
|
|
HB_OT_SHAPE_NORMALIZATION_MODE_AUTO, /* See hb-ot-shape-normalize.cc for logic. */
|
2018-09-24 03:32:18 +02:00
|
|
|
HB_OT_SHAPE_NORMALIZATION_MODE_DEFAULT = HB_OT_SHAPE_NORMALIZATION_MODE_AUTO
|
2012-04-05 23:25:19 +02:00
|
|
|
};
|
|
|
|
|
2012-11-16 21:39:23 +01:00
|
|
|
HB_INTERNAL void _hb_ot_shape_normalize (const hb_ot_shape_plan_t *shaper,
|
2012-04-05 23:25:19 +02:00
|
|
|
hb_buffer_t *buffer,
|
2012-11-13 21:35:35 +01:00
|
|
|
hb_font_t *font);
|
2012-04-05 23:25:19 +02:00
|
|
|
|
2012-11-16 21:39:23 +01:00
|
|
|
|
|
|
|
struct hb_ot_shape_normalize_context_t
|
|
|
|
{
|
|
|
|
const hb_ot_shape_plan_t *plan;
|
2021-09-04 03:41:19 +02:00
|
|
|
hb_buffer_t *buffer;
|
2012-11-16 21:39:23 +01:00
|
|
|
hb_font_t *font;
|
|
|
|
hb_unicode_funcs_t *unicode;
|
2021-10-26 16:02:29 +02:00
|
|
|
const hb_codepoint_t not_found;
|
2012-11-16 21:39:23 +01:00
|
|
|
bool (*decompose) (const hb_ot_shape_normalize_context_t *c,
|
|
|
|
hb_codepoint_t ab,
|
|
|
|
hb_codepoint_t *a,
|
|
|
|
hb_codepoint_t *b);
|
|
|
|
bool (*compose) (const hb_ot_shape_normalize_context_t *c,
|
|
|
|
hb_codepoint_t a,
|
|
|
|
hb_codepoint_t b,
|
|
|
|
hb_codepoint_t *ab);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2018-08-26 07:36:36 +02:00
|
|
|
#endif /* HB_OT_SHAPE_NORMALIZE_HH */
|