bvDrawTypographicText
The function is used to draw text with typographic quality. Unlike windows' DrawText()
function this function internally operates with floating-point ariphmetics to
prevent looses of round-up.
BESTVIEWAPI(void) bvDrawTypographicText(HDC hdc,LPCTSTR
pszText, LPRECT pRect, UINT uFormat,
PLOGFONT pLogFont, PTYPOGRAPHICTEXT pTypographicText);
Parameters:
-
hdc
- the handle of device context
-
pszText
- a pointer to output string. The string must be zero-terminated.
-
pRect
- a pointer to the output rectangle.
-
uFormat
- a combination of flags which control how the text is drawn.
-
pLogFont - a pointer to LOGFONT
structure. Can be zero.
-
pTypographicText - a pointer to TYPOGRAPHICTEXT
structure. Can be zero.
Notes:
-
the variable uFormat can be combination of the next DrawText
() flags:
-
DT_CALCRECT
-
DT_NOCLIP
-
DT_CENTER
-
DT_JUSTIFY
-
DT_WORDBREAK
-
DT_SINGLELINE
-
DT_EXPANDTABS
-
DT_TOP
-
DT_VCENTER
-
DT_BOTTOM
-
DT_LEFT
-
DT_RIGHT
-
DT_EXTERNALLEADING
-
TYPOGRAPHICTEXT_DT_JUSTIFY - as an analog of DT_JUSTIFY
-
The function works can work in two modes, it depends on whether pLogFont
parameter is zero. If pLogFont is not zero the function
creates an instance of the font, selects it into the device context, draws the
text, returns previous state of the context and destroys the font. If pLogFont
is zero then the function draws the text using currently selected font.
-
using TYPOGRAPHICTEXT structure gives the user
an opportunity to use advanced settings for text drawing, such as kerning
pairs, control line spacing etc.