Ah, got it -- thanks! This indeed fixed the EOF issue. However, I'm now getting the following error: "True Type fonts using CFF outlines are not supported"
This is while reading the Noto Sans CJK Regular font file. Is this an area where FontBox 3.x functionality is more limited than FontBox 2.x was? Take care, Daniel On Mon, Feb 9, 2026 at 8:22 PM Tilman Hausherr <[email protected]> wrote: > Hi, > > Use RandomAccessReadBuffer and pass the array. > NonSeekableRandomAccessReadInputStream isn't for that. > > Tilman > > Am 09.02.2026 um 20:14 schrieb Daniel Gredler: > > Hi, > > > > I've been using FontBox 2.x for some time, and just started dipping my > toes > > into 3.x to see if it will work for me. However, I'm running into an > issue > > parsing a TTF in memory. I have a byte[], which I was wrapping in a > > ByteArrayInputStream and then passing to TTFParser.parse( ). > > > > Now it looks like I need to wrap the BAIS in > > a NonSeekableRandomAccessReadInputStream and pass that to > TTFParser.parse( > > ), but it hits EOF immediately because it looks like the length is 0 > (zero) > > when it is checked prior to any reads. Should I be doing something > > differently? > > > > ByteArrayInputStream bais = new ByteArrayInputStream(bytes); > > TTFParser parser = new TTFParser(false); > > try (NonSeekableRandomAccessReadInputStream input = new > > NonSeekableRandomAccessReadInputStream(bais); > > TrueTypeFont font = parser.parse(input)) { > > // use font here > > } > > > > Thanks! > > > > Daniel > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >

