summaryrefslogtreecommitdiff
path: root/Build/source/libs/harfbuzz/harfbuzz-src/src
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2017-02-25 22:30:01 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2017-02-25 22:30:01 +0000
commit2afa8cf572f1ad67bf6b9646afa31bfef51138e1 (patch)
tree9e17b10dff12b7ffef5430beeea04777fcc1c5b1 /Build/source/libs/harfbuzz/harfbuzz-src/src
parentff7842d1f621779933e2ba4616e2e3ddfc6323c6 (diff)
harfbuzz 1.4.3
git-svn-id: svn://tug.org/texlive/trunk@43339 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/harfbuzz/harfbuzz-src/src')
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.am2
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.sources1
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-coretext.cc7
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-directwrite.cc4
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-face-private.hh9
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-face.cc19
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-fallback-shape.cc6
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font-private.hh12
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.cc62
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.h4
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-graphite2.cc49
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-graphite2.h4
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gsubgpos-private.hh6
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-private.hh1
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout.cc11
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-math.cc3
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-arabic.cc2
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-indic-table.cc7
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-private.hh3
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-normalize.cc2
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape.cc4
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-var-hvar-table.hh6
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-var-mvar-table.hh110
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-var.cc3
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-shape-plan.cc7
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-shaper-private.hh16
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-uniscribe.cc4
27 files changed, 297 insertions, 67 deletions
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.am b/Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.am
index d7420a090d4..e322d568647 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.am
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.am
@@ -218,7 +218,7 @@ harfbuzz.def: $(HBHEADERS) $(HBNODISTHEADERS)
(cat $^ || echo 'hb_ERROR ()' ) | \
$(EGREP) '^hb_.* \(' | \
sed -e 's/ (.*//' | \
- LANG=C sort; \
+ LC_ALL=C sort; \
echo LIBRARY libharfbuzz-0.dll; \
) >"$@"
@ ! grep -q hb_ERROR "$@" \
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.sources b/Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.sources
index 8d7f1a05d2b..6363cf9300a 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.sources
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.sources
@@ -112,6 +112,7 @@ HB_OT_sources = \
hb-ot-var-avar-table.hh \
hb-ot-var-fvar-table.hh \
hb-ot-var-hvar-table.hh \
+ hb-ot-var-mvar-table.hh \
$(NULL)
HB_OT_headers = \
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-coretext.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-coretext.cc
index e857dfae03f..8f2483b0806 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-coretext.cc
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-coretext.cc
@@ -69,8 +69,8 @@ hb_coretext_face_create (CGFontRef cg_font)
}
-HB_SHAPER_DATA_ENSURE_DECLARE(coretext, face)
-HB_SHAPER_DATA_ENSURE_DECLARE(coretext, font)
+HB_SHAPER_DATA_ENSURE_DEFINE(coretext, face)
+HB_SHAPER_DATA_ENSURE_DEFINE(coretext, font)
/*
@@ -1222,6 +1222,9 @@ fail:
* AAT shaper
*/
+HB_SHAPER_DATA_ENSURE_DEFINE(coretext_aat, face)
+HB_SHAPER_DATA_ENSURE_DEFINE(coretext_aat, font)
+
/*
* shaper face data
*/
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-directwrite.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-directwrite.cc
index d63bc047379..ab07d8a3098 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-directwrite.cc
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-directwrite.cc
@@ -34,8 +34,8 @@
#define HB_DEBUG_DIRECTWRITE (HB_DEBUG+0)
#endif
-HB_SHAPER_DATA_ENSURE_DECLARE(directwrite, face)
-HB_SHAPER_DATA_ENSURE_DECLARE(directwrite, font)
+HB_SHAPER_DATA_ENSURE_DEFINE(directwrite, face)
+HB_SHAPER_DATA_ENSURE_DEFINE(directwrite, font)
/*
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-face-private.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-face-private.hh
index 43e7b1cb3ff..eb0e850aa87 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-face-private.hh
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-face-private.hh
@@ -54,6 +54,13 @@ struct hb_face_t {
mutable unsigned int upem; /* Units-per-EM. */
mutable unsigned int num_glyphs; /* Number of glyphs. */
+ enum dirty_t {
+ NOTHING = 0x0000,
+ INDEX = 0x0001,
+ UPEM = 0x0002,
+ NUM_GLYPHS = 0x0004,
+ } dirty;
+
struct hb_shaper_data_t shaper_data; /* Various shaper data. */
/* Various non-shaping data. */
@@ -99,6 +106,8 @@ struct hb_face_t {
HB_INTERNAL void load_num_glyphs (void) const;
};
+HB_MARK_AS_FLAG_T (hb_face_t::dirty_t);
+
extern HB_INTERNAL const hb_face_t _hb_face_nil;
#define HB_SHAPER_DATA_CREATE_FUNC_EXTRA_ARGS
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-face.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-face.cc
index 1ba97070727..1800c995a46 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-face.cc
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-face.cc
@@ -51,6 +51,8 @@ const hb_face_t _hb_face_nil = {
1000, /* upem */
0, /* num_glyphs */
+ hb_face_t::NOTHING, /* dirty */
+
{
#define HB_SHAPER_IMPLEMENT(shaper) HB_SHAPER_DATA_INVALID,
#include "hb-shaper-list.hh"
@@ -171,7 +173,7 @@ hb_face_create (hb_blob_t *blob,
closure,
(hb_destroy_func_t) _hb_face_for_data_closure_destroy);
- hb_face_set_index (face, index);
+ face->index = index;
return face;
}
@@ -365,6 +367,11 @@ hb_face_set_index (hb_face_t *face,
if (face->immutable)
return;
+ if (face->index == index)
+ return;
+
+ face->dirty |= face->INDEX;
+
face->index = index;
}
@@ -400,6 +407,11 @@ hb_face_set_upem (hb_face_t *face,
if (face->immutable)
return;
+ if (face->upem == upem)
+ return;
+
+ face->dirty |= face->UPEM;
+
face->upem = upem;
}
@@ -444,6 +456,11 @@ hb_face_set_glyph_count (hb_face_t *face,
if (face->immutable)
return;
+ if (face->num_glyphs == glyph_count)
+ return;
+
+ face->dirty |= face->NUM_GLYPHS;
+
face->num_glyphs = glyph_count;
}
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-fallback-shape.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-fallback-shape.cc
index ac6d4b00f55..4b60c6c3491 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-fallback-shape.cc
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-fallback-shape.cc
@@ -28,6 +28,10 @@
#include "hb-shaper-impl-private.hh"
+HB_SHAPER_DATA_ENSURE_DEFINE(fallback, face)
+HB_SHAPER_DATA_ENSURE_DEFINE(fallback, font)
+
+
/*
* shaper face data
*/
@@ -125,7 +129,7 @@ _hb_fallback_shape (hb_shape_plan_t *shape_plan HB_UNUSED,
pos[i].y_advance = 0;
continue;
}
- font->get_nominal_glyph (info[i].codepoint, &info[i].codepoint);
+ (void) font->get_nominal_glyph (info[i].codepoint, &info[i].codepoint);
font->get_glyph_advance_for_direction (info[i].codepoint,
direction,
&pos[i].x_advance,
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font-private.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font-private.hh
index 53671d78d23..fbb16a0b72f 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font-private.hh
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font-private.hh
@@ -116,6 +116,16 @@ struct hb_font_t {
void *user_data;
hb_destroy_func_t destroy;
+ enum dirty_t {
+ NOTHING = 0x0000,
+ FACE = 0x0001,
+ PARENT = 0x0002,
+ FUNCS = 0x0004,
+ SCALE = 0x0008,
+ PPEM = 0x0010,
+ VARIATIONS = 0x0020,
+ } dirty;
+
struct hb_shaper_data_t shaper_data;
@@ -543,6 +553,8 @@ struct hb_font_t {
}
};
+HB_MARK_AS_FLAG_T (hb_font_t::dirty_t);
+
#define HB_SHAPER_DATA_CREATE_FUNC_EXTRA_ARGS
#define HB_SHAPER_IMPLEMENT(shaper) HB_SHAPER_DATA_PROTOTYPE(shaper, font);
#include "hb-shaper-list.hh"
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.cc
index ea455012684..e900bd3f65a 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.cc
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.cc
@@ -1196,6 +1196,8 @@ hb_font_get_empty (void)
NULL, /* user_data */
NULL, /* destroy */
+ hb_font_t::NOTHING, /* dirty */
+
{
#define HB_SHAPER_IMPLEMENT(shaper) HB_SHAPER_DATA_INVALID,
#include "hb-shaper-list.hh"
@@ -1348,6 +1350,11 @@ hb_font_set_parent (hb_font_t *font,
if (!parent)
parent = hb_font_get_empty ();
+ if (parent == font->parent)
+ return;
+
+ font->dirty |= font->PARENT;
+
hb_font_t *old = font->parent;
font->parent = hb_font_reference (parent);
@@ -1372,6 +1379,37 @@ hb_font_get_parent (hb_font_t *font)
}
/**
+ * hb_font_set_face:
+ * @font: a font.
+ * @face: new face.
+ *
+ * Sets font-face of @font.
+ *
+ * Since: 1.4.3
+ **/
+void
+hb_font_set_face (hb_font_t *font,
+ hb_face_t *face)
+{
+ if (font->immutable)
+ return;
+
+ if (unlikely (!face))
+ face = hb_face_get_empty ();
+
+ if (font->face == face)
+ return;
+
+ font->dirty |= font->FACE;
+
+ hb_face_t *old = font->face;
+
+ font->face = hb_face_reference (face);
+
+ hb_face_destroy (old);
+}
+
+/**
* hb_font_get_face:
* @font: a font.
*
@@ -1417,6 +1455,8 @@ hb_font_set_funcs (hb_font_t *font,
if (!klass)
klass = hb_font_funcs_get_empty ();
+ font->dirty |= font->FUNCS;
+
hb_font_funcs_reference (klass);
hb_font_funcs_destroy (font->klass);
font->klass = klass;
@@ -1472,6 +1512,11 @@ hb_font_set_scale (hb_font_t *font,
if (font->immutable)
return;
+ if (font->x_scale == x_scale && font->y_scale == y_scale)
+ return;
+
+ font->dirty |= font->SCALE;
+
font->x_scale = x_scale;
font->y_scale = y_scale;
}
@@ -1513,6 +1558,11 @@ hb_font_set_ppem (hb_font_t *font,
if (font->immutable)
return;
+ if (font->x_ppem == x_ppem && font->y_ppem == y_ppem)
+ return;
+
+ font->dirty |= font->PPEM;
+
font->x_ppem = x_ppem;
font->y_ppem = y_ppem;
}
@@ -1545,6 +1595,16 @@ _hb_font_adopt_var_coords_normalized (hb_font_t *font,
int *coords, /* 2.14 normalized */
unsigned int coords_length)
{
+ if (font->num_coords == coords_length &&
+ (coords_length == 0 ||
+ 0 == memcmp (font->coords, coords, coords_length * sizeof (coords[0]))))
+ {
+ free (coords);
+ return;
+ }
+
+ font->dirty |= font->VARIATIONS;
+
free (font->coords);
font->coords = coords;
@@ -1627,7 +1687,7 @@ hb_font_set_var_coords_normalized (hb_font_t *font,
}
/**
- * hb_font_set_var_coords_normalized:
+ * hb_font_get_var_coords_normalized:
*
* Return value is valid as long as variation coordinates of the font
* are not modified.
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.h b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.h
index e2e59796f9f..85fb56d5b6d 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.h
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.h
@@ -563,6 +563,10 @@ hb_font_set_parent (hb_font_t *font,
HB_EXTERN hb_font_t *
hb_font_get_parent (hb_font_t *font);
+HB_EXTERN void
+hb_font_set_face (hb_font_t *font,
+ hb_face_t *face);
+
HB_EXTERN hb_face_t *
hb_font_get_face (hb_font_t *font);
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-graphite2.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-graphite2.cc
index a2d90db878f..5b804b8294e 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-graphite2.cc
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-graphite2.cc
@@ -27,7 +27,6 @@
*/
#define HB_SHAPER graphite2
-#define hb_graphite2_shaper_font_data_t gr_font
#include "hb-shaper-impl-private.hh"
#include "hb-graphite2.h"
@@ -35,8 +34,8 @@
#include <graphite2/Segment.h>
-HB_SHAPER_DATA_ENSURE_DECLARE(graphite2, face)
-HB_SHAPER_DATA_ENSURE_DECLARE(graphite2, font)
+HB_SHAPER_DATA_ENSURE_DEFINE(graphite2, face)
+HB_SHAPER_DATA_ENSURE_DEFINE(graphite2, font)
/*
@@ -153,26 +152,17 @@ hb_graphite2_face_get_gr_face (hb_face_t *face)
* shaper font data
*/
-static float hb_graphite2_get_advance (const void *hb_font, unsigned short gid)
-{
- return ((hb_font_t *) hb_font)->get_glyph_h_advance (gid);
-}
+struct hb_graphite2_shaper_font_data_t {};
hb_graphite2_shaper_font_data_t *
-_hb_graphite2_shaper_font_data_create (hb_font_t *font)
+_hb_graphite2_shaper_font_data_create (hb_font_t *font HB_UNUSED)
{
- if (unlikely (!hb_graphite2_shaper_face_data_ensure (font->face))) return NULL;
-
- hb_face_t *face = font->face;
- hb_graphite2_shaper_face_data_t *face_data = HB_SHAPER_DATA_GET (face);
-
- return gr_make_font_with_advance_fn (font->x_scale, font, &hb_graphite2_get_advance, face_data->grface);
+ return (hb_graphite2_shaper_font_data_t *) HB_SHAPER_DATA_SUCCEEDED;
}
void
-_hb_graphite2_shaper_font_data_destroy (hb_graphite2_shaper_font_data_t *data)
+_hb_graphite2_shaper_font_data_destroy (hb_graphite2_shaper_font_data_t *data HB_UNUSED)
{
- gr_font_destroy (data);
}
/*
@@ -181,8 +171,7 @@ _hb_graphite2_shaper_font_data_destroy (hb_graphite2_shaper_font_data_t *data)
gr_font *
hb_graphite2_font_get_gr_font (hb_font_t *font)
{
- if (unlikely (!hb_graphite2_shaper_font_data_ensure (font))) return NULL;
- return HB_SHAPER_DATA_GET (font);
+ return NULL;
}
@@ -230,7 +219,6 @@ _hb_graphite2_shape (hb_shape_plan_t *shape_plan,
{
hb_face_t *face = font->face;
gr_face *grface = HB_SHAPER_DATA_GET (face)->grface;
- gr_font *grfont = HB_SHAPER_DATA_GET (font);
const char *lang = hb_language_to_string (hb_buffer_get_language (buffer));
const char *lang_end = lang ? strchr (lang, '-') : NULL;
@@ -262,7 +250,7 @@ _hb_graphite2_shape (hb_shape_plan_t *shape_plan,
hb_tag_t script_tag[2];
hb_ot_tags_from_script (hb_buffer_get_script (buffer), &script_tag[0], &script_tag[1]);
- seg = gr_make_seg (grfont, grface,
+ seg = gr_make_seg (NULL, grface,
script_tag[1] == HB_TAG_NONE ? script_tag[0] : script_tag[1],
feats,
gr_utf32, chars, buffer->len,
@@ -373,7 +361,10 @@ _hb_graphite2_shape (hb_shape_plan_t *shape_plan,
}
buffer->len = glyph_count;
- float yscale = font->y_scale / font->x_scale;
+ unsigned int upem = hb_face_get_upem (face);
+ float xscale = (float) font->x_scale / upem;
+ float yscale = (float) font->y_scale / upem;
+ yscale *= yscale / xscale;
/* Positioning. */
if (!HB_DIRECTION_IS_BACKWARD(buffer->props.direction))
{
@@ -383,16 +374,16 @@ _hb_graphite2_shape (hb_shape_plan_t *shape_plan,
curradvx = 0;
for (is = gr_seg_first_slot (seg); is; pPos++, ++info, is = gr_slot_next_in_segment (is))
{
- pPos->x_offset = gr_slot_origin_X (is) - curradvx;
+ pPos->x_offset = gr_slot_origin_X (is) * xscale - curradvx;
pPos->y_offset = gr_slot_origin_Y (is) * yscale - curradvy;
if (info->cluster != currclus) {
- pPos->x_advance = info->var1.i32;
+ pPos->x_advance = info->var1.i32 * xscale;
curradvx += pPos->x_advance;
currclus = info->cluster;
} else
pPos->x_advance = 0.;
- pPos->y_advance = gr_slot_advance_Y (is, grface, grfont) * yscale;
+ pPos->y_advance = gr_slot_advance_Y (is, grface, NULL) * yscale;
curradvy += pPos->y_advance;
}
}
@@ -401,20 +392,20 @@ _hb_graphite2_shape (hb_shape_plan_t *shape_plan,
int currclus = -1;
const hb_glyph_info_t *info = buffer->info;
hb_glyph_position_t *pPos = hb_buffer_get_glyph_positions (buffer, NULL);
- curradvx = gr_seg_advance_X(seg);
+ curradvx = gr_seg_advance_X(seg) * xscale;
for (is = gr_seg_first_slot (seg); is; pPos++, info++, is = gr_slot_next_in_segment (is))
{
if (info->cluster != currclus)
{
- pPos->x_advance = info->var1.i32;
- if (currclus != -1) curradvx -= info[-1].var1.i32;
+ pPos->x_advance = info->var1.i32 * xscale;
+ if (currclus != -1) curradvx -= info[-1].var1.i32 * xscale;
currclus = info->cluster;
} else
pPos->x_advance = 0.;
- pPos->y_advance = gr_slot_advance_Y (is, grface, grfont) * yscale;
+ pPos->y_advance = gr_slot_advance_Y (is, grface, NULL) * yscale;
curradvy -= pPos->y_advance;
- pPos->x_offset = gr_slot_origin_X (is) - curradvx + pPos->x_advance;
+ pPos->x_offset = gr_slot_origin_X (is) * xscale - curradvx + pPos->x_advance;
pPos->y_offset = gr_slot_origin_Y (is) * yscale - curradvy;
}
hb_buffer_reverse_clusters (buffer);
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-graphite2.h b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-graphite2.h
index 122c3e47636..82b1e64cd2c 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-graphite2.h
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-graphite2.h
@@ -39,9 +39,13 @@ HB_BEGIN_DECLS
HB_EXTERN gr_face *
hb_graphite2_face_get_gr_face (hb_face_t *face);
+#ifndef HB_DISABLE_DEPRECATED
+
HB_EXTERN gr_font *
hb_graphite2_font_get_gr_font (hb_font_t *font);
+#endif
+
HB_END_DECLS
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gsubgpos-private.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gsubgpos-private.hh
index b7a0122a3b3..0c423526861 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gsubgpos-private.hh
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gsubgpos-private.hh
@@ -959,7 +959,7 @@ static inline bool apply_lookup (hb_apply_context_t *c,
TRACE_APPLY (NULL);
hb_buffer_t *buffer = c->buffer;
- unsigned int end;
+ int end;
/* All positions are distance from beginning of *output* buffer.
* Adjust. */
@@ -998,8 +998,8 @@ static inline bool apply_lookup (hb_apply_context_t *c,
/* Recursed lookup changed buffer len. Adjust. */
- end = int (end) + delta;
- if (end <= match_positions[idx])
+ end += delta;
+ if (end <= int (match_positions[idx]))
{
/* End might end up being smaller than match_positions[idx] if the recursed
* lookup ended up removing many items, more than we have had matched.
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-private.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-private.hh
index 8c348beb17c..071a439d60c 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-private.hh
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-private.hh
@@ -623,5 +623,4 @@ _hb_buffer_assert_gsubgpos_vars (hb_buffer_t *buffer)
#undef lig_props
#undef glyph_props
-
#endif /* HB_OT_LAYOUT_PRIVATE_HH */
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 d7ededd8db9..e78e1524e65 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
@@ -39,8 +39,6 @@
#include "hb-ot-map-private.hh"
-HB_SHAPER_DATA_ENSURE_DECLARE(ot, face)
-
hb_ot_layout_t *
_hb_ot_layout_create (hb_face_t *face)
{
@@ -107,10 +105,16 @@ _hb_ot_layout_create (hb_face_t *face)
|| (994 == gdef_len && 60336 == gpos_len && 24474 == gsub_len)
/* sha1sum:7199385abb4c2cc81c83a151a7599b6368e92343 tahomabd.ttf from Windows 10 */
|| (1006 == gdef_len && 61740 == gpos_len && 24470 == gsub_len)
+ /* sha1sum:b9c84d820c49850d3d27ec498be93955b82772b5 tahoma.ttf from Windows 10 AU */
+ || (1006 == gdef_len && 61352 == gpos_len && 24576 == gsub_len)
+ /* sha1sum:2bdfaab28174bdadd2f3d4200a30a7ae31db79d2 tahomabd.ttf from Windows 10 AU */
+ || (1018 == gdef_len && 62834 == gpos_len && 24572 == gsub_len)
/* sha1sum:b0d36cf5a2fbe746a3dd277bffc6756a820807a7 Tahoma.ttf from Mac OS X 10.9 */
|| (832 == gdef_len && 47162 == gpos_len && 7324 == gsub_len)
/* sha1sum:12fc4538e84d461771b30c18b5eb6bd434e30fba Tahoma Bold.ttf from Mac OS X 10.9 */
|| (844 == gdef_len && 45474 == gpos_len && 7302 == gsub_len)
+ /* sha1sum:eb8afadd28e9cf963e886b23a30b44ab4fd83acc himalaya.ttf from Windows 7 */
+ || (180 == gdef_len && 7254 == gpos_len && 13054 == gsub_len)
/* sha1sum:73da7f025b238a3f737aa1fde22577a6370f77b0 himalaya.ttf from Windows 8 */
|| (192 == gdef_len && 7254 == gpos_len && 12638 == gsub_len)
/* sha1sum:6e80fd1c0b059bbee49272401583160dc1e6a427 himalaya.ttf from Windows 8.1 */
@@ -129,6 +133,9 @@ _hb_ot_layout_create (hb_face_t *face)
|| (1330 == gdef_len && 57938 == gpos_len && 109904 == gsub_len)
/* 91fcc10cf15e012d27571e075b3b4dfe31754a8a padauk-3.0/Padauk-bookbold.ttf */
|| (1330 == gdef_len && 58972 == gpos_len && 109904 == gsub_len)
+ /* sha1sum: c26e41d567ed821bed997e937bc0c41435689e85 Padauk.ttf
+ * "Padauk Regular" "Version 2.5", see https://crbug.com/681813 */
+ || (1004 == gdef_len && 14836 == gpos_len && 59092 == gsub_len)
)
{
/* Many versions of Tahoma have bad GDEF tables that incorrectly classify some spacing marks
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-math.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-math.cc
index 2d7e6792a58..f82a07353c9 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-math.cc
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-math.cc
@@ -26,10 +26,9 @@
#include "hb-open-type-private.hh"
+#include "hb-ot-layout-private.hh"
#include "hb-ot-math-table.hh"
-HB_SHAPER_DATA_ENSURE_DECLARE(ot, face)
-
static inline const OT::MATH&
_get_math (hb_face_t *face)
{
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-arabic.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-arabic.cc
index 56ec5cd65cf..57ffc1dc5fe 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-arabic.cc
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-arabic.cc
@@ -540,7 +540,7 @@ apply_stch (const hb_ot_shape_plan_t *plan,
/* See if we can improve the fit by adding an extra repeat and squeezing them together a bit. */
hb_position_t extra_repeat_overlap = 0;
hb_position_t shortfall = sign * w_remaining - sign * w_repeating * (n_copies + 1);
- if (shortfall > 0)
+ if (shortfall > 0 && n_repeating > 0)
{
++n_copies;
hb_position_t excess = (n_copies + 1) * sign * w_repeating - sign * w_remaining;
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-indic-table.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-indic-table.cc
index 80a6b25e3b0..e10a4d25f5f 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-indic-table.cc
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-indic-table.cc
@@ -422,6 +422,13 @@ hb_indic_get_categories (hb_codepoint_t u)
if (hb_in_range (u, 0xAA60u, 0xAA7Fu)) return indic_table[u - 0xAA60u + indic_offset_0xaa60u];
break;
+ case 0x11u:
+ // According to ScriptExtensions.txt, these Grantha marks may also be used in Tamil,
+ // so the Indic shaper needs to know their categories.
+ if (unlikely (u == 0x11303)) return _(Vs,R);
+ if (unlikely (u == 0x1133c)) return _(N,B);
+ break;
+
default:
break;
}
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-private.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-private.hh
index 39572dfe007..952441b6a59 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-private.hh
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-private.hh
@@ -191,6 +191,9 @@ hb_ot_shape_complex_categorize (const hb_ot_shape_planner_t *planner)
case HB_SCRIPT_MANICHAEAN:
case HB_SCRIPT_PSALTER_PAHLAVI:
+ /* Unicode-9.0 additions */
+ case HB_SCRIPT_ADLAM:
+
/* For Arabic script, use the Arabic shaper even if no OT script tag was found.
* This is because we do fallback shaping for Arabic script (and not others).
* But note that Arabic shaping is applicable only to horizontal layout; for
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-normalize.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-normalize.cc
index 107617e81ca..94a3d7d27aa 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-normalize.cc
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-normalize.cc
@@ -91,7 +91,7 @@ compose_unicode (const hb_ot_shape_normalize_context_t *c,
static inline void
set_glyph (hb_glyph_info_t &info, hb_font_t *font)
{
- font->get_nominal_glyph (info.codepoint, &info.glyph_index());
+ (void) font->get_nominal_glyph (info.codepoint, &info.glyph_index());
}
static inline void
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape.cc
index 6b38739c91b..2eacb34c4d9 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape.cc
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape.cc
@@ -128,6 +128,8 @@ hb_ot_shape_collect_features (hb_ot_shape_planner_t *planner,
* shaper face data
*/
+HB_SHAPER_DATA_ENSURE_DEFINE(ot, face)
+
hb_ot_shaper_face_data_t *
_hb_ot_shaper_face_data_create (hb_face_t *face)
{
@@ -145,6 +147,8 @@ _hb_ot_shaper_face_data_destroy (hb_ot_shaper_face_data_t *data)
* shaper font data
*/
+HB_SHAPER_DATA_ENSURE_DEFINE(ot, font)
+
struct hb_ot_shaper_font_data_t {};
hb_ot_shaper_font_data_t *
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-var-hvar-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-var-hvar-table.hh
index 3a2a820376f..f9d801e3b8f 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-var-hvar-table.hh
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-var-hvar-table.hh
@@ -78,10 +78,10 @@ struct DeltaSetIndexMap
{ return (format & 0xF) + 1; }
protected:
- USHORT format; /* A packed field that describes the compressed
+ USHORT format; /* A packed field that describes the compressed
* representation of delta-set indices. */
- USHORT mapCount; /* The number of mapping entries. */
- BYTE mapData[VAR]; /* The delta-set index mapping data. */
+ USHORT mapCount; /* The number of mapping entries. */
+ BYTE mapData[VAR]; /* The delta-set index mapping data. */
public:
DEFINE_SIZE_ARRAY (4, mapData);
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-var-mvar-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-var-mvar-table.hh
new file mode 100644
index 00000000000..3cb74984767
--- /dev/null
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-var-mvar-table.hh
@@ -0,0 +1,110 @@
+/*
+ * Copyright © 2017 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
+ */
+
+#ifndef HB_OT_VAR_MVAR_TABLE_HH
+#define HB_OT_VAR_MVAR_TABLE_HH
+
+#include "hb-ot-layout-common-private.hh"
+
+
+namespace OT {
+
+
+struct VariationValueRecord
+{
+ inline bool sanitize (hb_sanitize_context_t *c) const
+ {
+ TRACE_SANITIZE (this);
+ return_trace (c->check_struct (this));
+ }
+
+ public:
+ Tag valueTag; /* Four-byte tag identifying a font-wide measure. */
+ ULONG varIdx; /* Outer/inner index into VariationStore item. */
+
+ public:
+ DEFINE_SIZE_STATIC (8);
+};
+
+
+/*
+ * MVAR -- Metrics Variations Table
+ */
+
+#define HB_OT_TAG_MVAR HB_TAG('M','V','A','R')
+
+struct MVAR
+{
+ static const hb_tag_t tableTag = HB_OT_TAG_MVAR;
+
+ inline bool sanitize (hb_sanitize_context_t *c) const
+ {
+ TRACE_SANITIZE (this);
+ return_trace (version.sanitize (c) &&
+ likely (version.major == 1) &&
+ c->check_struct (this) &&
+ valueRecordSize >= VariationValueRecord::static_size &&
+ varStore.sanitize (c, this) &&
+ c->check_array (values, valueRecordSize, valueRecordCount));
+ }
+
+ inline float get_var (hb_tag_t tag,
+ int *coords, unsigned int coord_count) const
+ {
+ const VariationValueRecord *record;
+ record = (VariationValueRecord *) bsearch (&tag, values,
+ valueRecordCount, valueRecordSize,
+ (hb_compare_func_t) tag_compare);
+ if (!record)
+ return 0.;
+
+ return (this+varStore).get_delta (record->varIdx, coords, coord_count);
+ }
+
+protected:
+ static inline int tag_compare (const hb_tag_t *a, const Tag *b)
+ { return b->cmp (*a); }
+
+ protected:
+ FixedVersion<>version; /* Version of the metrics variation table
+ * initially set to 0x00010000u */
+ USHORT reserved; /* Not used; set to 0. */
+ USHORT valueRecordSize;/* The size in bytes of each value record —
+ * must be greater than zero. */
+ USHORT valueRecordCount;/* The number of value records — may be zero. */
+ OffsetTo<VariationStore>
+ varStore; /* Offset to item variation store table. */
+ BYTE values[VAR]; /* Array of value records. The records must be
+ * in binary order of their valueTag field. */
+
+ public:
+ DEFINE_SIZE_ARRAY (12, values);
+};
+
+} /* namespace OT */
+
+
+#endif /* HB_OT_VAR_MVAR_TABLE_HH */
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-var.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-var.cc
index d4d16dfffb0..691196d9bb6 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-var.cc
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-var.cc
@@ -29,10 +29,9 @@
#include "hb-ot-layout-private.hh"
#include "hb-ot-var-avar-table.hh"
#include "hb-ot-var-fvar-table.hh"
+#include "hb-ot-var-mvar-table.hh"
#include "hb-ot-var.h"
-HB_SHAPER_DATA_ENSURE_DECLARE(ot, face)
-
/*
* fvar/avar
*/
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-shape-plan.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-shape-plan.cc
index 600faaeb18c..1ac77bef750 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-shape-plan.cc
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-shape-plan.cc
@@ -35,13 +35,6 @@
#endif
-#define HB_SHAPER_IMPLEMENT(shaper) \
- HB_SHAPER_DATA_ENSURE_DECLARE(shaper, face) \
- HB_SHAPER_DATA_ENSURE_DECLARE(shaper, font)
-#include "hb-shaper-list.hh"
-#undef HB_SHAPER_IMPLEMENT
-
-
static void
hb_shape_plan_plan (hb_shape_plan_t *shape_plan,
const hb_feature_t *user_features,
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-shaper-private.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-shaper-private.hh
index d1d1146dad2..381398a6171 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-shaper-private.hh
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-shaper-private.hh
@@ -65,27 +65,31 @@ struct hb_shaper_data_t {
#define HB_SHAPER_DATA_INVALID ((void *) -1)
#define HB_SHAPER_DATA_IS_INVALID(data) ((void *) (data) == HB_SHAPER_DATA_INVALID)
-#define HB_SHAPER_DATA_TYPE(shaper, object) struct hb_##shaper##_shaper_##object##_data_t
+#define HB_SHAPER_DATA_TYPE_NAME(shaper, object) hb_##shaper##_shaper_##object##_data_t
+#define HB_SHAPER_DATA_TYPE(shaper, object) struct HB_SHAPER_DATA_TYPE_NAME(shaper, object)
#define HB_SHAPER_DATA_INSTANCE(shaper, object, instance) (* (HB_SHAPER_DATA_TYPE(shaper, object) **) &(instance)->shaper_data.shaper)
-#define HB_SHAPER_DATA(shaper, object) HB_SHAPER_DATA_INSTANCE (shaper, object, object)
+#define HB_SHAPER_DATA(shaper, object) HB_SHAPER_DATA_INSTANCE(shaper, object, object)
#define HB_SHAPER_DATA_CREATE_FUNC(shaper, object) _hb_##shaper##_shaper_##object##_data_create
#define HB_SHAPER_DATA_DESTROY_FUNC(shaper, object) _hb_##shaper##_shaper_##object##_data_destroy
+#define HB_SHAPER_DATA_ENSURE_FUNC(shaper, object) hb_##shaper##_shaper_##object##_data_ensure
#define HB_SHAPER_DATA_PROTOTYPE(shaper, object) \
HB_SHAPER_DATA_TYPE (shaper, object); /* Type forward declaration. */ \
extern "C" HB_INTERNAL HB_SHAPER_DATA_TYPE (shaper, object) * \
HB_SHAPER_DATA_CREATE_FUNC (shaper, object) (hb_##object##_t *object HB_SHAPER_DATA_CREATE_FUNC_EXTRA_ARGS); \
extern "C" HB_INTERNAL void \
- HB_SHAPER_DATA_DESTROY_FUNC (shaper, object) (HB_SHAPER_DATA_TYPE (shaper, object) *data)
+ HB_SHAPER_DATA_DESTROY_FUNC (shaper, object) (HB_SHAPER_DATA_TYPE (shaper, object) *data); \
+ extern "C" HB_INTERNAL bool \
+ HB_SHAPER_DATA_ENSURE_FUNC (shaper, object) (hb_##object##_t *object)
#define HB_SHAPER_DATA_DESTROY(shaper, object) \
if (HB_SHAPER_DATA_TYPE (shaper, object) *data = HB_SHAPER_DATA (shaper, object)) \
if (data != HB_SHAPER_DATA_INVALID && data != HB_SHAPER_DATA_SUCCEEDED) \
HB_SHAPER_DATA_DESTROY_FUNC (shaper, object) (data);
-#define HB_SHAPER_DATA_ENSURE_DECLARE(shaper, object) \
-static inline bool \
-hb_##shaper##_shaper_##object##_data_ensure (hb_##object##_t *object) \
+#define HB_SHAPER_DATA_ENSURE_DEFINE(shaper, object) \
+bool \
+HB_SHAPER_DATA_ENSURE_FUNC(shaper, object) (hb_##object##_t *object) \
{\
retry: \
HB_SHAPER_DATA_TYPE (shaper, object) *data = (HB_SHAPER_DATA_TYPE (shaper, object) *) hb_atomic_ptr_get (&HB_SHAPER_DATA (shaper, object)); \
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-uniscribe.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-uniscribe.cc
index 6e4db01495f..58f983dbec1 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-uniscribe.cc
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-uniscribe.cc
@@ -293,8 +293,8 @@ struct range_record_t {
unsigned int index_last; /* == end - 1 */
};
-HB_SHAPER_DATA_ENSURE_DECLARE(uniscribe, face)
-HB_SHAPER_DATA_ENSURE_DECLARE(uniscribe, font)
+HB_SHAPER_DATA_ENSURE_DEFINE(uniscribe, face)
+HB_SHAPER_DATA_ENSURE_DEFINE(uniscribe, font)
/*