You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Bret Hart <im...@yahoo.com> on 2004/10/23 18:22:27 UTC

Autosizing question:

Autosizing question:

Hello, is there a way to autosize the specified column
in POI? Since VBA have this function to autosize
columns, I wonder if POI have, if not, I have to
setsize for each column, I think it would waste a lot
of resource right? Thanks


		
_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org


Re: Autosizing question:

Posted by Daniel Noll <da...@nuix.com>.
David Fisher wrote:
> Maybe it is time to have a PPT to FOP translator.

I trust that you mean PPT to XSL-FO.  It would be a tragedy if FOP were 
the only processor able to open the resulting file.

The thing is, XSL-FO is really a layout format whereas PPT is really a 
per-page graphics format.  I'm sure it *can* be translated to XSL-FO, 
but I'm not certain that it's the most suited format.  (SVG with one 
page per file may even be better.)

Daniel

-- 
Daniel Noll

Nuix Pty Ltd
Suite 79, 89 Jones St, Ultimo NSW 2007, Australia    Ph: +61 2 9280 0699
Web: http://nuix.com/                               Fax: +61 2 9212 6902

This message is intended only for the named recipient. If you are not
the intended recipient you are notified that disclosing, copying,
distributing or taking any action in reliance on the contents of this
message or attachment is strictly prohibited.

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/


Re: Autosizing question:

Posted by David Fisher <df...@jmlafferty.com>.
Maybe it is time to have a PPT to FOP translator.

Yegor has done Postscript to Escher Drawing conversion for me  
including fonts it is not perfect but his current efforts are a lot  
better than his first one.

Yegor has HSLF reorganization to do, but PPT -> FOP for PDF, SVG, etc  
is on my development list. Q2 - Q3 time frame.

Yegor?

Regards,
Dave Fisher

On Jan 24, 2007, at 4:28 PM, Daniel Noll wrote:

> Andrew C. Oliver wrote:
>> Its actually more compounded than that.  You can basically do this  
>> with
>> Java's AWT Font/FontMetrics classes but the sizes are incompatible  
>> with
>> Windows fonts (let alone Mac et al).  Someone has to record the  
>> data for
>> Windows fonts and or an API that reads the font files and  
>> calculates them.
>
> Well, the FOP project has a TTFReader already... maybe it's time  
> for them to push all that into a font-commons package so that POI  
> can depend on it. :-)
>
> Daniel
>
>
> -- 
> Daniel Noll
>
> Nuix Pty Ltd
> Suite 79, 89 Jones St, Ultimo NSW 2007, Australia    Ph: +61 2 9280  
> 0699
> Web: http://nuix.com/                               Fax: +61 2 9212  
> 6902
>
> This message is intended only for the named recipient. If you are not
> the intended recipient you are notified that disclosing, copying,
> distributing or taking any action in reliance on the contents of this
> message or attachment is strictly prohibited.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/


Re: Autosizing question:

Posted by Daniel Noll <da...@nuix.com>.
Andrew C. Oliver wrote:
> Its actually more compounded than that.  You can basically do this with
> Java's AWT Font/FontMetrics classes but the sizes are incompatible with
> Windows fonts (let alone Mac et al).  Someone has to record the data for
> Windows fonts and or an API that reads the font files and calculates them.

Well, the FOP project has a TTFReader already... maybe it's time for 
them to push all that into a font-commons package so that POI can depend 
on it. :-)

Daniel


-- 
Daniel Noll

Nuix Pty Ltd
Suite 79, 89 Jones St, Ultimo NSW 2007, Australia    Ph: +61 2 9280 0699
Web: http://nuix.com/                               Fax: +61 2 9212 6902

This message is intended only for the named recipient. If you are not
the intended recipient you are notified that disclosing, copying,
distributing or taking any action in reliance on the contents of this
message or attachment is strictly prohibited.

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/


RE: Re[6]: Autosizing question:

Posted by Tahir Akhtar <ta...@spectrum-tech.com>.
BTW I have spotted a "Standard Font" option in MS Excel Tools-> Options
[General Tab]. Changing this setting requires restarting excel. After
changes take effect the default column widths are adjusted for new settings.

So default font can be other than arial/12

Wassalam
Tahir
-----Original Message-----
From: Yegor Kozlov [mailto:yegor@dinom.ru] 
Sent: Thursday, January 25, 2007 5:30 PM
To: POI Users List
Subject: Re[6]: Autosizing question:


TA> Any other guess while we search for definite answer?

I would stick to "a". Looks most natural choice to me.
Even if it is not "a", the algorithm for width calculation will be
pretty close to Excel.

So the implementation plan gets more concrete:
 - get the number of characters for the default column width (default
 is 8)
 - get the default font (Arial)
 - compute width of the surrogate string "aaaaaaaa" using Java2D classes
 (java.awt.font.TextLayout).
 - derive a coefficient to translate 1/256th units to pixels.

 autosizing:
 - compute max(width) of the column cells using Java2D, translate it to
 1/256th units and resize the column.


Yegor

TA> -----Original Message-----
TA> From: Yegor Kozlov [mailto:yegor@dinom.ru] 
TA> Sent: Thursday, January 25, 2007 4:34 PM
TA> To: POI Users List
TA> Subject: Re[4]: Autosizing question:

TA>> I would love if you can elaborate a bit on "units of 1/256th of a
TA> character
TA>> width of the default font". Is the default font is system specific or
TA> same
TA>> across excel versions/platforms?

TA> The default font is workbook-specific.  You can get is as follows:

TA> HSSFFont font = workbook.getFontAt((short)0);
TA> There is always one with index 0. On Windows the default is Arial.

TA>> Is a specific character is used for width
TA>> calculation or we assume fixed width fonts?

TA> I don't know. Arial is default and it is a proportional font and the
glyphs
TA> have different
TA> width. The phrase "1/256th of a character  width of the default font"
TA> is taken from the xls format spec. It says nothing about the
TA> used characters.

TA> Yegor

TA>> Wassalam
TA>> Tahir

TA>> -----Original Message-----
TA>> From: Yegor Kozlov [mailto:yegor@dinom.ru] 
TA>> Sent: Thursday, January 25, 2007 3:19 PM
TA>> To: POI Users List
TA>> Subject: Re[2]: Autosizing question:

TA>> Aha! Thank you for the link.

TA>> I think user's DPI is not an issue for autosizing.

TA>> Column width in Excel is expressed in units of 1/256th of a character
TA> width
TA>> of the default font.
TA>> In theory, if you calculate width of text and translate it to the XLS
TA>> units then the column width should not depend on client's DPI.

TA>>  A simple experiment to do: create an xls file, autosize a column and
TA>> try to view it on a system with a different DPI.

TA>> Regards,
TA>> Yegor


TA>>> I guess the issue is not in the font sizes but the screen dpi
TA>> calculation.
TA>>> Net result is if you render some text in "Ariel, 12" it will appear
TA>> smaller
TA>>> on screen as compared to same text & font rendered by windows
natively.
TA>> See
TA>>> this bug report (and related bug 4016591) for details:
TA>>> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4168757 . 

TA>>> Wassalam
TA>>> Tahir

TA>>> -----Original Message-----
TA>>> From: Yegor Kozlov [mailto:yegor@dinom.ru] 
TA>>> Sent: Thursday, January 25, 2007 2:28 PM
TA>>> To: POI Users List
TA>>> Subject: Re[2]: Autosizing question:

TA>>> Are you sure the Java's font sizes are incompatible with Windows
fonts?
TA>>> Could you point me to the source of this information? I plan to add
TA>>> drawing capabilities to HSLF and this stuff is important to me.

TA>>> Regards,
TA>>> Yegor

ACO>>>> Its actually more compounded than that.  You can basically do this
TA>> with
ACO>>>> Java's AWT Font/FontMetrics classes but the sizes are incompatible
TA>> with
ACO>>>> Windows fonts (let alone Mac et al).  Someone has to record the data
TA>>> for
ACO>>>> Windows fonts and or an API that reads the font files and calculates
TA>>> them.

ACO>>>> -Andy

ACO>>>> Avik Sengupta wrote:
>>>>>> Since VBA have this function to autosize
>>>>>>     
>>>>>>> columns, I wonder if POI have
>>>>>>>       
>>>>>
>>>>> POI is not, and was never meant to be, a replacement for VBA. Its a
TA> file

>>>>> format reader/writer. To do autosizing, one needs a fontmetrics 
>>>>> implementation. We're yet find one that is useful and easy enuf to
use.

>>>>>
>>>>> However, as a frequently requested feature, its a ripe oppurtunity for

>>>>> contribution :)
>>>>>
>>>>> Regards
>>>>> -
>>>>> Avik
>>>>>
>>>>> On Wednesday 24 January 2007 17:36, Adelbert Groebbens wrote:
>>>>>   
>>>>>>> Autosizing question:
>>>>>>>
>>>>>>> Hello, is there a way to autosize the specified column
>>>>>>> in POI? Since VBA have this function to autosize
>>>>>>> columns, I wonder if POI have, if not, I have to
>>>>>>> setsize for each column, I think it would waste a lot
>>>>>>> of resource right? Thanks
>>>>>>>       
>>>>>> I'm facing the same problem.
>>>>>>
>>>>>> Did you find a solution?
>>>>>>
>>>>>> Bret Hart <im2heat <at> yahoo.com> writes:
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
>>>>>> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
>>>>>> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/
>>>>>>     
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
>>>>> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
>>>>> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/
>>>>>
>>>>>
>>>>>
>>>>>   


TA>>> ---------------------------------------------------------------------
TA>>> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
TA>>> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
TA>>> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/




TA>>> ---------------------------------------------------------------------
TA>>> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
TA>>> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
TA>>> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/


TA>> ---------------------------------------------------------------------
TA>> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
TA>> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
TA>> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/




TA>> ---------------------------------------------------------------------
TA>> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
TA>> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
TA>> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/


TA> ---------------------------------------------------------------------
TA> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
TA> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
TA> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/




TA> ---------------------------------------------------------------------
TA> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
TA> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
TA> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/




---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/


Re[6]: Autosizing question:

Posted by Yegor Kozlov <ye...@dinom.ru>.
TA> Any other guess while we search for definite answer?

I would stick to "a". Looks most natural choice to me.
Even if it is not "a", the algorithm for width calculation will be
pretty close to Excel.

So the implementation plan gets more concrete:
 - get the number of characters for the default column width (default
 is 8)
 - get the default font (Arial)
 - compute width of the surrogate string "aaaaaaaa" using Java2D classes
 (java.awt.font.TextLayout).
 - derive a coefficient to translate 1/256th units to pixels.

 autosizing:
 - compute max(width) of the column cells using Java2D, translate it to
 1/256th units and resize the column.


Yegor

TA> -----Original Message-----
TA> From: Yegor Kozlov [mailto:yegor@dinom.ru] 
TA> Sent: Thursday, January 25, 2007 4:34 PM
TA> To: POI Users List
TA> Subject: Re[4]: Autosizing question:

TA>> I would love if you can elaborate a bit on "units of 1/256th of a
TA> character
TA>> width of the default font". Is the default font is system specific or
TA> same
TA>> across excel versions/platforms?

TA> The default font is workbook-specific.  You can get is as follows:

TA> HSSFFont font = workbook.getFontAt((short)0);
TA> There is always one with index 0. On Windows the default is Arial.

TA>> Is a specific character is used for width
TA>> calculation or we assume fixed width fonts?

TA> I don't know. Arial is default and it is a proportional font and the glyphs
TA> have different
TA> width. The phrase "1/256th of a character  width of the default font"
TA> is taken from the xls format spec. It says nothing about the
TA> used characters.

TA> Yegor

TA>> Wassalam
TA>> Tahir

TA>> -----Original Message-----
TA>> From: Yegor Kozlov [mailto:yegor@dinom.ru] 
TA>> Sent: Thursday, January 25, 2007 3:19 PM
TA>> To: POI Users List
TA>> Subject: Re[2]: Autosizing question:

TA>> Aha! Thank you for the link.

TA>> I think user's DPI is not an issue for autosizing.

TA>> Column width in Excel is expressed in units of 1/256th of a character
TA> width
TA>> of the default font.
TA>> In theory, if you calculate width of text and translate it to the XLS
TA>> units then the column width should not depend on client's DPI.

TA>>  A simple experiment to do: create an xls file, autosize a column and
TA>> try to view it on a system with a different DPI.

TA>> Regards,
TA>> Yegor


TA>>> I guess the issue is not in the font sizes but the screen dpi
TA>> calculation.
TA>>> Net result is if you render some text in "Ariel, 12" it will appear
TA>> smaller
TA>>> on screen as compared to same text & font rendered by windows natively.
TA>> See
TA>>> this bug report (and related bug 4016591) for details:
TA>>> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4168757 . 

TA>>> Wassalam
TA>>> Tahir

TA>>> -----Original Message-----
TA>>> From: Yegor Kozlov [mailto:yegor@dinom.ru] 
TA>>> Sent: Thursday, January 25, 2007 2:28 PM
TA>>> To: POI Users List
TA>>> Subject: Re[2]: Autosizing question:

TA>>> Are you sure the Java's font sizes are incompatible with Windows fonts?
TA>>> Could you point me to the source of this information? I plan to add
TA>>> drawing capabilities to HSLF and this stuff is important to me.

TA>>> Regards,
TA>>> Yegor

ACO>>>> Its actually more compounded than that.  You can basically do this
TA>> with
ACO>>>> Java's AWT Font/FontMetrics classes but the sizes are incompatible
TA>> with
ACO>>>> Windows fonts (let alone Mac et al).  Someone has to record the data
TA>>> for
ACO>>>> Windows fonts and or an API that reads the font files and calculates
TA>>> them.

ACO>>>> -Andy

ACO>>>> Avik Sengupta wrote:
>>>>>> Since VBA have this function to autosize
>>>>>>     
>>>>>>> columns, I wonder if POI have
>>>>>>>       
>>>>>
>>>>> POI is not, and was never meant to be, a replacement for VBA. Its a
TA> file

>>>>> format reader/writer. To do autosizing, one needs a fontmetrics 
>>>>> implementation. We're yet find one that is useful and easy enuf to use.

>>>>>
>>>>> However, as a frequently requested feature, its a ripe oppurtunity for 
>>>>> contribution :)
>>>>>
>>>>> Regards
>>>>> -
>>>>> Avik
>>>>>
>>>>> On Wednesday 24 January 2007 17:36, Adelbert Groebbens wrote:
>>>>>   
>>>>>>> Autosizing question:
>>>>>>>
>>>>>>> Hello, is there a way to autosize the specified column
>>>>>>> in POI? Since VBA have this function to autosize
>>>>>>> columns, I wonder if POI have, if not, I have to
>>>>>>> setsize for each column, I think it would waste a lot
>>>>>>> of resource right? Thanks
>>>>>>>       
>>>>>> I'm facing the same problem.
>>>>>>
>>>>>> Did you find a solution?
>>>>>>
>>>>>> Bret Hart <im2heat <at> yahoo.com> writes:
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
>>>>>> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
>>>>>> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/
>>>>>>     
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
>>>>> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
>>>>> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/
>>>>>
>>>>>
>>>>>
>>>>>   


TA>>> ---------------------------------------------------------------------
TA>>> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
TA>>> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
TA>>> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/




TA>>> ---------------------------------------------------------------------
TA>>> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
TA>>> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
TA>>> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/


TA>> ---------------------------------------------------------------------
TA>> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
TA>> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
TA>> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/




TA>> ---------------------------------------------------------------------
TA>> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
TA>> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
TA>> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/


TA> ---------------------------------------------------------------------
TA> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
TA> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
TA> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/




TA> ---------------------------------------------------------------------
TA> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
TA> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
TA> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/


RE: Re[4]: Autosizing question:

Posted by Tahir Akhtar <ta...@spectrum-tech.com>.
> I don't know. Arial is default and it is a proportional font and the
glyphs have different
> width. The phrase "1/256th of a character  width of the default font"
>is taken from the xls format spec. It says nothing about the
>used characters.
After doing a small experiment in excel, my guess is that it uses width of
character "a". I assumed that there only few possible meanings of character
width of default font
1. Width of first character i-e "a"
2. Width of widest character (ruled out through experimentation, character m
is wider than character a in arial but cannot fit)
3. Average width of characters (I think this will not yield any practical
value if implemented so ruled out through guesswork)

Any other guess while we search for definite answer?

Wassalam
Tahir


-----Original Message-----
From: Yegor Kozlov [mailto:yegor@dinom.ru] 
Sent: Thursday, January 25, 2007 4:34 PM
To: POI Users List
Subject: Re[4]: Autosizing question:

TA> I would love if you can elaborate a bit on "units of 1/256th of a
character
TA> width of the default font". Is the default font is system specific or
same
TA> across excel versions/platforms?

The default font is workbook-specific.  You can get is as follows:

HSSFFont font = workbook.getFontAt((short)0);
There is always one with index 0. On Windows the default is Arial.

TA> Is a specific character is used for width
TA> calculation or we assume fixed width fonts?

I don't know. Arial is default and it is a proportional font and the glyphs
have different
width. The phrase "1/256th of a character  width of the default font"
is taken from the xls format spec. It says nothing about the
used characters.

Yegor

TA> Wassalam
TA> Tahir

TA> -----Original Message-----
TA> From: Yegor Kozlov [mailto:yegor@dinom.ru] 
TA> Sent: Thursday, January 25, 2007 3:19 PM
TA> To: POI Users List
TA> Subject: Re[2]: Autosizing question:

TA> Aha! Thank you for the link.

TA> I think user's DPI is not an issue for autosizing.

TA> Column width in Excel is expressed in units of 1/256th of a character
width
TA> of the default font.
TA> In theory, if you calculate width of text and translate it to the XLS
TA> units then the column width should not depend on client's DPI.

TA>  A simple experiment to do: create an xls file, autosize a column and
TA> try to view it on a system with a different DPI.

TA> Regards,
TA> Yegor


TA>> I guess the issue is not in the font sizes but the screen dpi
TA> calculation.
TA>> Net result is if you render some text in "Ariel, 12" it will appear
TA> smaller
TA>> on screen as compared to same text & font rendered by windows natively.
TA> See
TA>> this bug report (and related bug 4016591) for details:
TA>> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4168757 . 

TA>> Wassalam
TA>> Tahir

TA>> -----Original Message-----
TA>> From: Yegor Kozlov [mailto:yegor@dinom.ru] 
TA>> Sent: Thursday, January 25, 2007 2:28 PM
TA>> To: POI Users List
TA>> Subject: Re[2]: Autosizing question:

TA>> Are you sure the Java's font sizes are incompatible with Windows fonts?
TA>> Could you point me to the source of this information? I plan to add
TA>> drawing capabilities to HSLF and this stuff is important to me.

TA>> Regards,
TA>> Yegor

ACO>>> Its actually more compounded than that.  You can basically do this
TA> with
ACO>>> Java's AWT Font/FontMetrics classes but the sizes are incompatible
TA> with
ACO>>> Windows fonts (let alone Mac et al).  Someone has to record the data
TA>> for
ACO>>> Windows fonts and or an API that reads the font files and calculates
TA>> them.

ACO>>> -Andy

ACO>>> Avik Sengupta wrote:
>>>>> Since VBA have this function to autosize
>>>>>     
>>>>>> columns, I wonder if POI have
>>>>>>       
>>>>
>>>> POI is not, and was never meant to be, a replacement for VBA. Its a
file

>>>> format reader/writer. To do autosizing, one needs a fontmetrics 
>>>> implementation. We're yet find one that is useful and easy enuf to use.

>>>>
>>>> However, as a frequently requested feature, its a ripe oppurtunity for 
>>>> contribution :)
>>>>
>>>> Regards
>>>> -
>>>> Avik
>>>>
>>>> On Wednesday 24 January 2007 17:36, Adelbert Groebbens wrote:
>>>>   
>>>>>> Autosizing question:
>>>>>>
>>>>>> Hello, is there a way to autosize the specified column
>>>>>> in POI? Since VBA have this function to autosize
>>>>>> columns, I wonder if POI have, if not, I have to
>>>>>> setsize for each column, I think it would waste a lot
>>>>>> of resource right? Thanks
>>>>>>       
>>>>> I'm facing the same problem.
>>>>>
>>>>> Did you find a solution?
>>>>>
>>>>> Bret Hart <im2heat <at> yahoo.com> writes:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
>>>>> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
>>>>> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/
>>>>>     
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
>>>> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
>>>> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/
>>>>
>>>>
>>>>
>>>>   


TA>> ---------------------------------------------------------------------
TA>> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
TA>> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
TA>> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/




TA>> ---------------------------------------------------------------------
TA>> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
TA>> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
TA>> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/


TA> ---------------------------------------------------------------------
TA> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
TA> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
TA> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/




TA> ---------------------------------------------------------------------
TA> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
TA> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
TA> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/




---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/


Re[4]: Autosizing question:

Posted by Yegor Kozlov <ye...@dinom.ru>.
TA> I would love if you can elaborate a bit on "units of 1/256th of a character
TA> width of the default font". Is the default font is system specific or same
TA> across excel versions/platforms?

The default font is workbook-specific.  You can get is as follows:

HSSFFont font = workbook.getFontAt((short)0);
There is always one with index 0. On Windows the default is Arial.

TA> Is a specific character is used for width
TA> calculation or we assume fixed width fonts?

I don't know. Arial is default and it is a proportional font and the glyphs have different
width. The phrase "1/256th of a character  width of the default font"
is taken from the xls format spec. It says nothing about the
used characters.

Yegor

TA> Wassalam
TA> Tahir

TA> -----Original Message-----
TA> From: Yegor Kozlov [mailto:yegor@dinom.ru] 
TA> Sent: Thursday, January 25, 2007 3:19 PM
TA> To: POI Users List
TA> Subject: Re[2]: Autosizing question:

TA> Aha! Thank you for the link.

TA> I think user's DPI is not an issue for autosizing.

TA> Column width in Excel is expressed in units of 1/256th of a character width
TA> of the default font.
TA> In theory, if you calculate width of text and translate it to the XLS
TA> units then the column width should not depend on client's DPI.

TA>  A simple experiment to do: create an xls file, autosize a column and
TA> try to view it on a system with a different DPI.

TA> Regards,
TA> Yegor


TA>> I guess the issue is not in the font sizes but the screen dpi
TA> calculation.
TA>> Net result is if you render some text in "Ariel, 12" it will appear
TA> smaller
TA>> on screen as compared to same text & font rendered by windows natively.
TA> See
TA>> this bug report (and related bug 4016591) for details:
TA>> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4168757 . 

TA>> Wassalam
TA>> Tahir

TA>> -----Original Message-----
TA>> From: Yegor Kozlov [mailto:yegor@dinom.ru] 
TA>> Sent: Thursday, January 25, 2007 2:28 PM
TA>> To: POI Users List
TA>> Subject: Re[2]: Autosizing question:

TA>> Are you sure the Java's font sizes are incompatible with Windows fonts?
TA>> Could you point me to the source of this information? I plan to add
TA>> drawing capabilities to HSLF and this stuff is important to me.

TA>> Regards,
TA>> Yegor

ACO>>> Its actually more compounded than that.  You can basically do this
TA> with
ACO>>> Java's AWT Font/FontMetrics classes but the sizes are incompatible
TA> with
ACO>>> Windows fonts (let alone Mac et al).  Someone has to record the data
TA>> for
ACO>>> Windows fonts and or an API that reads the font files and calculates
TA>> them.

ACO>>> -Andy

ACO>>> Avik Sengupta wrote:
>>>>> Since VBA have this function to autosize
>>>>>     
>>>>>> columns, I wonder if POI have
>>>>>>       
>>>>
>>>> POI is not, and was never meant to be, a replacement for VBA. Its a file

>>>> format reader/writer. To do autosizing, one needs a fontmetrics 
>>>> implementation. We're yet find one that is useful and easy enuf to use. 
>>>>
>>>> However, as a frequently requested feature, its a ripe oppurtunity for 
>>>> contribution :)
>>>>
>>>> Regards
>>>> -
>>>> Avik
>>>>
>>>> On Wednesday 24 January 2007 17:36, Adelbert Groebbens wrote:
>>>>   
>>>>>> Autosizing question:
>>>>>>
>>>>>> Hello, is there a way to autosize the specified column
>>>>>> in POI? Since VBA have this function to autosize
>>>>>> columns, I wonder if POI have, if not, I have to
>>>>>> setsize for each column, I think it would waste a lot
>>>>>> of resource right? Thanks
>>>>>>       
>>>>> I'm facing the same problem.
>>>>>
>>>>> Did you find a solution?
>>>>>
>>>>> Bret Hart <im2heat <at> yahoo.com> writes:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
>>>>> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
>>>>> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/
>>>>>     
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
>>>> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
>>>> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/
>>>>
>>>>
>>>>
>>>>   


TA>> ---------------------------------------------------------------------
TA>> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
TA>> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
TA>> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/




TA>> ---------------------------------------------------------------------
TA>> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
TA>> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
TA>> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/


TA> ---------------------------------------------------------------------
TA> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
TA> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
TA> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/




TA> ---------------------------------------------------------------------
TA> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
TA> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
TA> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/


RE: Re[2]: Autosizing question:

Posted by Tahir Akhtar <ta...@spectrum-tech.com>.
I agree that the DPI issue is not relevant in auto-sizing context as it is
only a rendering issue. For auto-sizing we only need font sizes for
calculation purpose (we are not doing any rendering in Java). Now we have to
see whether Andy was referring to same issue or something else.

I would love if you can elaborate a bit on "units of 1/256th of a character
width of the default font". Is the default font is system specific or same
across excel versions/platforms? Is a specific character is used for width
calculation or we assume fixed width fonts?

Wassalam
Tahir

-----Original Message-----
From: Yegor Kozlov [mailto:yegor@dinom.ru] 
Sent: Thursday, January 25, 2007 3:19 PM
To: POI Users List
Subject: Re[2]: Autosizing question:

Aha! Thank you for the link.

I think user's DPI is not an issue for autosizing.

Column width in Excel is expressed in units of 1/256th of a character width
of the default font.
In theory, if you calculate width of text and translate it to the XLS
units then the column width should not depend on client's DPI.

 A simple experiment to do: create an xls file, autosize a column and
try to view it on a system with a different DPI.

Regards,
Yegor


TA> I guess the issue is not in the font sizes but the screen dpi
calculation.
TA> Net result is if you render some text in "Ariel, 12" it will appear
smaller
TA> on screen as compared to same text & font rendered by windows natively.
See
TA> this bug report (and related bug 4016591) for details:
TA> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4168757 . 

TA> Wassalam
TA> Tahir

TA> -----Original Message-----
TA> From: Yegor Kozlov [mailto:yegor@dinom.ru] 
TA> Sent: Thursday, January 25, 2007 2:28 PM
TA> To: POI Users List
TA> Subject: Re[2]: Autosizing question:

TA> Are you sure the Java's font sizes are incompatible with Windows fonts?
TA> Could you point me to the source of this information? I plan to add
TA> drawing capabilities to HSLF and this stuff is important to me.

TA> Regards,
TA> Yegor

ACO>> Its actually more compounded than that.  You can basically do this
with
ACO>> Java's AWT Font/FontMetrics classes but the sizes are incompatible
with
ACO>> Windows fonts (let alone Mac et al).  Someone has to record the data
TA> for
ACO>> Windows fonts and or an API that reads the font files and calculates
TA> them.

ACO>> -Andy

ACO>> Avik Sengupta wrote:
>>>> Since VBA have this function to autosize
>>>>     
>>>>> columns, I wonder if POI have
>>>>>       
>>>
>>> POI is not, and was never meant to be, a replacement for VBA. Its a file

>>> format reader/writer. To do autosizing, one needs a fontmetrics 
>>> implementation. We're yet find one that is useful and easy enuf to use. 
>>>
>>> However, as a frequently requested feature, its a ripe oppurtunity for 
>>> contribution :)
>>>
>>> Regards
>>> -
>>> Avik
>>>
>>> On Wednesday 24 January 2007 17:36, Adelbert Groebbens wrote:
>>>   
>>>>> Autosizing question:
>>>>>
>>>>> Hello, is there a way to autosize the specified column
>>>>> in POI? Since VBA have this function to autosize
>>>>> columns, I wonder if POI have, if not, I have to
>>>>> setsize for each column, I think it would waste a lot
>>>>> of resource right? Thanks
>>>>>       
>>>> I'm facing the same problem.
>>>>
>>>> Did you find a solution?
>>>>
>>>> Bret Hart <im2heat <at> yahoo.com> writes:
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
>>>> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
>>>> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/
>>>>     
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
>>> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
>>> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/
>>>
>>>
>>>
>>>   


TA> ---------------------------------------------------------------------
TA> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
TA> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
TA> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/




TA> ---------------------------------------------------------------------
TA> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
TA> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
TA> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/




---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/


Re[2]: Autosizing question:

Posted by Yegor Kozlov <ye...@dinom.ru>.
Aha! Thank you for the link.

I think user's DPI is not an issue for autosizing.

Column width in Excel is expressed in units of 1/256th of a character width of the default font.
In theory, if you calculate width of text and translate it to the XLS
units then the column width should not depend on client's DPI.

 A simple experiment to do: create an xls file, autosize a column and
try to view it on a system with a different DPI.

Regards,
Yegor


TA> I guess the issue is not in the font sizes but the screen dpi calculation.
TA> Net result is if you render some text in "Ariel, 12" it will appear smaller
TA> on screen as compared to same text & font rendered by windows natively. See
TA> this bug report (and related bug 4016591) for details:
TA> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4168757 . 

TA> Wassalam
TA> Tahir

TA> -----Original Message-----
TA> From: Yegor Kozlov [mailto:yegor@dinom.ru] 
TA> Sent: Thursday, January 25, 2007 2:28 PM
TA> To: POI Users List
TA> Subject: Re[2]: Autosizing question:

TA> Are you sure the Java's font sizes are incompatible with Windows fonts?
TA> Could you point me to the source of this information? I plan to add
TA> drawing capabilities to HSLF and this stuff is important to me.

TA> Regards,
TA> Yegor

ACO>> Its actually more compounded than that.  You can basically do this with
ACO>> Java's AWT Font/FontMetrics classes but the sizes are incompatible with
ACO>> Windows fonts (let alone Mac et al).  Someone has to record the data
TA> for
ACO>> Windows fonts and or an API that reads the font files and calculates
TA> them.

ACO>> -Andy

ACO>> Avik Sengupta wrote:
>>>> Since VBA have this function to autosize
>>>>     
>>>>> columns, I wonder if POI have
>>>>>       
>>>
>>> POI is not, and was never meant to be, a replacement for VBA. Its a file 
>>> format reader/writer. To do autosizing, one needs a fontmetrics 
>>> implementation. We're yet find one that is useful and easy enuf to use. 
>>>
>>> However, as a frequently requested feature, its a ripe oppurtunity for 
>>> contribution :)
>>>
>>> Regards
>>> -
>>> Avik
>>>
>>> On Wednesday 24 January 2007 17:36, Adelbert Groebbens wrote:
>>>   
>>>>> Autosizing question:
>>>>>
>>>>> Hello, is there a way to autosize the specified column
>>>>> in POI? Since VBA have this function to autosize
>>>>> columns, I wonder if POI have, if not, I have to
>>>>> setsize for each column, I think it would waste a lot
>>>>> of resource right? Thanks
>>>>>       
>>>> I'm facing the same problem.
>>>>
>>>> Did you find a solution?
>>>>
>>>> Bret Hart <im2heat <at> yahoo.com> writes:
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
>>>> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
>>>> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/
>>>>     
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
>>> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
>>> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/
>>>
>>>
>>>
>>>   


TA> ---------------------------------------------------------------------
TA> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
TA> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
TA> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/




TA> ---------------------------------------------------------------------
TA> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
TA> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
TA> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/


RE: Autosizing question:

Posted by Tahir Akhtar <ta...@spectrum-tech.com>.
I guess the issue is not in the font sizes but the screen dpi calculation.
Net result is if you render some text in "Ariel, 12" it will appear smaller
on screen as compared to same text & font rendered by windows natively. See
this bug report (and related bug 4016591) for details:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4168757 . 

Wassalam
Tahir

-----Original Message-----
From: Yegor Kozlov [mailto:yegor@dinom.ru] 
Sent: Thursday, January 25, 2007 2:28 PM
To: POI Users List
Subject: Re[2]: Autosizing question:

Are you sure the Java's font sizes are incompatible with Windows fonts?
Could you point me to the source of this information? I plan to add
drawing capabilities to HSLF and this stuff is important to me.

Regards,
Yegor

ACO> Its actually more compounded than that.  You can basically do this with
ACO> Java's AWT Font/FontMetrics classes but the sizes are incompatible with
ACO> Windows fonts (let alone Mac et al).  Someone has to record the data
for
ACO> Windows fonts and or an API that reads the font files and calculates
them.

ACO> -Andy

ACO> Avik Sengupta wrote:
>>> Since VBA have this function to autosize
>>>     
>>>> columns, I wonder if POI have
>>>>       
>>
>> POI is not, and was never meant to be, a replacement for VBA. Its a file 
>> format reader/writer. To do autosizing, one needs a fontmetrics 
>> implementation. We're yet find one that is useful and easy enuf to use. 
>>
>> However, as a frequently requested feature, its a ripe oppurtunity for 
>> contribution :)
>>
>> Regards
>> -
>> Avik
>>
>> On Wednesday 24 January 2007 17:36, Adelbert Groebbens wrote:
>>   
>>>> Autosizing question:
>>>>
>>>> Hello, is there a way to autosize the specified column
>>>> in POI? Since VBA have this function to autosize
>>>> columns, I wonder if POI have, if not, I have to
>>>> setsize for each column, I think it would waste a lot
>>>> of resource right? Thanks
>>>>       
>>> I'm facing the same problem.
>>>
>>> Did you find a solution?
>>>
>>> Bret Hart <im2heat <at> yahoo.com> writes:
>>>
>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
>>> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
>>> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/
>>>     
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
>> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
>> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/
>>
>>
>>
>>   


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/




---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/


Re[2]: Autosizing question:

Posted by Yegor Kozlov <ye...@dinom.ru>.
Are you sure the Java's font sizes are incompatible with Windows fonts?
Could you point me to the source of this information? I plan to add
drawing capabilities to HSLF and this stuff is important to me.

Regards,
Yegor

ACO> Its actually more compounded than that.  You can basically do this with
ACO> Java's AWT Font/FontMetrics classes but the sizes are incompatible with
ACO> Windows fonts (let alone Mac et al).  Someone has to record the data for
ACO> Windows fonts and or an API that reads the font files and calculates them.

ACO> -Andy

ACO> Avik Sengupta wrote:
>>> Since VBA have this function to autosize
>>>     
>>>> columns, I wonder if POI have
>>>>       
>>
>> POI is not, and was never meant to be, a replacement for VBA. Its a file 
>> format reader/writer. To do autosizing, one needs a fontmetrics 
>> implementation. We're yet find one that is useful and easy enuf to use. 
>>
>> However, as a frequently requested feature, its a ripe oppurtunity for 
>> contribution :)
>>
>> Regards
>> -
>> Avik
>>
>> On Wednesday 24 January 2007 17:36, Adelbert Groebbens wrote:
>>   
>>>> Autosizing question:
>>>>
>>>> Hello, is there a way to autosize the specified column
>>>> in POI? Since VBA have this function to autosize
>>>> columns, I wonder if POI have, if not, I have to
>>>> setsize for each column, I think it would waste a lot
>>>> of resource right? Thanks
>>>>       
>>> I'm facing the same problem.
>>>
>>> Did you find a solution?
>>>
>>> Bret Hart <im2heat <at> yahoo.com> writes:
>>>
>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
>>> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
>>> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/
>>>     
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
>> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
>> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/
>>
>>
>>
>>   


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/


Re: Autosizing question:

Posted by "Andrew C. Oliver" <ac...@buni.org>.
Its actually more compounded than that.  You can basically do this with
Java's AWT Font/FontMetrics classes but the sizes are incompatible with
Windows fonts (let alone Mac et al).  Someone has to record the data for
Windows fonts and or an API that reads the font files and calculates them.

-Andy

Avik Sengupta wrote:
>> Since VBA have this function to autosize
>>     
>>> columns, I wonder if POI have
>>>       
>
> POI is not, and was never meant to be, a replacement for VBA. Its a file 
> format reader/writer. To do autosizing, one needs a fontmetrics 
> implementation. We're yet find one that is useful and easy enuf to use. 
>
> However, as a frequently requested feature, its a ripe oppurtunity for 
> contribution :)
>
> Regards
> -
> Avik
>
> On Wednesday 24 January 2007 17:36, Adelbert Groebbens wrote:
>   
>>> Autosizing question:
>>>
>>> Hello, is there a way to autosize the specified column
>>> in POI? Since VBA have this function to autosize
>>> columns, I wonder if POI have, if not, I have to
>>> setsize for each column, I think it would waste a lot
>>> of resource right? Thanks
>>>       
>> I'm facing the same problem.
>>
>> Did you find a solution?
>>
>> Bret Hart <im2heat <at> yahoo.com> writes:
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
>> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
>> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/
>>     
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/
>
>
>
>   


-- 
No PST Files Ever Again
Buni Meldware Communication Suite
Email, Calendaring, ease of configuration/administration
http://buni.org



---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/


RE: Autosizing question:

Posted by Tahir Akhtar <ta...@spectrum-tech.com>.
I am willing to contribute if you provide some initial pointers. 

Regards
Tahir

-----Original Message-----
From: Avik Sengupta [mailto:avik.sengupta@itellix.com] 
Sent: Wednesday, January 24, 2007 6:08 PM
To: poi-user@jakarta.apache.org
Subject: Re: Autosizing question:

>Since VBA have this function to autosize
> > columns, I wonder if POI have

POI is not, and was never meant to be, a replacement for VBA. Its a file 
format reader/writer. To do autosizing, one needs a fontmetrics 
implementation. We're yet find one that is useful and easy enuf to use. 

However, as a frequently requested feature, its a ripe oppurtunity for 
contribution :)

Regards
-
Avik

On Wednesday 24 January 2007 17:36, Adelbert Groebbens wrote:
> > Autosizing question:
> >
> > Hello, is there a way to autosize the specified column
> > in POI? Since VBA have this function to autosize
> > columns, I wonder if POI have, if not, I have to
> > setsize for each column, I think it would waste a lot
> > of resource right? Thanks
>
> I'm facing the same problem.
>
> Did you find a solution?
>
> Bret Hart <im2heat <at> yahoo.com> writes:
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/




---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/


Re: Autosizing question:

Posted by Avik Sengupta <av...@itellix.com>.
>Since VBA have this function to autosize
> > columns, I wonder if POI have

POI is not, and was never meant to be, a replacement for VBA. Its a file 
format reader/writer. To do autosizing, one needs a fontmetrics 
implementation. We're yet find one that is useful and easy enuf to use. 

However, as a frequently requested feature, its a ripe oppurtunity for 
contribution :)

Regards
-
Avik

On Wednesday 24 January 2007 17:36, Adelbert Groebbens wrote:
> > Autosizing question:
> >
> > Hello, is there a way to autosize the specified column
> > in POI? Since VBA have this function to autosize
> > columns, I wonder if POI have, if not, I have to
> > setsize for each column, I think it would waste a lot
> > of resource right? Thanks
>
> I'm facing the same problem.
>
> Did you find a solution?
>
> Bret Hart <im2heat <at> yahoo.com> writes:
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/


Re: Autosizing question:

Posted by Adelbert Groebbens <ad...@contractor.thomson.com>.
> Autosizing question:
> 
> Hello, is there a way to autosize the specified column
> in POI? Since VBA have this function to autosize
> columns, I wonder if POI have, if not, I have to
> setsize for each column, I think it would waste a lot
> of resource right? Thanks

I'm facing the same problem. 

Did you find a solution?

Bret Hart <im2heat <at> yahoo.com> writes:





---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/