[OpenJDK 2D-Dev] Thoughts about font implementation

Igor Nekrestyanov Igor.Nekrestyanov at Sun.COM
Tue Aug 12 20:54:24 UTC 2008


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 level Freetype loading stuff. (I
> thought that code was from you Igor? I might be wrong though).
>   
Yes, freetype glue code was written by me.
But fo IO i've used same approach as we use for t2k and this approach 
was introduced on purpose in jdk 1.5.

Anyway, i promise i'll look into this in more detail as i get some spare 
time (that is really rare these days :()
>>  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 fonts.
>>     
>
> I can do that. Any suggestions on how to do that easily? I'm not sure
> how that (FreeType) implementation works, but I know at least one font
> implementation that doesn't actually load anything until the
> corresponding glyphs are needed (also mmap-based, very handy... this is
> the code in Classpath, all Java, all nice :-D ).
>   
Both freetype and t2k do not read everything explicitly too.
However, to build list of all available fonts we have to scan some 
tables in all files.
And it will be unfortunate if process size will grew by total size of 
all fonts.

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 likely be mistaken here 
>> but on some platforms
>> (Windows) this might have noticeable negative consequences.
>>     
>
> Unfortunately, I don't have a Windows box around, and can't setup one
> easily. Windows licenses and VS licenses are too costly for my taste.
> Also, at work, some people tried to setup a build of OpenJDK on Windows
> and failed (or at least, did not succeed after 16 hours of work or so).
>   
It will be nice to hear why it does not build on Windows.
I am quite sure OpenJDK is buildable with commercial VS and
i know that some people were building it with VS Express too (with minor 
tweaks).

-igor



More information about the 2d-dev mailing list