[HarfBuzz] harfbuzz: Branch 'master' - 4 commits
Behdad Esfahbod
behdad at kemper.freedesktop.org
Tue Aug 7 16:56:46 UTC 2018
NEWS | 15 +++++++++++
configure.ac | 2 -
docs/harfbuzz-sections.txt | 1
src/hb-font-private.hh | 20 +++++++++++----
src/hb-font.cc | 57 +++++++++++++++++++++++++++++++++++++++++++++
src/hb-font.h | 27 +++++++++++++++++++--
src/hb-version.h | 4 +--
7 files changed, 116 insertions(+), 10 deletions(-)
New commits:
commit e49a38b20e82e50bca96751470e945cbe0524880
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Tue Aug 7 09:55:42 2018 -0700
1.8.6
diff --git a/NEWS b/NEWS
index 13aa6629..e97a501d 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,18 @@
+Overview of changes leading to 1.8.6
+Tuesday, August 7, 2018
+====================================
+- Internal code shuffling.
+- New API to speed up getting advance widths for implementations
+ that have heavy overhead in get_h_advance callback:
++hb_font_funcs_set_glyph_h_advances_func
++hb_font_funcs_set_glyph_v_advances_func
++hb_font_get_glyph_advances_for_direction
++hb_font_get_glyph_h_advances
++hb_font_get_glyph_h_advances_func_t
++hb_font_get_glyph_v_advances
++hb_font_get_glyph_v_advances_func_t
+
+
Overview of changes leading to 1.8.5
Wednesday, August 1, 2018
====================================
diff --git a/configure.ac b/configure.ac
index c439f54d..c03d79dc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
AC_PREREQ([2.64])
AC_INIT([HarfBuzz],
- [1.8.5],
+ [1.8.6],
[https://github.com/harfbuzz/harfbuzz/issues/new],
[harfbuzz],
[http://harfbuzz.org/])
diff --git a/src/hb-font.cc b/src/hb-font.cc
index 77c0617a..80768d6d 100644
--- a/src/hb-font.cc
+++ b/src/hb-font.cc
@@ -789,7 +789,7 @@ hb_font_get_glyph_v_advance (hb_font_t *font,
*
*
*
- * Since: REPLACEME
+ * Since: 1.8.6
**/
void
hb_font_get_glyph_h_advances (hb_font_t* font,
@@ -807,7 +807,7 @@ hb_font_get_glyph_h_advances (hb_font_t* font,
*
*
*
- * Since: REPLACEME
+ * Since: 1.8.6
**/
void
hb_font_get_glyph_v_advances (hb_font_t* font,
@@ -1031,7 +1031,7 @@ hb_font_get_glyph_advance_for_direction (hb_font_t *font,
*
*
*
- * Since: REPLACEME
+ * Since: 1.8.6
**/
HB_EXTERN void
hb_font_get_glyph_advances_for_direction (hb_font_t* font,
diff --git a/src/hb-font.h b/src/hb-font.h
index cd211533..6cd48697 100644
--- a/src/hb-font.h
+++ b/src/hb-font.h
@@ -283,7 +283,7 @@ hb_font_funcs_set_glyph_v_advance_func (hb_font_funcs_t *ffuncs,
*
*
*
- * Since: REPLACEME
+ * Since: 1.8.6
**/
HB_EXTERN void
hb_font_funcs_set_glyph_h_advances_func (hb_font_funcs_t *ffuncs,
@@ -299,7 +299,7 @@ hb_font_funcs_set_glyph_h_advances_func (hb_font_funcs_t *ffuncs,
*
*
*
- * Since: REPLACEME
+ * Since: 1.8.6
**/
HB_EXTERN void
hb_font_funcs_set_glyph_v_advances_func (hb_font_funcs_t *ffuncs,
diff --git a/src/hb-version.h b/src/hb-version.h
index c5092c78..7406ea8c 100644
--- a/src/hb-version.h
+++ b/src/hb-version.h
@@ -38,9 +38,9 @@ HB_BEGIN_DECLS
#define HB_VERSION_MAJOR 1
#define HB_VERSION_MINOR 8
-#define HB_VERSION_MICRO 5
+#define HB_VERSION_MICRO 6
-#define HB_VERSION_STRING "1.8.5"
+#define HB_VERSION_STRING "1.8.6"
#define HB_VERSION_ATLEAST(major,minor,micro) \
((major)*10000+(minor)*100+(micro) <= \
commit b0ff79acd804e47a2a3db73746cf9c6dc986950a
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Tue Aug 7 09:52:06 2018 -0700
Add +hb_font_get_glyph_advances_for_direction
New API:
+hb_font_get_glyph_advances_for_direction
diff --git a/docs/harfbuzz-sections.txt b/docs/harfbuzz-sections.txt
index f012fbdb..16b66277 100644
--- a/docs/harfbuzz-sections.txt
+++ b/docs/harfbuzz-sections.txt
@@ -225,6 +225,7 @@ hb_font_get_face
hb_font_get_glyph
hb_font_get_glyph_advance_for_direction
hb_font_get_glyph_advance_func_t
+hb_font_get_glyph_advances_for_direction
hb_font_get_glyph_contour_point
hb_font_get_glyph_contour_point_for_origin
hb_font_get_glyph_contour_point_func_t
diff --git a/src/hb-font-private.hh b/src/hb-font-private.hh
index c1981dda..d3a41380 100644
--- a/src/hb-font-private.hh
+++ b/src/hb-font-private.hh
@@ -376,6 +376,18 @@ struct hb_font_t
else
*y = get_glyph_v_advance (glyph);
}
+ inline void get_glyph_advances_for_direction (hb_direction_t direction,
+ unsigned count,
+ hb_codepoint_t *first_glyph,
+ unsigned glyph_stride,
+ hb_position_t *first_advance,
+ unsigned advance_stride)
+ {
+ if (likely (HB_DIRECTION_IS_HORIZONTAL (direction)))
+ get_glyph_h_advances (count, first_glyph, glyph_stride, first_advance, advance_stride);
+ else
+ get_glyph_v_advances (count, first_glyph, glyph_stride, first_advance, advance_stride);
+ }
inline void guess_v_origin_minus_h_origin (hb_codepoint_t glyph,
hb_position_t *x, hb_position_t *y)
diff --git a/src/hb-font.cc b/src/hb-font.cc
index 6b6ace84..77c0617a 100644
--- a/src/hb-font.cc
+++ b/src/hb-font.cc
@@ -1024,6 +1024,26 @@ hb_font_get_glyph_advance_for_direction (hb_font_t *font,
{
return font->get_glyph_advance_for_direction (glyph, direction, x, y);
}
+/**
+ * hb_font_get_glyph_advances_for_direction:
+ * @font: a font.
+ * @direction:
+ *
+ *
+ *
+ * Since: REPLACEME
+ **/
+HB_EXTERN void
+hb_font_get_glyph_advances_for_direction (hb_font_t* font,
+ hb_direction_t direction,
+ unsigned count,
+ hb_codepoint_t *first_glyph,
+ unsigned glyph_stride,
+ hb_position_t *first_advance,
+ unsigned advance_stride)
+{
+ font->get_glyph_advances_for_direction (direction, count, first_glyph, glyph_stride, first_advance, advance_stride);
+}
/**
* hb_font_get_glyph_origin_for_direction:
diff --git a/src/hb-font.h b/src/hb-font.h
index 37c9a671..cd211533 100644
--- a/src/hb-font.h
+++ b/src/hb-font.h
@@ -529,6 +529,14 @@ hb_font_get_glyph_advance_for_direction (hb_font_t *font,
hb_direction_t direction,
hb_position_t *x, hb_position_t *y);
HB_EXTERN void
+hb_font_get_glyph_advances_for_direction (hb_font_t* font,
+ hb_direction_t direction,
+ unsigned count,
+ hb_codepoint_t *first_glyph,
+ unsigned glyph_stride,
+ hb_position_t *first_advance,
+ unsigned advance_stride);
+HB_EXTERN void
hb_font_get_glyph_origin_for_direction (hb_font_t *font,
hb_codepoint_t glyph,
hb_direction_t direction,
commit 28e2f467e1c7dd5e82d105efa8c4580dbfc93960
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Tue Aug 7 09:47:00 2018 -0700
Actually add hb_font_get_glyph_[hv]_advances
New API:
+hb_font_get_glyph_h_advances
+hb_font_get_glyph_v_advances
diff --git a/src/hb-font.cc b/src/hb-font.cc
index e084de9b..6b6ace84 100644
--- a/src/hb-font.cc
+++ b/src/hb-font.cc
@@ -784,6 +784,43 @@ hb_font_get_glyph_v_advance (hb_font_t *font,
}
/**
+ * hb_font_get_glyph_h_advances:
+ * @font: a font.
+ *
+ *
+ *
+ * Since: REPLACEME
+ **/
+void
+hb_font_get_glyph_h_advances (hb_font_t* font,
+ unsigned count,
+ hb_codepoint_t *first_glyph,
+ unsigned glyph_stride,
+ hb_position_t *first_advance,
+ unsigned advance_stride)
+{
+ font->get_glyph_h_advances (count, first_glyph, glyph_stride, first_advance, advance_stride);
+}
+/**
+ * hb_font_get_glyph_v_advances:
+ * @font: a font.
+ *
+ *
+ *
+ * Since: REPLACEME
+ **/
+void
+hb_font_get_glyph_v_advances (hb_font_t* font,
+ unsigned count,
+ hb_codepoint_t *first_glyph,
+ unsigned glyph_stride,
+ hb_position_t *first_advance,
+ unsigned advance_stride)
+{
+ font->get_glyph_v_advances (count, first_glyph, glyph_stride, first_advance, advance_stride);
+}
+
+/**
* hb_font_get_glyph_h_origin:
* @font: a font.
* @glyph:
diff --git a/src/hb-font.h b/src/hb-font.h
index 181d15ee..37c9a671 100644
--- a/src/hb-font.h
+++ b/src/hb-font.h
@@ -459,6 +459,21 @@ HB_EXTERN hb_position_t
hb_font_get_glyph_v_advance (hb_font_t *font,
hb_codepoint_t glyph);
+HB_EXTERN void
+hb_font_get_glyph_h_advances (hb_font_t* font,
+ unsigned count,
+ hb_codepoint_t *first_glyph,
+ unsigned glyph_stride,
+ hb_position_t *first_advance,
+ unsigned advance_stride);
+HB_EXTERN void
+hb_font_get_glyph_v_advances (hb_font_t* font,
+ unsigned count,
+ hb_codepoint_t *first_glyph,
+ unsigned glyph_stride,
+ hb_position_t *first_advance,
+ unsigned advance_stride);
+
HB_EXTERN hb_bool_t
hb_font_get_glyph_h_origin (hb_font_t *font,
hb_codepoint_t glyph,
commit 996775191a3fdeeeaee80e3123ef2240e6390b3d
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Tue Aug 7 09:44:01 2018 -0700
Minor
diff --git a/src/hb-font-private.hh b/src/hb-font-private.hh
index 6862e062..c1981dda 100644
--- a/src/hb-font-private.hh
+++ b/src/hb-font-private.hh
@@ -370,13 +370,11 @@ struct hb_font_t
hb_direction_t direction,
hb_position_t *x, hb_position_t *y)
{
- if (likely (HB_DIRECTION_IS_HORIZONTAL (direction))) {
+ *x = *y = 0;
+ if (likely (HB_DIRECTION_IS_HORIZONTAL (direction)))
*x = get_glyph_h_advance (glyph);
- *y = 0;
- } else {
- *x = 0;
+ else
*y = get_glyph_v_advance (glyph);
- }
}
inline void guess_v_origin_minus_h_origin (hb_codepoint_t glyph,
More information about the HarfBuzz
mailing list