Hi all,
currently, it is not possible to get a length of a well known string in
a well
known font descriptor in a usable unit like 1/100mm.
We try to use such information for automatically adjustments of text box
width/heights in the new report wizard.
At the moment it is only possible to get the size of such string/font
composition as pixels which depends on the background output device.
To get such values, use the interface:
Size com.sun.star.awt.XLayoutConstrains.getPreferredSize();
Due to the fact it is not possible to get access to the background
output device
I plan to add a new interface, like
com::sun::star::awt::Size convertSizeToLogic(com::sun::star::awt::Size
const& aSize, sal_Int16 TargetUnit);
which knows the background output device because it will be implemented
in the
XWindowPeer.
So it is possible to calculate the 'getPreferredSize()' pixels to usable
1/100mm values.
With this new function it is very easy to get the length of a string
with a well
known font descriptor as 1/100mm or any other target unit.
The type TargetUnit is something out of
com::sun::star::util::MeasureUnit. If the TargetUnit is not usable or
convertable the function returns an IllegalArgumentException.
For completeness there will also implement the reverse interface, to convert
size to pixel of a well known target unit, like 1/100mm to pixel.
com::sun::star::awt::Size convertSizeToPixel(com::sun::star::awt::Size
const& aSize, sal_Int16 SourceUnit);
The type SourceUnit is something out of com::sun::star::util::MeasureUnit.
There will also the two interfaces for awt::Point types.
com::sun::star::awt::Point convertPointToLogic( [in]
com::sun::star::awt::Point aPoint, [in] short TargetUnit )
raises ( com::sun::star::lang::IllegalArgumentException );
com::sun::star::awt::Point convertPointToPixel( [in]
com::sun::star::awt::Point aPoint, [in] short SourceUnit )
raises ( com::sun::star::lang::IllegalArgumentException );
Any comments/suggestions?
-Lars
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]