title: How to embed a custom font in my application
body: <p>I want to add a custom font to my application, and I have already added to my resource file.</p>
  
  <p><img src="https://i.stack.imgur.com/Es9eA.png" alt=""></p>
  
  <p>And my code as the following: </p>
  
  <pre><code>int id = QFontDatabase::addApplicationFont(":/fonts/ae_AlMateen.ttf");
  QMessageBox::information(this,"Message",QString::number(id));
  </code></pre>
  
  <hr>
  
  <p>Also the content of <code>.qrc</code> file.</p>
  
  <pre><code>&lt;RCC&gt;
      &lt;qresource prefix="/fonts"&gt;
          &lt;file alias="ae_AlMateen"&gt;ae_AlMateen.ttf&lt;/file&gt;
      &lt;/qresource&gt;
  &lt;/RCC&gt;
  </code></pre>
  
  <p>But the problem is that the <code>addApplicationFont</code> always returns <code>-1</code>.  </p>
  
  <p><strong>Note that</strong> when change the <code>:/fonts/ae_AlMateen.ttf</code> to direct path ex:<code>C://ae_AlMateen.ttf</code> it works fine.</p>
  
  <p>I want the font file to be integrated with my application executable file, in order to make the application does not need to attach the font file with it.</p>