Python-Flask not accepting custom fonts
<p>
Folder Blueprint <br></p>

<p>Templates</p>

<ul>
<li>File.html<br></li>
</ul>

<p>Static</p>

<ul>
<li>Fonts</li>
<li>Style</li>
</ul>

<p>In the css file , i tried :</p>

<pre><code>@font-face{
font-family:&lt;Font_name&gt;
src:{{ url_for('static',filename='fonts/&lt;font_name&gt;.ttf') }} ;
}
</code></pre>

<p>What changes are to be made to add custom fonts ?</p>

<p>You can't use template tags in css. the Jinja template tags are only meant for html files and templates not css.</p>

<p>To use a css file, you have to insert the link manually there, something along the lines of:</p>

<pre><code>@font-face{
font-family:customfont
src:/static/Fonts/font.ttf') }} ;
}
</code></pre>

<p>The only way to get around this is to serve a template, that contains the css embedded in <code>&lt;style&gt;&lt;/style&gt;</code> tags that way flask would be able to interprete the template tags. so with that you should have something like this</p>

<pre><code>&lt;style&gt;
@font-face{
font-family:&lt;Font_name&gt;
src:{{ url_for('static',filename='fonts/&lt;font_name&gt;.ttf') }} ;
}
&lt;/style&gt;
</code></pre>

python flask