Path: blob/master/src/java.desktop/share/native/libharfbuzz/hb-buffer.h
41149 views
/*1* Copyright © 1998-2004 David Turner and Werner Lemberg2* Copyright © 2004,2007,2009 Red Hat, Inc.3* Copyright © 2011,2012 Google, Inc.4*5* This is part of HarfBuzz, a text shaping library.6*7* Permission is hereby granted, without written agreement and without8* license or royalty fees, to use, copy, modify, and distribute this9* software and its documentation for any purpose, provided that the10* above copyright notice and the following two paragraphs appear in11* all copies of this software.12*13* IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR14* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES15* ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN16* IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH17* DAMAGE.18*19* THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,20* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND21* FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS22* ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO23* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.24*25* Red Hat Author(s): Owen Taylor, Behdad Esfahbod26* Google Author(s): Behdad Esfahbod27*/2829#if !defined(HB_H_IN) && !defined(HB_NO_SINGLE_HEADER_ERROR)30#error "Include <hb.h> instead."31#endif3233#ifndef HB_BUFFER_H34#define HB_BUFFER_H3536#include "hb-common.h"37#include "hb-unicode.h"38#include "hb-font.h"3940HB_BEGIN_DECLS4142/**43* hb_glyph_info_t:44* @codepoint: either a Unicode code point (before shaping) or a glyph index45* (after shaping).46* @cluster: the index of the character in the original text that corresponds47* to this #hb_glyph_info_t, or whatever the client passes to48* hb_buffer_add(). More than one #hb_glyph_info_t can have the same49* @cluster value, if they resulted from the same character (e.g. one50* to many glyph substitution), and when more than one character gets51* merged in the same glyph (e.g. many to one glyph substitution) the52* #hb_glyph_info_t will have the smallest cluster value of them.53* By default some characters are merged into the same cluster54* (e.g. combining marks have the same cluster as their bases)55* even if they are separate glyphs, hb_buffer_set_cluster_level()56* allow selecting more fine-grained cluster handling.57*58* The #hb_glyph_info_t is the structure that holds information about the59* glyphs and their relation to input text.60*/61typedef struct hb_glyph_info_t {62hb_codepoint_t codepoint;63/*< private >*/64hb_mask_t mask;65/*< public >*/66uint32_t cluster;6768/*< private >*/69hb_var_int_t var1;70hb_var_int_t var2;71} hb_glyph_info_t;7273/**74* hb_glyph_flags_t:75* @HB_GLYPH_FLAG_UNSAFE_TO_BREAK: Indicates that if input text is broken at the76* beginning of the cluster this glyph is part of,77* then both sides need to be re-shaped, as the78* result might be different. On the flip side,79* it means that when this flag is not present,80* then it's safe to break the glyph-run at the81* beginning of this cluster, and the two sides82* represent the exact same result one would get83* if breaking input text at the beginning of84* this cluster and shaping the two sides85* separately. This can be used to optimize86* paragraph layout, by avoiding re-shaping87* of each line after line-breaking, or limiting88* the reshaping to a small piece around the89* breaking point only.90* @HB_GLYPH_FLAG_DEFINED: All the currently defined flags.91*92* Flags for #hb_glyph_info_t.93*94* Since: 1.5.095*/96typedef enum { /*< flags >*/97HB_GLYPH_FLAG_UNSAFE_TO_BREAK = 0x00000001,9899HB_GLYPH_FLAG_DEFINED = 0x00000001 /* OR of all defined flags */100} hb_glyph_flags_t;101102HB_EXTERN hb_glyph_flags_t103hb_glyph_info_get_glyph_flags (const hb_glyph_info_t *info);104105#define hb_glyph_info_get_glyph_flags(info) \106((hb_glyph_flags_t) ((unsigned int) (info)->mask & HB_GLYPH_FLAG_DEFINED))107108109/**110* hb_glyph_position_t:111* @x_advance: how much the line advances after drawing this glyph when setting112* text in horizontal direction.113* @y_advance: how much the line advances after drawing this glyph when setting114* text in vertical direction.115* @x_offset: how much the glyph moves on the X-axis before drawing it, this116* should not affect how much the line advances.117* @y_offset: how much the glyph moves on the Y-axis before drawing it, this118* should not affect how much the line advances.119*120* The #hb_glyph_position_t is the structure that holds the positions of the121* glyph in both horizontal and vertical directions. All positions in122* #hb_glyph_position_t are relative to the current point.123*124*/125typedef struct hb_glyph_position_t {126hb_position_t x_advance;127hb_position_t y_advance;128hb_position_t x_offset;129hb_position_t y_offset;130131/*< private >*/132hb_var_int_t var;133} hb_glyph_position_t;134135/**136* hb_segment_properties_t:137* @direction: the #hb_direction_t of the buffer, see hb_buffer_set_direction().138* @script: the #hb_script_t of the buffer, see hb_buffer_set_script().139* @language: the #hb_language_t of the buffer, see hb_buffer_set_language().140*141* The structure that holds various text properties of an #hb_buffer_t. Can be142* set and retrieved using hb_buffer_set_segment_properties() and143* hb_buffer_get_segment_properties(), respectively.144*/145typedef struct hb_segment_properties_t {146hb_direction_t direction;147hb_script_t script;148hb_language_t language;149/*< private >*/150void *reserved1;151void *reserved2;152} hb_segment_properties_t;153154/**155* HB_SEGMENT_PROPERTIES_DEFAULT:156*157* The default #hb_segment_properties_t of of freshly created #hb_buffer_t.158*/159#define HB_SEGMENT_PROPERTIES_DEFAULT {HB_DIRECTION_INVALID, \160HB_SCRIPT_INVALID, \161HB_LANGUAGE_INVALID, \162(void *) 0, \163(void *) 0}164165HB_EXTERN hb_bool_t166hb_segment_properties_equal (const hb_segment_properties_t *a,167const hb_segment_properties_t *b);168169HB_EXTERN unsigned int170hb_segment_properties_hash (const hb_segment_properties_t *p);171172173174/**175* hb_buffer_t:176*177* The main structure holding the input text and its properties before shaping,178* and output glyphs and their information after shaping.179*/180181typedef struct hb_buffer_t hb_buffer_t;182183HB_EXTERN hb_buffer_t *184hb_buffer_create (void);185186HB_EXTERN hb_buffer_t *187hb_buffer_get_empty (void);188189HB_EXTERN hb_buffer_t *190hb_buffer_reference (hb_buffer_t *buffer);191192HB_EXTERN void193hb_buffer_destroy (hb_buffer_t *buffer);194195HB_EXTERN hb_bool_t196hb_buffer_set_user_data (hb_buffer_t *buffer,197hb_user_data_key_t *key,198void * data,199hb_destroy_func_t destroy,200hb_bool_t replace);201202HB_EXTERN void *203hb_buffer_get_user_data (hb_buffer_t *buffer,204hb_user_data_key_t *key);205206207/**208* hb_buffer_content_type_t:209* @HB_BUFFER_CONTENT_TYPE_INVALID: Initial value for new buffer.210* @HB_BUFFER_CONTENT_TYPE_UNICODE: The buffer contains input characters (before shaping).211* @HB_BUFFER_CONTENT_TYPE_GLYPHS: The buffer contains output glyphs (after shaping).212*213* The type of #hb_buffer_t contents.214*/215typedef enum {216HB_BUFFER_CONTENT_TYPE_INVALID = 0,217HB_BUFFER_CONTENT_TYPE_UNICODE,218HB_BUFFER_CONTENT_TYPE_GLYPHS219} hb_buffer_content_type_t;220221HB_EXTERN void222hb_buffer_set_content_type (hb_buffer_t *buffer,223hb_buffer_content_type_t content_type);224225HB_EXTERN hb_buffer_content_type_t226hb_buffer_get_content_type (hb_buffer_t *buffer);227228229HB_EXTERN void230hb_buffer_set_unicode_funcs (hb_buffer_t *buffer,231hb_unicode_funcs_t *unicode_funcs);232233HB_EXTERN hb_unicode_funcs_t *234hb_buffer_get_unicode_funcs (hb_buffer_t *buffer);235236HB_EXTERN void237hb_buffer_set_direction (hb_buffer_t *buffer,238hb_direction_t direction);239240HB_EXTERN hb_direction_t241hb_buffer_get_direction (hb_buffer_t *buffer);242243HB_EXTERN void244hb_buffer_set_script (hb_buffer_t *buffer,245hb_script_t script);246247HB_EXTERN hb_script_t248hb_buffer_get_script (hb_buffer_t *buffer);249250HB_EXTERN void251hb_buffer_set_language (hb_buffer_t *buffer,252hb_language_t language);253254255HB_EXTERN hb_language_t256hb_buffer_get_language (hb_buffer_t *buffer);257258HB_EXTERN void259hb_buffer_set_segment_properties (hb_buffer_t *buffer,260const hb_segment_properties_t *props);261262HB_EXTERN void263hb_buffer_get_segment_properties (hb_buffer_t *buffer,264hb_segment_properties_t *props);265266HB_EXTERN void267hb_buffer_guess_segment_properties (hb_buffer_t *buffer);268269270/**271* hb_buffer_flags_t:272* @HB_BUFFER_FLAG_DEFAULT: the default buffer flag.273* @HB_BUFFER_FLAG_BOT: flag indicating that special handling of the beginning274* of text paragraph can be applied to this buffer. Should usually275* be set, unless you are passing to the buffer only part276* of the text without the full context.277* @HB_BUFFER_FLAG_EOT: flag indicating that special handling of the end of text278* paragraph can be applied to this buffer, similar to279* @HB_BUFFER_FLAG_BOT.280* @HB_BUFFER_FLAG_PRESERVE_DEFAULT_IGNORABLES:281* flag indication that character with Default_Ignorable282* Unicode property should use the corresponding glyph283* from the font, instead of hiding them (done by284* replacing them with the space glyph and zeroing the285* advance width.) This flag takes precedence over286* @HB_BUFFER_FLAG_REMOVE_DEFAULT_IGNORABLES.287* @HB_BUFFER_FLAG_REMOVE_DEFAULT_IGNORABLES:288* flag indication that character with Default_Ignorable289* Unicode property should be removed from glyph string290* instead of hiding them (done by replacing them with the291* space glyph and zeroing the advance width.)292* @HB_BUFFER_FLAG_PRESERVE_DEFAULT_IGNORABLES takes293* precedence over this flag. Since: 1.8.0294* @HB_BUFFER_FLAG_DO_NOT_INSERT_DOTTED_CIRCLE:295* flag indicating that a dotted circle should296* not be inserted in the rendering of incorrect297* character sequences (such at <0905 093E>). Since: 2.4298*299* Flags for #hb_buffer_t.300*301* Since: 0.9.20302*/303typedef enum { /*< flags >*/304HB_BUFFER_FLAG_DEFAULT = 0x00000000u,305HB_BUFFER_FLAG_BOT = 0x00000001u, /* Beginning-of-text */306HB_BUFFER_FLAG_EOT = 0x00000002u, /* End-of-text */307HB_BUFFER_FLAG_PRESERVE_DEFAULT_IGNORABLES = 0x00000004u,308HB_BUFFER_FLAG_REMOVE_DEFAULT_IGNORABLES = 0x00000008u,309HB_BUFFER_FLAG_DO_NOT_INSERT_DOTTED_CIRCLE = 0x00000010u310} hb_buffer_flags_t;311312HB_EXTERN void313hb_buffer_set_flags (hb_buffer_t *buffer,314hb_buffer_flags_t flags);315316HB_EXTERN hb_buffer_flags_t317hb_buffer_get_flags (hb_buffer_t *buffer);318319/**320* hb_buffer_cluster_level_t:321* @HB_BUFFER_CLUSTER_LEVEL_MONOTONE_GRAPHEMES: Return cluster values grouped by graphemes into322* monotone order.323* @HB_BUFFER_CLUSTER_LEVEL_MONOTONE_CHARACTERS: Return cluster values grouped into monotone order.324* @HB_BUFFER_CLUSTER_LEVEL_CHARACTERS: Don't group cluster values.325* @HB_BUFFER_CLUSTER_LEVEL_DEFAULT: Default cluster level,326* equal to @HB_BUFFER_CLUSTER_LEVEL_MONOTONE_GRAPHEMES.327*328* Data type for holding HarfBuzz's clustering behavior options. The cluster level329* dictates one aspect of how HarfBuzz will treat non-base characters330* during shaping.331*332* In @HB_BUFFER_CLUSTER_LEVEL_MONOTONE_GRAPHEMES, non-base333* characters are merged into the cluster of the base character that precedes them.334*335* In @HB_BUFFER_CLUSTER_LEVEL_MONOTONE_CHARACTERS, non-base characters are initially336* assigned their own cluster values, which are not merged into preceding base337* clusters. This allows HarfBuzz to perform additional operations like reorder338* sequences of adjacent marks.339*340* @HB_BUFFER_CLUSTER_LEVEL_MONOTONE_GRAPHEMES is the default, because it maintains341* backward compatibility with older versions of HarfBuzz. New client programs that342* do not need to maintain such backward compatibility are recommended to use343* @HB_BUFFER_CLUSTER_LEVEL_MONOTONE_CHARACTERS instead of the default.344*345* Since: 0.9.42346*/347typedef enum {348HB_BUFFER_CLUSTER_LEVEL_MONOTONE_GRAPHEMES = 0,349HB_BUFFER_CLUSTER_LEVEL_MONOTONE_CHARACTERS = 1,350HB_BUFFER_CLUSTER_LEVEL_CHARACTERS = 2,351HB_BUFFER_CLUSTER_LEVEL_DEFAULT = HB_BUFFER_CLUSTER_LEVEL_MONOTONE_GRAPHEMES352} hb_buffer_cluster_level_t;353354HB_EXTERN void355hb_buffer_set_cluster_level (hb_buffer_t *buffer,356hb_buffer_cluster_level_t cluster_level);357358HB_EXTERN hb_buffer_cluster_level_t359hb_buffer_get_cluster_level (hb_buffer_t *buffer);360361/**362* HB_BUFFER_REPLACEMENT_CODEPOINT_DEFAULT:363*364* The default code point for replacing invalid characters in a given encoding.365* Set to U+FFFD REPLACEMENT CHARACTER.366*367* Since: 0.9.31368*/369#define HB_BUFFER_REPLACEMENT_CODEPOINT_DEFAULT 0xFFFDu370371HB_EXTERN void372hb_buffer_set_replacement_codepoint (hb_buffer_t *buffer,373hb_codepoint_t replacement);374375HB_EXTERN hb_codepoint_t376hb_buffer_get_replacement_codepoint (hb_buffer_t *buffer);377378HB_EXTERN void379hb_buffer_set_invisible_glyph (hb_buffer_t *buffer,380hb_codepoint_t invisible);381382HB_EXTERN hb_codepoint_t383hb_buffer_get_invisible_glyph (hb_buffer_t *buffer);384385386HB_EXTERN void387hb_buffer_reset (hb_buffer_t *buffer);388389HB_EXTERN void390hb_buffer_clear_contents (hb_buffer_t *buffer);391392HB_EXTERN hb_bool_t393hb_buffer_pre_allocate (hb_buffer_t *buffer,394unsigned int size);395396397HB_EXTERN hb_bool_t398hb_buffer_allocation_successful (hb_buffer_t *buffer);399400HB_EXTERN void401hb_buffer_reverse (hb_buffer_t *buffer);402403HB_EXTERN void404hb_buffer_reverse_range (hb_buffer_t *buffer,405unsigned int start, unsigned int end);406407HB_EXTERN void408hb_buffer_reverse_clusters (hb_buffer_t *buffer);409410411/* Filling the buffer in */412413HB_EXTERN void414hb_buffer_add (hb_buffer_t *buffer,415hb_codepoint_t codepoint,416unsigned int cluster);417418HB_EXTERN void419hb_buffer_add_utf8 (hb_buffer_t *buffer,420const char *text,421int text_length,422unsigned int item_offset,423int item_length);424425HB_EXTERN void426hb_buffer_add_utf16 (hb_buffer_t *buffer,427const uint16_t *text,428int text_length,429unsigned int item_offset,430int item_length);431432HB_EXTERN void433hb_buffer_add_utf32 (hb_buffer_t *buffer,434const uint32_t *text,435int text_length,436unsigned int item_offset,437int item_length);438439HB_EXTERN void440hb_buffer_add_latin1 (hb_buffer_t *buffer,441const uint8_t *text,442int text_length,443unsigned int item_offset,444int item_length);445446HB_EXTERN void447hb_buffer_add_codepoints (hb_buffer_t *buffer,448const hb_codepoint_t *text,449int text_length,450unsigned int item_offset,451int item_length);452453HB_EXTERN void454hb_buffer_append (hb_buffer_t *buffer,455hb_buffer_t *source,456unsigned int start,457unsigned int end);458459HB_EXTERN hb_bool_t460hb_buffer_set_length (hb_buffer_t *buffer,461unsigned int length);462463HB_EXTERN unsigned int464hb_buffer_get_length (hb_buffer_t *buffer);465466/* Getting glyphs out of the buffer */467468HB_EXTERN hb_glyph_info_t *469hb_buffer_get_glyph_infos (hb_buffer_t *buffer,470unsigned int *length);471472HB_EXTERN hb_glyph_position_t *473hb_buffer_get_glyph_positions (hb_buffer_t *buffer,474unsigned int *length);475476HB_EXTERN hb_bool_t477hb_buffer_has_positions (hb_buffer_t *buffer);478479480HB_EXTERN void481hb_buffer_normalize_glyphs (hb_buffer_t *buffer);482483484/*485* Serialize486*/487488/**489* hb_buffer_serialize_flags_t:490* @HB_BUFFER_SERIALIZE_FLAG_DEFAULT: serialize glyph names, clusters and positions.491* @HB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERS: do not serialize glyph cluster.492* @HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS: do not serialize glyph position information.493* @HB_BUFFER_SERIALIZE_FLAG_NO_GLYPH_NAMES: do no serialize glyph name.494* @HB_BUFFER_SERIALIZE_FLAG_GLYPH_EXTENTS: serialize glyph extents.495* @HB_BUFFER_SERIALIZE_FLAG_GLYPH_FLAGS: serialize glyph flags. Since: 1.5.0496* @HB_BUFFER_SERIALIZE_FLAG_NO_ADVANCES: do not serialize glyph advances,497* glyph offsets will reflect absolute glyph positions. Since: 1.8.0498*499* Flags that control what glyph information are serialized in hb_buffer_serialize_glyphs().500*501* Since: 0.9.20502*/503typedef enum { /*< flags >*/504HB_BUFFER_SERIALIZE_FLAG_DEFAULT = 0x00000000u,505HB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERS = 0x00000001u,506HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS = 0x00000002u,507HB_BUFFER_SERIALIZE_FLAG_NO_GLYPH_NAMES = 0x00000004u,508HB_BUFFER_SERIALIZE_FLAG_GLYPH_EXTENTS = 0x00000008u,509HB_BUFFER_SERIALIZE_FLAG_GLYPH_FLAGS = 0x00000010u,510HB_BUFFER_SERIALIZE_FLAG_NO_ADVANCES = 0x00000020u511} hb_buffer_serialize_flags_t;512513/**514* hb_buffer_serialize_format_t:515* @HB_BUFFER_SERIALIZE_FORMAT_TEXT: a human-readable, plain text format.516* @HB_BUFFER_SERIALIZE_FORMAT_JSON: a machine-readable JSON format.517* @HB_BUFFER_SERIALIZE_FORMAT_INVALID: invalid format.518*519* The buffer serialization and de-serialization format used in520* hb_buffer_serialize_glyphs() and hb_buffer_deserialize_glyphs().521*522* Since: 0.9.2523*/524typedef enum {525HB_BUFFER_SERIALIZE_FORMAT_TEXT = HB_TAG('T','E','X','T'),526HB_BUFFER_SERIALIZE_FORMAT_JSON = HB_TAG('J','S','O','N'),527HB_BUFFER_SERIALIZE_FORMAT_INVALID = HB_TAG_NONE528} hb_buffer_serialize_format_t;529530HB_EXTERN hb_buffer_serialize_format_t531hb_buffer_serialize_format_from_string (const char *str, int len);532533HB_EXTERN const char *534hb_buffer_serialize_format_to_string (hb_buffer_serialize_format_t format);535536HB_EXTERN const char **537hb_buffer_serialize_list_formats (void);538539HB_EXTERN unsigned int540hb_buffer_serialize_glyphs (hb_buffer_t *buffer,541unsigned int start,542unsigned int end,543char *buf,544unsigned int buf_size,545unsigned int *buf_consumed,546hb_font_t *font,547hb_buffer_serialize_format_t format,548hb_buffer_serialize_flags_t flags);549550HB_EXTERN unsigned int551hb_buffer_serialize_unicode (hb_buffer_t *buffer,552unsigned int start,553unsigned int end,554char *buf,555unsigned int buf_size,556unsigned int *buf_consumed,557hb_buffer_serialize_format_t format,558hb_buffer_serialize_flags_t flags);559560HB_EXTERN unsigned int561hb_buffer_serialize (hb_buffer_t *buffer,562unsigned int start,563unsigned int end,564char *buf,565unsigned int buf_size,566unsigned int *buf_consumed,567hb_font_t *font,568hb_buffer_serialize_format_t format,569hb_buffer_serialize_flags_t flags);570571HB_EXTERN hb_bool_t572hb_buffer_deserialize_glyphs (hb_buffer_t *buffer,573const char *buf,574int buf_len,575const char **end_ptr,576hb_font_t *font,577hb_buffer_serialize_format_t format);578579HB_EXTERN hb_bool_t580hb_buffer_deserialize_unicode (hb_buffer_t *buffer,581const char *buf,582int buf_len,583const char **end_ptr,584hb_buffer_serialize_format_t format);585586587588/*589* Compare buffers590*/591592/**593* hb_buffer_diff_flags_t:594* @HB_BUFFER_DIFF_FLAG_EQUAL: equal buffers.595* @HB_BUFFER_DIFF_FLAG_CONTENT_TYPE_MISMATCH: buffers with different596* #hb_buffer_content_type_t.597* @HB_BUFFER_DIFF_FLAG_LENGTH_MISMATCH: buffers with differing length.598* @HB_BUFFER_DIFF_FLAG_NOTDEF_PRESENT: `.notdef` glyph is present in the599* reference buffer.600* @HB_BUFFER_DIFF_FLAG_DOTTED_CIRCLE_PRESENT: dotted circle glyph is present601* in the reference buffer.602* @HB_BUFFER_DIFF_FLAG_CODEPOINT_MISMATCH: difference in #hb_glyph_info_t.codepoint603* @HB_BUFFER_DIFF_FLAG_CLUSTER_MISMATCH: difference in #hb_glyph_info_t.cluster604* @HB_BUFFER_DIFF_FLAG_GLYPH_FLAGS_MISMATCH: difference in #hb_glyph_flags_t.605* @HB_BUFFER_DIFF_FLAG_POSITION_MISMATCH: difference in #hb_glyph_position_t.606*607* Flags from comparing two #hb_buffer_t's.608*609* Buffer with different #hb_buffer_content_type_t cannot be meaningfully610* compared in any further detail.611*612* For buffers with differing length, the per-glyph comparison is not613* attempted, though we do still scan reference buffer for dotted circle and614* `.notdef` glyphs.615*616* If the buffers have the same length, we compare them glyph-by-glyph and617* report which aspect(s) of the glyph info/position are different.618*619* Since: 1.5.0620*/621typedef enum { /*< flags >*/622HB_BUFFER_DIFF_FLAG_EQUAL = 0x0000,623624/* Buffers with different content_type cannot be meaningfully compared625* in any further detail. */626HB_BUFFER_DIFF_FLAG_CONTENT_TYPE_MISMATCH = 0x0001,627628/* For buffers with differing length, the per-glyph comparison is not629* attempted, though we do still scan reference for dottedcircle / .notdef630* glyphs. */631HB_BUFFER_DIFF_FLAG_LENGTH_MISMATCH = 0x0002,632633/* We want to know if dottedcircle / .notdef glyphs are present in the634* reference, as we may not care so much about other differences in this635* case. */636HB_BUFFER_DIFF_FLAG_NOTDEF_PRESENT = 0x0004,637HB_BUFFER_DIFF_FLAG_DOTTED_CIRCLE_PRESENT = 0x0008,638639/* If the buffers have the same length, we compare them glyph-by-glyph640* and report which aspect(s) of the glyph info/position are different. */641HB_BUFFER_DIFF_FLAG_CODEPOINT_MISMATCH = 0x0010,642HB_BUFFER_DIFF_FLAG_CLUSTER_MISMATCH = 0x0020,643HB_BUFFER_DIFF_FLAG_GLYPH_FLAGS_MISMATCH = 0x0040,644HB_BUFFER_DIFF_FLAG_POSITION_MISMATCH = 0x0080645646} hb_buffer_diff_flags_t;647648/* Compare the contents of two buffers, report types of differences. */649HB_EXTERN hb_buffer_diff_flags_t650hb_buffer_diff (hb_buffer_t *buffer,651hb_buffer_t *reference,652hb_codepoint_t dottedcircle_glyph,653unsigned int position_fuzz);654655656/*657* Debugging.658*/659660/**661* hb_buffer_message_func_t:662* @buffer: An #hb_buffer_t to work upon663* @font: The #hb_font_t the @buffer is shaped with664* @message: %NULL-terminated message passed to the function665* @user_data: User data pointer passed by the caller666*667* A callback method for #hb_buffer_t. The method gets called with the668* #hb_buffer_t it was set on, the #hb_font_t the buffer is shaped with and a669* message describing what step of the shaping process will be performed.670* Returning %false from this method will skip this shaping step and move to671* the next one.672*673* Return value: %true to perform the shaping step, %false to skip it.674*675* Since: 1.1.3676*/677typedef hb_bool_t (*hb_buffer_message_func_t) (hb_buffer_t *buffer,678hb_font_t *font,679const char *message,680void *user_data);681682HB_EXTERN void683hb_buffer_set_message_func (hb_buffer_t *buffer,684hb_buffer_message_func_t func,685void *user_data, hb_destroy_func_t destroy);686687688HB_END_DECLS689690#endif /* HB_BUFFER_H */691692693