title: Compiling with font resource
body: <p>I'm on windows 8.1, visual studio 2017.</p>
  
  <p>I'm using this pricedown font in a directx project I'm working on.</p>
  
  <p>I load it with <code>AddFontResourceEx</code> and create a font for it with <code>D3DXCreateFont</code>.</p>
  
  <p>When I hit "Local Windows Debugger" everything is fine, font renders. Be it in release or in debug mode.
  Problem arises when I go through any executable, it never renders said font, be it release or debug.</p>
  
  <p>So I went reading, I read the articles on msdn, <a href="https://msdn.microsoft.com/en-us/library/6e7446zd.aspx?f=255&amp;MSPPError=-2147217396" rel="nofollow noreferrer">this one</a> and others whenever needed.</p>
  
  <p>I don't think I'm doing anything wrong, my Resource View looks like this:</p>
  
  <p><a href="https://i.stack.imgur.com/0t53e.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0t53e.png" alt="Resource View"></a></p>
  
  <p>, and IDR_FONT1 looks like this:</p>
  
  <p><a href="https://i.stack.imgur.com/yvza6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yvza6.png" alt="enter image description here"></a></p>
  
  <p>The file is automatically loaded into the solution explorer (I didn't add it, VS did from the Resource.rc file), as you can see here:</p>
  
  <p><a href="https://i.stack.imgur.com/pgxIa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pgxIa.png" alt="enter image description here"></a></p>
  
  <p>With these proprieties:</p>
  
  <p><a href="https://i.stack.imgur.com/ytFEU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ytFEU.png" alt="enter image description here"></a></p>
  
  <p>I add it like so:</p>
  
  <pre><code>AddFontResourceEx("pricedown.ttf", FR_PRIVATE, 0);
  this-&gt;createFont("Pricedown", 60, true, false);
  </code></pre>
  
  <p>Where createfont is my function to add the font (stripped down, it has arrays):</p>
  
  <pre><code>bool    D3D9Render::createFont(char *name, int size, bool bold, bool italic)
  {
      D3DXCreateFont(m_pD3dDev, size, 0, (bold) ? FW_BOLD : FW_NORMAL, 0, (italic) ? 1 : 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, ANTIALIASED_QUALITY, DEFAULT_PITCH, name, &amp;m_pFont);
      return true;
  }
  </code></pre>
  
  <p>I'm compiling it as x64 release.</p>
  
  <p>As I've said, it works and renders the font when I press "Local Windows Debugger" (in any mode including x64 release), but when I go to <code>project/x64/Release</code>, it just won't render the font. Even the executable size is adequate.</p>
  
  <p><code>GetLastError</code> on the <code>AddFontResource</code> is 2 (ERROR_FILE_NOT_FOUND)</p>
  
  <p>What am I doing wrong?</p>