summaryrefslogtreecommitdiff
path: root/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout.cc
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2019-08-14 22:15:47 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2019-08-14 22:15:47 +0000
commitc34a1db4898940561d930b352086459acb246918 (patch)
treee8eed46f0b1fadd8924d05712b0c5d4f28194058 /Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout.cc
parent5630d54170b9d8a8aabf2ad7e84c92840b86160d (diff)
harfbuzz 2.6.0
git-svn-id: svn://tug.org/texlive/trunk@51882 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout.cc')
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout.cc110
1 files changed, 42 insertions, 68 deletions
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout.cc
index 10b9ba092b3..d95e5a0b15c 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout.cc
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout.cc
@@ -28,6 +28,14 @@
* Google Author(s): Behdad Esfahbod
*/
+#include "hb.hh"
+
+#ifndef HB_NO_OT_LAYOUT
+
+#ifdef HB_NO_OT_TAG
+#error "Cannot compile hb-ot-layout.cc with HB_NO_OT_TAG."
+#endif
+
#include "hb-open-type.hh"
#include "hb-ot-layout.hh"
#include "hb-ot-face.hh"
@@ -35,7 +43,6 @@
#include "hb-map.hh"
#include "hb-ot-kern-table.hh"
-#include "hb-ot-gasp-table.hh" // Just so we compile it; unused otherwise.
#include "hb-ot-layout-gdef-table.hh"
#include "hb-ot-layout-gsub-table.hh"
#include "hb-ot-layout-gpos-table.hh"
@@ -47,6 +54,7 @@
#include "hb-aat-layout-lcar-table.hh"
#include "hb-aat-layout-morx-table.hh"
+#include "hb-aat-layout-opbd-table.hh" // Just so we compile it; unused otherwise.
/**
* SECTION:hb-ot-layout
@@ -101,7 +109,7 @@ hb_ot_layout_has_machine_kerning (hb_face_t *face)
*
* Tests whether a face has any cross-stream kerning (i.e., kerns
* that make adjustments perpendicular to the direction of the text
- * flow: Y adjustments in horizontal text or X adjustments in
+ * flow: Y adjustments in horizontal text or X adjustments in
* vertical text) in the 'kern' table.
*
* Does NOT examine the GPOS table.
@@ -278,7 +286,7 @@ hb_ot_layout_has_glyph_classes (hb_face_t *face)
*
* Fetches the GDEF class of the requested glyph in the specified face.
*
- * Return value: The #hb_ot_layout_glyph_class_t glyph class of the given code
+ * Return value: The #hb_ot_layout_glyph_class_t glyph class of the given code
* point in the GDEF table of the face.
*
* Since: 0.9.7
@@ -322,7 +330,7 @@ hb_ot_layout_get_glyphs_in_class (hb_face_t *face,
* @point_array: (out) (array length=point_count): The array of attachment points found for the query
*
* Fetches a list of all attachment points for the specified glyph in the GDEF
- * table of the face. The list returned will begin at the offset provided.
+ * table of the face. The list returned will begin at the offset provided.
*
* Useful if the client program wishes to cache the list.
*
@@ -388,7 +396,7 @@ OT::GSUB::is_blacklisted (hb_blob_t *blob HB_UNUSED,
return false;
#endif
-#ifndef HB_NO_SHAPE_AAT
+#ifndef HB_NO_AAT_SHAPE
/* Mac OS X prefers morx over GSUB. It also ships with various Indic fonts,
* all by 'MUTF' foundry (Tamil MN, Tamil Sangam MN, etc.), that have broken
* GSUB/GPOS tables. Some have GSUB with zero scripts, those are ignored by
@@ -972,7 +980,7 @@ hb_ot_layout_feature_get_lookups (hb_face_t *face,
* @face: #hb_face_t to work upon
* @table_tag: HB_OT_TAG_GSUB or HB_OT_TAG_GPOS
*
- * Fetches the total number of lookups enumerated in the specified
+ * Fetches the total number of lookups enumerated in the specified
* face's GSUB table or GPOS table.
*
* Since: 0.9.22
@@ -1180,7 +1188,7 @@ hb_ot_layout_collect_features (hb_face_t *face,
* table or GPOS table, underneath the specified scripts, languages, and
* features. If no list of scripts is provided, all scripts will be queried.
* If no list of languages is provided, all languages will be queried. If no
- * list of features is provided, all features will be queried.
+ * list of features is provided, all features will be queried.
*
* Since: 0.9.8
**/
@@ -1574,7 +1582,7 @@ hb_ot_layout_position_finish_offsets (hb_font_t *font, hb_buffer_t *buffer)
* as used here are defined as pertaining only to fonts within a font family that differ
* specifically in their respective size ranges; other ways to differentiate fonts within
* a subfamily are not covered by the `size` feature.
- *
+ *
* For more information on this distinction, see the `size` documentation at
* https://docs.microsoft.com/en-us/typography/opentype/spec/features_pt#tag-39size39
*
@@ -1716,7 +1724,7 @@ hb_ot_layout_feature_get_name_ids (hb_face_t *face,
* returned. This function can be called with incrementally larger start_offset
* until the char_count output value is lower than its input value, or the size
* of the characters array can be increased.</note>
- *
+ *
* Return value: Number of total sample characters in the cvXX feature.
*
* Since: 2.0.0
@@ -1933,70 +1941,36 @@ hb_ot_layout_substitute_lookup (OT::hb_ot_apply_context_t *c,
apply_string<GSUBProxy> (c, lookup, accel);
}
-#if 0
-hb_bool_t
-hb_ot_layout_get_baseline (hb_font_t *font,
- hb_ot_layout_baseline_t baseline,
- hb_direction_t direction,
- hb_tag_t script_tag,
- hb_tag_t language_tag,
- hb_position_t *coord /* OUT. May be NULL. */)
-{
- bool result = font->face->table.BASE->get_baseline (font, baseline, direction, script_tag,
- language_tag, coord);
-
- /* TODO: Simulate https://docs.microsoft.com/en-us/typography/opentype/spec/baselinetags#ideographic-em-box */
- if (!result && coord) *coord = 0;
-
- if (coord) *coord = font->em_scale_dir (*coord, direction);
-
- return result;
-}
-
-/* To be moved to public header */
-/*
- * BASE
- */
-
-/**
- * hb_ot_layout_baseline_t:
- *
- * https://docs.microsoft.com/en-us/typography/opentype/spec/baselinetags
- *
- * Since: DONTREPLACEME
- */
-typedef enum {
- HB_OT_LAYOUT_BASELINE_HANG = HB_TAG('h','a','n','g'),
- HB_OT_LAYOUT_BASELINE_ICFB = HB_TAG('i','c','f','b'),
- HB_OT_LAYOUT_BASELINE_ICFT = HB_TAG('i','c','f','t'),
- HB_OT_LAYOUT_BASELINE_IDEO = HB_TAG('i','d','e','o'),
- HB_OT_LAYOUT_BASELINE_IDTB = HB_TAG('i','d','t','b'),
- HB_OT_LAYOUT_BASELINE_MATH = HB_TAG('m','a','t','h'),
- HB_OT_LAYOUT_BASELINE_ROMN = HB_TAG('r','o','m','n')
-} hb_ot_layout_baseline_t;
-
-
+#ifndef HB_NO_BASE
/**
* hb_ot_layout_get_baseline:
- * @font: The #hb_font_t to work upon
- * @baseline: The #hb_ot_layout_baseline_t to query
- * @direction: The #hb_direction_t text direction to use (horizontal or vertical)
- * @script_tag: #hb_tag_t of the script to use
- * @language_tag: #hb_tag_t of the language to use
- * @coord: (out): The position of the requested baseline
+ * @font: a font
+ * @baseline: a baseline tag
+ * @direction: text direction.
+ * @script_tag: script tag.
+ * @language_tag: language tag.
+ * @coord: (out): baseline value if found.
*
- * Fetches the coordinates of the specified baseline in the face, underneath
- * the specified script and language and in the specified text direction.
+ * Fetches a baseline value from the face.
*
- * Return value: true if the baseline is found for the settings queried, false otherwise
+ * Return value: if found baseline value in the the font.
*
+ * Since: 2.6.0
**/
-HB_EXTERN hb_bool_t
-hb_ot_layout_get_baseline (hb_font_t *font,
- hb_ot_layout_baseline_t baseline,
- hb_direction_t direction,
- hb_tag_t script_tag,
- hb_tag_t language_tag,
- hb_position_t *coord /* OUT. May be NULL. */);
+hb_bool_t
+hb_ot_layout_get_baseline (hb_font_t *font,
+ hb_ot_layout_baseline_tag_t baseline_tag,
+ hb_direction_t direction,
+ hb_tag_t script_tag,
+ hb_tag_t language_tag,
+ hb_position_t *coord /* OUT. May be NULL. */)
+{
+ bool result = font->face->table.BASE->get_baseline (font, baseline_tag, direction, script_tag, language_tag, coord);
+
+ if (result && coord)
+ *coord = HB_DIRECTION_IS_HORIZONTAL (direction) ? font->em_scale_y (*coord) : font->em_scale_x (*coord);
+ return result;
+}
+#endif
#endif