Thanks for the fast answer, I forgot to include:
/* clean up the buffer, but don't kill it just yet */ hb_buffer_reset(buf); in the loop. (it was hb_buffer_clear(buf) in the demo). Nicolas On Apr 10, 2013, at 10:39 , Jonathan Kew wrote: > On 10/4/13 08:47, Nicolas Rougier wrote: >> >> >> I tried to compile the ex-sdl-freetype-harfbuzz example and get: >> >> Assertion failed: (buffer->content_type == >> HB_BUFFER_CONTENT_TYPE_UNICODE || (!buffer->len && >> buffer->content_type == HB_BUFFER_CONTENT_TYPE_INVALID)), function >> hb_buffer_add_utf, file hb-buffer.cc, line 914. > > You're trying to add more text to a buffer after it's been shaped (i.e. the > content has been converted from unicode character data to glyphs and > positions). You can't do that. If you want to reuse the same hb_buffer to > shape a new piece of text, you need to clear its existing (shaped) contents > first. > >> >> I'm a but clueless since I did not even understand why the text is >> coded as char (and not wchar_t). > > utf-8 has 8-bit (i.e. char-sized) code units. > >> Does anyone get the same problem ? >> >> >> Relevant info: >> >> -> gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build >> 2336.11.00) -> latest git harfbuzz >> >> >> Nicolas >> >> >> >> _______________________________________________ HarfBuzz mailing >> list [email protected] >> http://lists.freedesktop.org/mailman/listinfo/harfbuzz >> > _______________________________________________ > HarfBuzz mailing list > [email protected] > http://lists.freedesktop.org/mailman/listinfo/harfbuzz _______________________________________________ HarfBuzz mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/harfbuzz
