X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fttf.cc;h=2008c1d532cbf959f121523e6f406f660e105a46;hb=5b4b0d6e9a197e8f9eb085b7c2ad78b8be3e5cfc;hp=cbd43f76f986ed8bb55f62ba0079232d6d7461d5;hpb=34090093e3f87416d4f2b247d314c6944b884755;p=lilypond.git diff --git a/lily/ttf.cc b/lily/ttf.cc index cbd43f76f9..2008c1d532 100644 --- a/lily/ttf.cc +++ b/lily/ttf.cc @@ -3,7 +3,7 @@ source file of the GNU LilyPond music typesetter - (c) 2005--2007 Han-Wen Nienhuys + (c) 2005--2008 Han-Wen Nienhuys */ #include "freetype.hh" @@ -116,7 +116,7 @@ void t42_write_table (void *out, FT_Face face, unsigned char const *buffer, size_t s, bool is_glyf, FT_ULong head_length, FT_ULong loca_length) { - vector chunks; /* FIXME: use dynamic array */ + vector chunks; if (is_glyf) { @@ -155,9 +155,7 @@ void t42_write_table (void *out, FT_Face face, unsigned char const *buffer, if (offset > last_offset + CHUNKSIZE) { if (last_chunk != last_offset) - { - chunks.push_back (last_offset - last_chunk); - } + chunks.push_back (last_offset - last_chunk); /* a single glyph with more than 64k data is a pathological case but... @@ -240,7 +238,7 @@ print_body (void *out, FT_Face face) FT_UInt idx = 0; FT_ULong head_length = 0, loca_length = 0; FT_ULong tag, length; - FT_ULong lengths[100], tags[100]; /* FIXME: use dynamic arrays */ + vector lengths, tags; /* we must build our own TTF header -- the original font @@ -250,13 +248,13 @@ print_body (void *out, FT_Face face) while (FT_Sfnt_Table_Info (face, idx, &tag, &length) != FT_Err_Table_Missing) { - assert (idx < 100); /* FIXME: only for static arrays */ - lengths[idx] = length; - tags[idx ++] = tag; + lengths.push_back (length); + tags.push_back (tag); if (tag == head_tag) head_length = length; else if (tag == loca_tag) loca_length = length; + idx ++; } FT_ULong hlength = 12 + 16 * idx;