* Google Author(s): Behdad Esfahbod
*/
+#include "hb.hh"
+
+#ifndef HB_NO_BUFFER_SERIALIZE
+
#include "hb-buffer.hh"
static const char *serialize_formats[] = {
-#ifndef HB_NO_BUFFER_SERIALIZE
"text",
"json",
-#endif
nullptr
};
{
switch ((unsigned) format)
{
-#ifndef HB_NO_BUFFER_SERIALIZE
case HB_BUFFER_SERIALIZE_FORMAT_TEXT: return serialize_formats[0];
case HB_BUFFER_SERIALIZE_FORMAT_JSON: return serialize_formats[1];
-#endif
default:
case HB_BUFFER_SERIALIZE_FORMAT_INVALID: return nullptr;
}
if (buf_size)
*buf = '\0';
-#ifdef HB_NO_BUFFER_SERIALIZE
- return 0;
-#endif
-
assert ((!buffer->len && buffer->content_type == HB_BUFFER_CONTENT_TYPE_INVALID) ||
buffer->content_type == HB_BUFFER_CONTENT_TYPE_GLYPHS);
end_ptr = &end;
*end_ptr = buf;
-#ifdef HB_NO_BUFFER_SERIALIZE
- return false;
-#endif
-
assert ((!buffer->len && buffer->content_type == HB_BUFFER_CONTENT_TYPE_INVALID) ||
buffer->content_type == HB_BUFFER_CONTENT_TYPE_GLYPHS);
}
}
+
+
+#endif
int
main (int argc, char **argv)
{
+ bool ret = true;
+
+#ifndef HB_NO_BUFFER_SERIALIZE
+
if (argc != 2) {
fprintf (stderr, "usage: %s font-file\n", argv[0]);
exit (1);
hb_buffer_t *buf;
buf = hb_buffer_create ();
- bool ret = true;
char line[BUFSIZ], out[BUFSIZ];
while (fgets (line, sizeof(line), stdin) != nullptr)
{
hb_font_destroy (font);
+#endif
+
return !ret;
}