[OpenJDK 2D-Dev] Thoughts about font implementation

2008-08-12 Thread Roman Kennke
Hi there, I have a small problem with current implementation of fonts in OpenJDK. It is required that fonts are present as files, and that all fonts are loaded via a FileChannel, not InputStream, because FreeType doesn't support loading from a sequential-only stream. From my perspective as embedde

Re: [OpenJDK 2D-Dev] Thoughts about font implementation

2008-08-12 Thread Roman Kennke
Hello again, Maybe some code helps to illustrate what I want to do. Today I implemented the most low-level pieces of it, i.e. changing TrueTypeFont and Type1Font and the corresponding native code to read from ByteBuffers. This works pretty well, and it turns out that the code gets much simpler (lo

Re: [OpenJDK 2D-Dev] Thoughts about font implementation

2008-08-12 Thread Dmitri Trembovetski
Hi Roman, just to let you know, the main font person (Phil) is out on vacation until 26th I believe so you probably won't get an answer before that.. Thanks, Dmitri Roman Kennke wrote: Hi there, I have a small problem with current implementation of fonts in OpenJDK. It is requi

Re: [OpenJDK 2D-Dev] Thoughts about font implementation

2008-08-12 Thread Igor Nekrestyanov
Yep, Phil is the one who designed font management code. I remember there were some important reasons why callback-based approach was introduced but can not recall them right now. From the top of the head i'd sugegst to check impact of such change on performance and perceived footprint scannin

Re: [OpenJDK 2D-Dev] Thoughts about font implementation

2008-08-12 Thread Roman Kennke
Hi, > Yep, Phil is the one who designed font management code. I can't wait for Phil to come back and have a look at our redesign of the FontManager related code :-) (Maybe it's not so bad that I am in holiday then .. ;-) ). But this one here is not so much about FontManager but more about the low

Re: [OpenJDK 2D-Dev] Thoughts about font implementation

2008-08-12 Thread Igor Nekrestyanov
Hi, Yep, Phil is the one who designed font management code. I can't wait for Phil to come back and have a look at our redesign of the FontManager related code :-) (Maybe it's not so bad that I am in holiday then .. ;-) ). But this one here is not so much about FontManager but more about th

Re: [OpenJDK 2D-Dev] Thoughts about font implementation

2008-08-12 Thread Roman Kennke
Hi Igor, > Anyway, i promise i'll look into this in more detail as i get some > spare > time (that is really rare these days :() Thanks alot. > >> From the top of the head i'd sugegst to check impact of such change > on > >> performance and perceived > >> footprint scanning large set of large

Re: [OpenJDK 2D-Dev] Thoughts about font implementation

2008-08-12 Thread Roman Kennke
... Here comes the promised stacktrace and example app. Exception in thread "main" java.lang.NullPointerException at sun.font.TrueTypeGlyphMapper.(TrueTypeGlyphMapper.java:62) at sun.font.TrueTypeFont.getMapper(TrueTypeFont.java:1232) at sun.font.FileFontStrike.(FileFontS

Re: [OpenJDK 2D-Dev] Thoughts about font implementation

2008-08-12 Thread Igor Nekrestyanov
Quick tests are: run Font2DTest on system that has some really large ttf/ttc files. Write simple test that iterates through all available fonts and draw one or all glyphs to bufferedimage. I wrote a simple test program that gets an array of all fonts and gets the baseline for all 0-0xf