* Google Author(s): Behdad Esfahbod
*/
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
+#include "hb-private.hh"
#include "hb.h"
+#include "hb-ot.h"
#ifdef HAVE_FREETYPE
#include "hb-ft.h"
#endif
int
main (int argc, char **argv)
{
- hb_blob_t *blob = NULL;
+ hb_blob_t *blob = nullptr;
if (argc != 2) {
fprintf (stderr, "usage: %s font-file\n", argv[0]);
hb_memory_mode_t mm;
#ifdef HAVE_GLIB
- GMappedFile *mf = g_mapped_file_new (argv[1], false, NULL);
+ GMappedFile *mf = g_mapped_file_new (argv[1], false, nullptr);
font_data = g_mapped_file_get_contents (mf);
len = g_mapped_file_get_length (mf);
destroy = (hb_destroy_func_t) g_mapped_file_unref;
hb_face_t *face = hb_face_create (blob, 0 /* first face */);
hb_blob_destroy (blob);
- blob = NULL;
+ blob = nullptr;
unsigned int upem = hb_face_get_upem (face);
hb_font_t *font = hb_font_create (face);
hb_face_destroy (face);
hb_font_set_scale (font, upem, upem);
+ hb_ot_font_set_funcs (font);
#ifdef HAVE_FREETYPE
- hb_ft_font_set_funcs (font);
+ //hb_ft_font_set_funcs (font);
#endif
hb_buffer_t *buf;
bool ret = true;
char line[BUFSIZ], out[BUFSIZ];
- while (fgets (line, sizeof(line), stdin) != 0)
+ while (fgets (line, sizeof(line), stdin) != nullptr)
{
hb_buffer_clear_contents (buf);
ret = false;
hb_buffer_serialize_glyphs (buf, 0, hb_buffer_get_length (buf),
- out, sizeof (out), NULL,
+ out, sizeof (out), nullptr,
font, HB_BUFFER_SERIALIZE_FORMAT_JSON,
HB_BUFFER_SERIALIZE_FLAG_DEFAULT);
puts (out);