title: Direct2D/DirectDraw will only draw text with Arial font
body: <p>I am using Direct2D for some graphics, I have gotten it to draw text with DirectDraw (using the DrawText function on the ID2D1RenderTarget) but for some reason it will not draw with the font I want. When I create a text format for the font I want I do not get any errors. I am compiling with the Multibyte option set.</p>
  
  <p>Font loading code:</p>
  
  <pre><code>std::wstring unicode(name, name + strlen(name));
          HRESULT r = g_writeFactory-&gt;CreateTextFormat(unicode.c_str(), NULL, DWRITE_FONT_WEIGHT_NORMAL,
              DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, (float)size, L"en-us", &amp;g_fonts[i]);
          g_fonts[i]-&gt;SetTextAlignment(DWRITE_TEXT_ALIGNMENT_LEADING);
          g_fonts[i]-&gt;SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_NEAR);
  
          if (FAILED(r))
          {
              dgSetLastError(dgERROR_CREATIONFAILED);
              return -1;
          }
  
          return i;
  </code></pre>
  
  <p>Text drawing:</p>
  
  <pre><code>std::wstring unicode(text, text + strlen(text));
  D2D1_RECT_F r = D2D1::RectF(x, y, x + width, y + height);
  int len = unicode.size();
  
  if (g_isRenderToTexture)
      g_textureTarget-&gt;DrawText(unicode.c_str(), len, g_fonts[fontId], &amp;r, g_solidBrush);
  else
      g_bufferTarget-&gt;DrawText(unicode.c_str(), len, g_fonts[fontId], &amp;r, g_solidBrush);
  </code></pre>