|
Axmol 3.0.0-89d6d9a
|
Internal helper class for rendering text using DirectWrite and Direct2D. More...
#include <DWriteTextRenderer.h>
Public Member Functions | |
| bool | drawText (std::string_view text, const FontDefinition &textDefinition, unsigned int align, bool &premultipliedAlpha, SIZE &extent, tlx::byte_buffer &outData) |
| Render UTF-8 text into a WIC bitmap and return its pixel data. | |
Internal helper class for rendering text using DirectWrite and Direct2D.
| bool drawText | ( | std::string_view | text, |
| const FontDefinition & | textDefinition, | ||
| unsigned int | align, | ||
| bool & | premultipliedAlpha, | ||
| SIZE & | extent, | ||
| tlx::byte_buffer & | outData ) |
Render UTF-8 text into a WIC bitmap and return its pixel data.
This function uses DirectWrite/Direct2D to draw text into a WIC bitmap, applying font settings, alignment, wrapping, overflow rules, stroke and shadow effects. The rendered bitmap is then copied into the provided output buffer in 32-bit BGRA format with premultiplied alpha.
| text | UTF-8 encoded text string to render. Line breaks (' ') are supported. |
| textDefinition | FontDefinition structure specifying font family, size, color, stroke and shadow options, wrapping and overflow behavior. |
| align | Alignment flags (compatible with BitmapDC):
|
| premultipliedAlpha | Output flag indicating whether the pixel data uses premultiplied alpha. |
| extent | Input: maximum width/height constraints. Output: actual rendered text size in pixels. |
| outData | Output buffer containing raw pixel data (BGRA, premultiplied alpha). |