linxingang / sfntly

Automatically exported from code.google.com/p/sfntly
0 stars 0 forks source link

loadFontsForBuilding from FileInputStream does not work correctly #1

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Sample code:

FontFactoryPtr factory = FontFactory::getInstance();
FontBuilderArray font_builder_array;
FileInputStream is;
is.open("arial.ttf");
factory->loadFontsForBuilding(&is, builders);
FontBuilderPtr font_builder = font_builder_array[0];
FontPtr font = font_builder->build();
MemoryOutputStream output_stream;
factory->serializeFont(font, &output_stream);

Expected result:
output_stream shall have same size as input file.

Actual result:
output_stream is corrupted.

Original issue reported on code.google.com by arthur...@google.com on 7 Jul 2011 at 10:48

GoogleCodeExporter commented 9 years ago
Output_stream's size shall be close, but not necessarily identical, to original 
font file since sfntly library adds paddings for each table.

Original comment by arthur...@google.com on 7 Jul 2011 at 11:00

GoogleCodeExporter commented 9 years ago

Original comment by arthur...@google.com on 12 Jul 2011 at 7:50

GoogleCodeExporter commented 9 years ago
Fixed in r8

Original comment by arthur...@google.com on 13 Jul 2011 at 12:03