Using custom fonts #257
TheSystemIsCorrupt posted onGitHub
Hi, it's few days I found your library it's very clean, nice and smooth, thank you so much for this great library. I was working with ultralight and qtwebengine and they are heavy for what I want and lcui is just what I needed.
I could successfully build all the lcui projects and demos and now I started to learn how it works, I couldn't find any documatiaon in english that tells how to connect ui to backend c like clicks and data syncing.
Currently i attempted to use a custom font for the page I searched in lcui-design and found out some fontface interface inside css files, I tried it but it doesn't work.
This is my file structre : app-start.exe app_data/style.css app_data/main.xml app_data/font.ttf
Here's main.xml :
<?xml version="1.0" encoding="UTF-8" ?>
<LCUI-app>
<resource type="text/css" src="app_data\style.css"/>
<ui>
<w type="textview" class="big_header">Hello World</w>
</ui>
</LCUI-app>
And here's style.css :
@font-face
{
font-family: 'textfont';
src: url("font.ttf");
}
.big_header
{
font-family: textfont;
font-size:30px;
color: #eeeeee;
text-align: center;
width:100%;
margin-top: 20px;
}
root
{
font-family: textfont;
min-width: 920px;
min-height: 480px;
background-color: #7940ff;
}
Application runs without any error but the font never gets applied, am I missing something? How can I use a custom font?