Hi,
I did not write several parts of this myself. a2fFont is mainly written by
someone else.
So i agree that the next is a bit confusing.
enum a2dFontAlignment
{
// wxCENTRE
wxMINX = wxLEFT,
wxMAXX = wxRIGHT,
wxMINY = wxBOTTOM,
wxMAXY = wxTOP,
wxBBOX = 0x100,
a2dDEFAULT_ALIGNMENT = wxTOP | wxLEFT | wxBBOX
};
And i think we best make something which comes closest to SVG.
Get rid of the wxWidgets wxLEFT etc., instead make one alignment enum, with all
that is needed.
So indeed thing like:
enum a2dFontAlignment
{
a2dALIGN_LEFT
a2dALIGN_RIGHT
a2dALIGN_VERTICAL_CENTER
a2dALIGN_VERTICAL_BASELINE
a2dALIGN_VERTICAL_BOTTOM
a2dALIGN_VERTICAL_TOP
a2dALIGN_HORIZONTAL_CENTER
a2dALIGN_BBOX
}
would be better. Or whatever is more close to SVG would be oke also.
If you think you can do it, i am all for it.
But functions like this need to understand it too, so not that easy.
ic.GetDrawer2D()->DrawText( left, x, y + line * up * (GetLineHeight() +
m_linespace), m_alignment, !GetDrawFrame() && GetBackGround() );
m_font.GetTextExtent( left, ic.GetDrawer2D()->GetYaxis(), wxLEFT|wxTOP|wxBBOX,
&w );
It seems that the alignment is towards a line of text and how it is positioned
relative to the a2dText position. The rest of the lines follow from that.
I wonder ifSVG thinks like thata, or in multiple text lines alignment??
Bionic Badger wrote:
Looking over the a2dText code, the alignment uses wxLEFT, wxRIGHT,
wxCENTER, etc. for text alignment. However, this can result in the
inability to set vertical center alignment, as wxCenter is used for
both horizontal and vertical alignment. Suggested change: use
wxALIGN_LEFT, wxALIGN_RIGHT, wxALIGN_VERTICAL_CENTER, etc., while
mapping wxLEFT, wxRIGHT, etc. to these ALIGN versions (with wxCENTER =
wxALIGN_HORIZONTAL_CENTER) in SetAlignment(...).
Vertical centering doesn't seem to be actually implemented in the code
from what I've seen.
--
Unclassified
------------------------------------------------------------------------------------------------------------
Disclaimer:
If you are not the intended recipient of this email, please notify the sender and delete it.
Any unauthorized copying, disclosure or distribution of this email or its attachment(s) is forbidden.
Thales Nederland BV will not accept liability for any damage caused by this email or its attachment(s).
Thales Nederland BV is seated in Hengelo and is registered at the Chamber of Commerce under number 06061578.
------------------------------------------------------------------------------------------------------------
begin:vcard
fn:Klaas Holwerda
n:Holwerda;Klaas
note:Unclassified
version:2.1
end:vcard
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Wxart2d-users_dev mailing list
Wxart2d-users_dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxart2d-users_dev