MCPcopy Create free account
hub / github.com/cmuratori/refterm / DWriteDrawText

Function DWriteDrawText

refterm_example_dwrite.cpp:171–195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169}
170
171extern "C" void DWriteDrawText(glyph_generator *GlyphGen, int StringLen, WCHAR *String,
172 uint32_t Left, uint32_t Top, uint32_t Right, uint32_t Bottom,
173 struct ID2D1RenderTarget *RenderTarget,
174 struct ID2D1SolidColorBrush *FillBrush,
175 float XScale, float YScale)
176{
177 D2D1_RECT_F Rect;
178
179 Rect.left = (float)Left;
180 Rect.top = (float)Top;
181 Rect.right = (float)Right;
182 Rect.bottom = (float)Bottom;
183
184 RenderTarget->SetTransform(D2D1::Matrix3x2F::Scale(D2D1::Size(XScale, YScale),
185 D2D1::Point2F(0.0f, 0.0f)));
186 RenderTarget->BeginDraw();
187 RenderTarget->Clear();
188 RenderTarget->DrawText(String, StringLen, GlyphGen->TextFormat, &Rect, FillBrush,
189 D2D1_DRAW_TEXT_OPTIONS_CLIP|D2D1_DRAW_TEXT_OPTIONS_ENABLE_COLOR_FONT, DWRITE_MEASURING_MODE_NATURAL);
190 HRESULT Error = RenderTarget->EndDraw();
191 if(!SUCCEEDED(Error))
192 {
193 Assert(!"EndDraw failed");
194 }
195}
196
197extern "C" void DWriteRelease(glyph_generator *GlyphGen)
198{

Callers 1

PrepareTilesForTransferFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected