Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(43)

Unified Diff: third_party/harfbuzz-ng/src/hb-buffer-serialize.cc

Issue 1408003004: Roll harfbuzz-ng to 1.0.5 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2526
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/harfbuzz-ng/src/hb-buffer-private.hh ('k') | third_party/harfbuzz-ng/src/hb-common.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/harfbuzz-ng/src/hb-buffer-serialize.cc
diff --git a/third_party/harfbuzz-ng/src/hb-buffer-serialize.cc b/third_party/harfbuzz-ng/src/hb-buffer-serialize.cc
index 8a22224a5a250ad1fb405aa85cdaf823ee1a7c7a..7839cbc3f060a857f56158f12780bb9835f72556 100644
--- a/third_party/harfbuzz-ng/src/hb-buffer-serialize.cc
+++ b/third_party/harfbuzz-ng/src/hb-buffer-serialize.cc
@@ -40,7 +40,7 @@ static const char *serialize_formats[] = {
*
* Return value: (transfer none):
*
- * Since: 1.0
+ * Since: 0.9.2
**/
const char **
hb_buffer_serialize_list_formats (void)
@@ -57,7 +57,7 @@ hb_buffer_serialize_list_formats (void)
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_buffer_serialize_format_t
hb_buffer_serialize_format_from_string (const char *str, int len)
@@ -74,7 +74,7 @@ hb_buffer_serialize_format_from_string (const char *str, int len)
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
const char *
hb_buffer_serialize_format_to_string (hb_buffer_serialize_format_t format)
@@ -145,6 +145,16 @@ _hb_buffer_serialize_glyphs_json (hb_buffer_t *buffer,
pos[i].x_advance, pos[i].y_advance);
}
+ if (flags & HB_BUFFER_SERIALIZE_FLAG_GLYPH_EXTENTS)
+ {
+ hb_glyph_extents_t extents;
+ hb_font_get_glyph_extents(font, info[i].codepoint, &extents);
+ p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), ",\"xb\":%d,\"yb\":%d",
+ extents.x_bearing, extents.y_bearing));
+ p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), ",\"w\":%d,\"h\":%d",
+ extents.width, extents.height));
+ }
+
*p++ = '}';
unsigned int l = p - b;
@@ -210,6 +220,13 @@ _hb_buffer_serialize_glyphs_text (hb_buffer_t *buffer,
p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), ",%d", pos[i].y_advance));
}
+ if (flags & HB_BUFFER_SERIALIZE_FLAG_GLYPH_EXTENTS)
+ {
+ hb_glyph_extents_t extents;
+ hb_font_get_glyph_extents(font, info[i].codepoint, &extents);
+ p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), "<%d,%d,%d,%d>", extents.x_bearing, extents.y_bearing, extents.width, extents.height));
+ }
+
unsigned int l = p - b;
if (buf_size > l)
{
@@ -242,7 +259,7 @@ _hb_buffer_serialize_glyphs_text (hb_buffer_t *buffer,
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
unsigned int
hb_buffer_serialize_glyphs (hb_buffer_t *buffer,
@@ -349,7 +366,7 @@ parse_int (const char *pp, const char *end, int32_t *pv)
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_bool_t
hb_buffer_deserialize_glyphs (hb_buffer_t *buffer,
« no previous file with comments | « third_party/harfbuzz-ng/src/hb-buffer-private.hh ('k') | third_party/harfbuzz-ng/src/hb-common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698