What steps will reproduce the problem?
1. Add a name to the fonts name table that will sort at the end of the list.
2. Save the font.
What is the expected output? What do you see instead?
Font should save but instead an Index Out of Bounds exception is thrown.
Code snippet:
FontFactory fontFactory = FontFactory.getInstance();
File fontFile = TestFont.TestFontNames.OPENSANS.getFile();
Font.Builder fontBuilder = fontFactory.loadFontsForBuilding(new FileInputStream(fontFile))[0];
NameTable.Builder nameTableBuilder = (NameTable.Builder) fontBuilder.getTableBuilder(Tag.name);
nameTableBuilder.nameBuilder(Font.PlatformId.Windows.value(),
Font.WindowsEncodingId.UnicodeUCS4.value(),
NameTable.WindowsLanguageId.Spanish_UnitedStates.value(),
NameTable.NameId.WWSSubfamilyName.value()).setName("");
Font font = fontBuilder.build(); // exception occurs here.
Original issue reported on code.google.com by stua...@google.com on 15 Jan 2013 at 11:26
Original issue reported on code.google.com by
stua...@google.com
on 15 Jan 2013 at 11:26