| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright © 2010,2011 Google, Inc. | 2 * Copyright © 2010,2011 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 hb_font_t *font = hb_font_create (face); | 93 hb_font_t *font = hb_font_create (face); |
| 94 hb_font_set_scale (font, upem, upem); | 94 hb_font_set_scale (font, upem, upem); |
| 95 | 95 |
| 96 #ifdef HAVE_FREETYPE | 96 #ifdef HAVE_FREETYPE |
| 97 hb_ft_font_set_funcs (font); | 97 hb_ft_font_set_funcs (font); |
| 98 #endif | 98 #endif |
| 99 | 99 |
| 100 hb_buffer_t *buffer = hb_buffer_create (); | 100 hb_buffer_t *buffer = hb_buffer_create (); |
| 101 | 101 |
| 102 hb_buffer_add_utf8 (buffer, "\xe0\xa4\x95\xe0\xa5\x8d\xe0\xa4\xb0\xe0\xa5\x8d\
xe0\xa4\x95", -1, 0, -1); | 102 hb_buffer_add_utf8 (buffer, "\xe0\xa4\x95\xe0\xa5\x8d\xe0\xa4\xb0\xe0\xa5\x8d\
xe0\xa4\x95", -1, 0, -1); |
| 103 hb_buffer_guess_segment_properties (buffer); |
| 103 | 104 |
| 104 hb_shape (font, buffer, NULL, 0); | 105 hb_shape (font, buffer, NULL, 0); |
| 105 | 106 |
| 106 unsigned int count = hb_buffer_get_length (buffer); | 107 unsigned int count = hb_buffer_get_length (buffer); |
| 107 hb_glyph_info_t *infos = hb_buffer_get_glyph_infos (buffer, NULL); | 108 hb_glyph_info_t *infos = hb_buffer_get_glyph_infos (buffer, NULL); |
| 108 hb_glyph_position_t *positions = hb_buffer_get_glyph_positions (buffer, NULL); | 109 hb_glyph_position_t *positions = hb_buffer_get_glyph_positions (buffer, NULL); |
| 109 | 110 |
| 110 for (unsigned int i = 0; i < count; i++) | 111 for (unsigned int i = 0; i < count; i++) |
| 111 { | 112 { |
| 112 hb_glyph_info_t *info = &infos[i]; | 113 hb_glyph_info_t *info = &infos[i]; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 123 } | 124 } |
| 124 | 125 |
| 125 hb_buffer_destroy (buffer); | 126 hb_buffer_destroy (buffer); |
| 126 hb_font_destroy (font); | 127 hb_font_destroy (font); |
| 127 hb_face_destroy (face); | 128 hb_face_destroy (face); |
| 128 | 129 |
| 129 return 0; | 130 return 0; |
| 130 } | 131 } |
| 131 | 132 |
| 132 | 133 |
| OLD | NEW |