If you have the directx drawing error font, this user guide is here to help.



  • 3 minutes to read.


  INT DrawText (  [in] LPD3DXSPRITE pSprite,  [in]   LPCTSTR       pString,  [inches]   INT           Count,  [in]   LPRECT         pRect,  [in]   DWORD format,  [inch] D3DCOLOR       Color); 


pSprite [in]


Pointer to the template ID3DXSprite containing the string. It may turn out to be NULL, and in this caseNow Direct3D will undoubtedly become a render chain with its other Sprite object. For efficiency, only one Sprite should be specified, regardless of whether DrawText should be called multiple times in a row or not.

pString [inch]


Pointer to the area to drag into. If the Count parameter is -1, the string must be null-terminated.


drawtext directx font


drawtext directx font

Type: INT

Specifies the exact number of characters per line. If Count is -1, pString is treated as a pointer to a null-terminated number, and drawtext automatically calculates the character to count.




Pointer to a RECT structure that contains each of our rectangles in logical coordinates, exactly what the text should split. The coordinate of the value you see should be the right side of the rectangle larger than the left. The coordinate value of the lower part must also be higher than that of the upper part.

Format [inch]


As you can see, specifies how to format thoseincidentally. It can be any combination of the following:

value Value
Indicates the reasons why this text points to a rectangle. This value must be combined with DT_SINGLELINE.
Usually defines the width and height of the rectangle. If there are multiple lines of text, DrawText uses the width of my rectangle pointed to by these pRect parameters and expands the rectangle to its full length to cover the last main line of text. When there is usually only one line of DrawText text, the right side of the rectangle changes to surround the last character on the layer. In any case, DrawText returns the top of the formatted text, but does not draw the text.
Uniquely centers the text horizontally within the rectangle.
Expands tab characters. By default, there are usually eight characters per tab.
Left aligned text.
Draw without cropping. DrawText is slightly faster when using DT_NOCLIP.
Align the text to correct the error.
Displays text in right-to-left reading order for bidirectional reading when a Hebrew or Arabic font is selected. In standard reading, all command text is read from left to right.


text messages on one line, but. Carriage return and line feed do not contain newline characters.

The text is justified.
Centers text from top to bottom (one line).
Break words. Lines are automatically split between words when a word protrudes from them, the edge of the rectangle specified by the pRect parameter. The wrong return / line feed sequence also breaks the line.

color [inch]


Color the text in. For moresee D3DCOLOR for information.

Returned Value

If the function succeeds, the overall return value is the height with text in logical units. If DT_VCENTER or DT_BOTTOM is specified, the exact return value is the pRect offset (top to bottom) for the drawn text. If the function fails, the return value is now zero.

The parameters for this method are especially similar to those for the DrawText GDI function.

This method is usually called BeginScene a … EndScene . The only exception is when a useful application also calls DrawText DT_CALCRECT to successfully compute the size of one with our understanding of text blocks.

If the DT_NOCLIP file format is not used, this method trims this text so that it appears smaller than the outside of the specified rectangle. All formatting is assumed to have a specified number of lines, unless the DT_SINGLELINE format is very strict.

If the selected font is too large for the rectangle, this tactic will try not to replace the smaller font.

This method supports bothEven fonts that have alignment and escape-alignment as variants.


requirement value

See Also