You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Chris Cheshire <cc...@bigredwire.com> on 2004/06/22 01:00:10 UTC
creating fonts
If I create a font in a workbook, does it always crate a new instance of
a font, or is there some internal mechanism that keeps track of what has
been created?
For instance, if I create a font in a workbook that is Arial, 10pt,
bold, left justified does it always create a new instance of a font with
these attributes, or does it create an instance at first, and
subsequently return a reference to the previously created font in the
font table?
Chris
---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org
Re: creating fonts
Posted by Avik Sengupta <av...@itellix.com>.
Styles are always created anew, and its the application writers
responsibility to track and cache them. I would imagine font objects
behave similarly, cant be sure without checking the code.
On Tue, 2004-06-22 at 04:30, Chris Cheshire wrote:
> If I create a font in a workbook, does it always crate a new instance of
> a font, or is there some internal mechanism that keeps track of what has
> been created?
>
> For instance, if I create a font in a workbook that is Arial, 10pt,
> bold, left justified does it always create a new instance of a font with
> these attributes, or does it create an instance at first, and
> subsequently return a reference to the previously created font in the
> font table?
>
> Chris
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: poi-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org
(was creating fonts) now findFont(...)
Posted by Chris Cheshire <cc...@bigredwire.com>.
OK so I grabbed the CVS tree for poi to have a look myself and the short
answer is no, it creates a new font.
However directly underneath it is a method called findFont that is not
in the javadoc published on the web. It contains a lot of System.out
calls, so is this a work in progress? (I don't particularly want the poi
debug stuff in my log files)
Also, out of curiosity, there what is up with the index 4 in the font
table? There is code in there to skip it. Why is this?
Thanks
Chris
Chris Cheshire wrote:
> If I create a font in a workbook, does it always crate a new instance of
> a font, or is there some internal mechanism that keeps track of what has
> been created?
>
> For instance, if I create a font in a workbook that is Arial, 10pt,
> bold, left justified does it always create a new instance of a font with
> these attributes, or does it create an instance at first, and
> subsequently return a reference to the previously created font in the
> font table?
>
> Chris
>
---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org