Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import static org.junit.jupiter.api.Assertions.fail;

import java.io.IOException;
import java.io.InputStream;

import org.apache.fontbox.ttf.gsub.GSUBTablePrintUtil;
import org.apache.fontbox.ttf.model.GsubData;
Expand All @@ -39,10 +40,10 @@ public class GSUBTableDebugger
@Test
void printLohitBengaliTTF()
{
try
try(InputStream is1 = GSUBTableDebugger.class.getResourceAsStream(LOHIT_BENGALI_FONT_FILE);
InputStream is2 = GSUBTableDebugger.class.getResourceAsStream(LOHIT_BENGALI_FONT_FILE))
{
RandomAccessReadBuffer randomAccessReadBuffer = new RandomAccessReadBuffer(
GSUBTableDebugger.class.getResourceAsStream(LOHIT_BENGALI_FONT_FILE));
RandomAccessReadBuffer randomAccessReadBuffer = new RandomAccessReadBuffer(is1);
RandomAccessReadDataStream randomAccessReadBufferDataStream = new RandomAccessReadDataStream(
randomAccessReadBuffer);

Expand All @@ -53,8 +54,7 @@ void printLohitBengaliTTF()
glyphSubstitutionTable.read(null, randomAccessReadBufferDataStream);

TrueTypeFont trueTypeFont = new TTFParser()
.parse(new RandomAccessReadBuffer(
GSUBTableDebugger.class.getResourceAsStream(LOHIT_BENGALI_FONT_FILE)));
.parse(new RandomAccessReadBuffer(is2));

GsubData gsubData = glyphSubstitutionTable.getGsubData();
new GSUBTablePrintUtil().printCharacterToGlyph(gsubData,
Expand Down