| 169 | } |
| 170 | |
| 171 | extern "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 | |
| 197 | extern "C" void DWriteRelease(glyph_generator *GlyphGen) |
| 198 | { |
no outgoing calls
no test coverage detected