Hello POI guys,

I started using POI recently. And I ran to one interesting issue with fonts.
I have one dedicated class where I store all styles which I use in my project.
Here in this class, I also hold font. So far, I just need only one font in 
whole project.
So, I initialized this one font, only once, and stored it as a class variable.
And then I used this font in all style's initializations.
Surprisingly it stared causes quite unpredictable behavior. In some sheets it 
works with any problems, but in some other issues occurred.
For example, I have a table with several rows. And I wanted to have every 
second row with a different background color. So, I used a different style for 
each row. But sometimes it was reflected and sometimes not. And it behaves 
unpredictable (in some cases it works without any issues, on others not).

What I did to prevent this problem, I initialized for every style his own font, 
and the problem is gone now. It works smoothly.
Is this known behavior or did I just use font wrongly ?


Peter Bušfy

Digital Service consultant


ITERA

Make a difference
---------------------
itera.com <http://www.itera.com>



Reply via email to