src/java.desktop/share/native/libfontmanager/harfbuzz/hb-aat-layout.hh
author jiefu
Fri, 15 Nov 2019 20:39:26 +0800
changeset 59110 8c4c358272a9
parent 54232 7c11a7cc7c1d
permissions -rw-r--r--
8234232: [TESTBUG] gc/shenandoah/jvmti/TestHeapDump.java fails with -Xcomp Reviewed-by: zgu
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
54232
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
     1
/*
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
     2
 * Copyright © 2017  Google, Inc.
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
     3
 *
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
     4
 *  This is part of HarfBuzz, a text shaping library.
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
     5
 *
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
     6
 * Permission is hereby granted, without written agreement and without
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
     7
 * license or royalty fees, to use, copy, modify, and distribute this
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
     8
 * software and its documentation for any purpose, provided that the
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
     9
 * above copyright notice and the following two paragraphs appear in
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    10
 * all copies of this software.
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    11
 *
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    12
 * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    13
 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    14
 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    15
 * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    16
 * DAMAGE.
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    17
 *
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    18
 * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    19
 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    20
 * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    21
 * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    22
 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    23
 *
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    24
 * Google Author(s): Behdad Esfahbod
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    25
 */
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    26
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    27
#ifndef HB_AAT_LAYOUT_HH
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    28
#define HB_AAT_LAYOUT_HH
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    29
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    30
#include "hb.hh"
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    31
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    32
#include "hb-ot-shape.hh"
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    33
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    34
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    35
struct hb_aat_feature_mapping_t
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    36
{
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    37
  hb_tag_t otFeatureTag;
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    38
  hb_aat_layout_feature_type_t aatFeatureType;
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    39
  hb_aat_layout_feature_selector_t selectorToEnable;
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    40
  hb_aat_layout_feature_selector_t selectorToDisable;
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    41
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    42
  static int cmp (const void *key_, const void *entry_)
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    43
  {
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    44
    hb_tag_t key = * (unsigned int *) key_;
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    45
    const hb_aat_feature_mapping_t * entry = (const hb_aat_feature_mapping_t *) entry_;
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    46
    return key < entry->otFeatureTag ? -1 :
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    47
           key > entry->otFeatureTag ? 1 :
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    48
           0;
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    49
  }
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    50
};
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    51
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    52
HB_INTERNAL const hb_aat_feature_mapping_t *
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    53
hb_aat_layout_find_feature_mapping (hb_tag_t tag);
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    54
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    55
HB_INTERNAL void
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    56
hb_aat_layout_compile_map (const hb_aat_map_builder_t *mapper,
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    57
                           hb_aat_map_t *map);
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    58
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    59
HB_INTERNAL void
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    60
hb_aat_layout_substitute (const hb_ot_shape_plan_t *plan,
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    61
                          hb_font_t *font,
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    62
                          hb_buffer_t *buffer);
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    63
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    64
HB_INTERNAL void
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    65
hb_aat_layout_zero_width_deleted_glyphs (hb_buffer_t *buffer);
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    66
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    67
HB_INTERNAL void
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    68
hb_aat_layout_remove_deleted_glyphs (hb_buffer_t *buffer);
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    69
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    70
HB_INTERNAL void
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    71
hb_aat_layout_position (const hb_ot_shape_plan_t *plan,
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    72
                        hb_font_t *font,
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    73
                        hb_buffer_t *buffer);
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    74
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    75
HB_INTERNAL void
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    76
hb_aat_layout_track (const hb_ot_shape_plan_t *plan,
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    77
                     hb_font_t *font,
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    78
                     hb_buffer_t *buffer);
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    79
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    80
HB_INTERNAL hb_language_t
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    81
_hb_aat_language_get (hb_face_t *face,
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    82
                      unsigned int i);
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    83
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    84
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    85
#endif /* HB_AAT_LAYOUT_HH */