use of org.apache.poi.hwpf.model.OldFontTable in project poi by apache.
the class TestHWPFOldDocument method testOldFontTableEncoding.
@Test
public void testOldFontTableEncoding() throws IOException {
HWPFOldDocument doc = HWPFTestDataSamples.openOldSampleFile("Bug51944.doc");
OldFontTable oldFontTable = doc.getOldFontTable();
assertEquals(5, oldFontTable.getFontNames().length);
assertEquals("細明體", oldFontTable.getFontNames()[0].getMainFontName());
assertEquals(HwmfFont.WmfCharset.CHINESEBIG5_CHARSET.getCharset(), Charset.forName("Big5"));
assertEquals("Times New Roman", oldFontTable.getFontNames()[1].getMainFontName());
doc.close();
}
use of org.apache.poi.hwpf.model.OldFontTable in project poi by apache.
the class TestHWPFOldDocument method testOldFontTableAltName.
@Test
public void testOldFontTableAltName() throws IOException {
HWPFOldDocument doc = HWPFTestDataSamples.openOldSampleFile("Bug60942b.doc");
OldFontTable oldFontTable = doc.getOldFontTable();
assertEquals(5, oldFontTable.getFontNames().length);
assertEquals("Roboto", oldFontTable.getFontNames()[3].getMainFontName());
assertEquals("arial", oldFontTable.getFontNames()[3].getAltFontName());
assertEquals("Roboto", oldFontTable.getFontNames()[4].getMainFontName());
assertEquals("arial", oldFontTable.getFontNames()[4].getAltFontName());
}
Aggregations