libUEMF
A portable library for reading and writing WMF, EMF and EMF+ files
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros
EMF TextAlignment Enumeration

Macros

#define U_TA_DEFAULT   0x00
 default alignment
 
#define U_TA_NOUPDATECP   0x00
 Reference point does not move.
 
#define U_TA_UPDATECP   0x01
 Reference point moves to end of next text drawn.
 
#define U_TA_LEFT   0x00
 Reference point is on left edge of bounding rectangle.
 
#define U_TA_RIGHT   0x02
 Reference point is on right edge of bounding rectangle.
 
#define U_TA_CENTER   0x06
 Reference point is on center vertical line of bounding rectangle.
 
#define U_TA_TOP   0x00
 Reference point is on top edge of bounding rectangle.
 
#define U_TA_BOTTOM   0x08
 Reference point is on bottom edge of bounding rectangle.
 
#define U_TA_BASEBIT   0x10
 Reference point is on baseline of text if this bit is set, for 0x10 <-> 0x18.
 
#define U_TA_BASELINE   0x18
 Reference point is on baseline of text.
 
#define U_TA_RTLREADING   0x100
 Set for Right to Left languages like Hebrew and Arabic.
 
#define U_TA_MASK   U_TA_BASELINE+U_TA_CENTER+U_TA_UPDATECP+U_TA_RTLREADING
 Mask for these bits.
 
#define U_VTA_BASELINE   U_TA_BASELINE
 same meaning, but for vertical text
 
#define U_VTA_LEFT   U_TA_BOTTOM
 same meaning, but for vertical text
 
#define U_VTA_RIGHT   U_TA_TOP
 same meaning, but for vertical text
 
#define U_VTA_CENTER   U_TA_CENTER
 same meaning, but for vertical text
 
#define U_VTA_BOTTOM   U_TA_RIGHT
 same meaning, but for vertical text
 
#define U_VTA_TOP   U_TA_LEFT
 same meaning, but for vertical text
 

Detailed Description

For U_EMRSETTEXTALIGN iMode field Microsoft name: TextAlignment Enumeration WMF Manual 2.1.2.3 WMF Manual 2.1.2.4

Recall that EMF coordinates have UL closest to {0,0}, LR is below and to the right of UL and so has LARGER {x,y} coordinates. In the following "TOP" is on the horizontal line defined by LR, as it has larger y coordinates, which when viewing the EMF file, would actually be on the BOTTOM of the bounding rectangle. Similarly, left and right are reversed.

Microsoft documentation (WMF manual, section 2.1.2.3) says that the text starts on certain edges of the bounding rectangle. That is apparently not true, whether the bounding rectangle is {0,0,-1,-1}, which is effectively no bounding rectangle, or if a valid bounding rectangle is specified. In all cases the text (in Windows XP Preview) starts, has center at, or ends at the center point. Vertical offsets seem to be defined analogously, but with respect to the height of the font. The bounding rectangle defined for the U_EMRTEXT record appears to be ignored.

Microsoft documentation (EMF manual,section 2.2.5) says that the same rectangle is used for "clipping or opaquing" by ExtTextOutA/W. That does not seem to occur either.