[HarfBuzz] harfbuzz: Branch 'master'
Behdad Esfahbod
behdad at kemper.freedesktop.org
Mon Dec 5 04:29:13 UTC 2016
test/fuzzing/hb-fuzzer.cc | 13 +++++++++++++
1 file changed, 13 insertions(+)
New commits:
commit 8c842e4a44908cce0f416481c73dc0866a0a9c95
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Sun Dec 4 20:28:38 2016 -0800
[hb-fuzzer] Get glyph extents for output glyphs
To exercise glyph-extents codepaths (glyf / CBLC+CBDT).
diff --git a/test/fuzzing/hb-fuzzer.cc b/test/fuzzing/hb-fuzzer.cc
index b319a71..c9f15d8 100644
--- a/test/fuzzing/hb-fuzzer.cc
+++ b/test/fuzzing/hb-fuzzer.cc
@@ -28,6 +28,19 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
hb_buffer_add_utf32(buffer, text32, sizeof(text32)/sizeof(text32[0]), 0, -1);
hb_buffer_guess_segment_properties(buffer);
hb_shape(font, buffer, NULL, 0);
+
+ unsigned int len = hb_buffer_get_length (buffer);
+ hb_glyph_info_t *infos = hb_buffer_get_glyph_infos (buffer, NULL);
+ //hb_glyph_position_t *positions = hb_buffer_get_glyph_positions (buffer, NULL);
+ for (unsigned int i = 0; i < len; i++)
+ {
+ hb_glyph_info_t info = infos[i];
+ //hb_glyph_position_t pos = positions[i];
+
+ hb_glyph_extents_t extents;
+ hb_font_get_glyph_extents (font, info.codepoint, &extents);
+ }
+
hb_buffer_destroy(buffer);
}
More information about the HarfBuzz
mailing list