Home|Download|Buy online|Affiliates|Search|Feedback|Site Map|Forum|ReviewsUse our online RSS & XML news feeds to get the latest news about our products delivered to your desktop... RSS feed    05.09.2010
Home»BestView preview library»SDK»Exported functions
Find out more how to use BestView...
bvDrawTypographicText

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.
Valid HTML 4.01 Transitional© PVL team, 2004-2010, all rights reserved. This Web site and its entire contents are for personal use only and may not be copied, reproduced, modified, published or distributed in any way,without PVL team's prior written permission.