font problem or wrong usage
Peter Busfy <[email protected]> Fri, 9 Sep 2022 12:34:28 +0000
| Newsgroups | gmane.comp.jakarta.poi.user |
|---|---|
| Message-ID | <AM7P189MB0776B7045BF561AFF734FB8DFD439@AM7P189MB0776.EURP189.PROD.OUTLOOK.COM> |
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>