| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright © 2010,2011,2013 Google, Inc. | 2 * Copyright © 2010,2011,2013 Google, Inc. |
| 3 * | 3 * |
| 4 * This is part of HarfBuzz, a text shaping library. | 4 * This is part of HarfBuzz, a text shaping library. |
| 5 * | 5 * |
| 6 * Permission is hereby granted, without written agreement and without | 6 * Permission is hereby granted, without written agreement and without |
| 7 * license or royalty fees, to use, copy, modify, and distribute this | 7 * license or royalty fees, to use, copy, modify, and distribute this |
| 8 * software and its documentation for any purpose, provided that the | 8 * software and its documentation for any purpose, provided that the |
| 9 * above copyright notice and the following two paragraphs appear in | 9 * above copyright notice and the following two paragraphs appear in |
| 10 * all copies of this software. | 10 * all copies of this software. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #ifdef HAVE_CONFIG_H | 27 #ifdef HAVE_CONFIG_H |
| 28 #include "config.h" | 28 #include "config.h" |
| 29 #endif | 29 #endif |
| 30 | 30 |
| 31 #include "hb.h" | 31 #include "hb.h" |
| 32 #ifdef HAVE_FREETYPE | 32 #ifdef HAVE_FREETYPE |
| 33 #include "hb-ft.h" | 33 #include "hb-ft.h" |
| 34 #endif | 34 #endif |
| 35 | 35 |
| 36 #ifdef HAVE_GLIB | 36 #ifdef HAVE_GLIB |
| 37 #include <glib.h> | 37 # include <glib.h> |
| 38 # if !GLIB_CHECK_VERSION (2, 22, 0) |
| 39 # define g_mapped_file_unref g_mapped_file_free |
| 40 # endif |
| 38 #endif | 41 #endif |
| 39 #include <stdlib.h> | 42 #include <stdlib.h> |
| 40 #include <stdio.h> | 43 #include <stdio.h> |
| 41 | 44 |
| 42 int | 45 int |
| 43 main (int argc, char **argv) | 46 main (int argc, char **argv) |
| 44 { | 47 { |
| 45 hb_blob_t *blob = NULL; | 48 hb_blob_t *blob = NULL; |
| 46 | 49 |
| 47 if (argc != 2) { | 50 if (argc != 2) { |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 p, -1, &p, | 110 p, -1, &p, |
| 108 font, | 111 font, |
| 109 HB_BUFFER_SERIALIZE_FORMAT_JSON)) | 112 HB_BUFFER_SERIALIZE_FORMAT_JSON)) |
| 110 ; | 113 ; |
| 111 if (*p && *p != '\n') | 114 if (*p && *p != '\n') |
| 112 ret = false; | 115 ret = false; |
| 113 | 116 |
| 114 hb_buffer_serialize_glyphs (buf, 0, hb_buffer_get_length (buf), | 117 hb_buffer_serialize_glyphs (buf, 0, hb_buffer_get_length (buf), |
| 115 out, sizeof (out), NULL, | 118 out, sizeof (out), NULL, |
| 116 font, HB_BUFFER_SERIALIZE_FORMAT_JSON, | 119 font, HB_BUFFER_SERIALIZE_FORMAT_JSON, |
| 117 » » » » HB_BUFFER_SERIALIZE_FLAGS_DEFAULT); | 120 » » » » HB_BUFFER_SERIALIZE_FLAG_DEFAULT); |
| 118 puts (out); | 121 puts (out); |
| 119 } | 122 } |
| 120 | 123 |
| 121 hb_buffer_destroy (buf); | 124 hb_buffer_destroy (buf); |
| 122 | 125 |
| 123 hb_font_destroy (font); | 126 hb_font_destroy (font); |
| 124 | 127 |
| 125 return !ret; | 128 return !ret; |
| 126 } | 129 } |
| OLD | NEW |