Closed TheSystemIsCorrupt closed 2 years ago
Same source works in firefox :
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="app_data\style.css">
</head>
<body>
<ui>
<div type="textview" class="header_text">Hello World!</div>
</ui>
</body>
</html>
LCUI loads the font file specified by src
in @font-face
, but does not register the font with a new font-family
in the font library. Therefore, you need to use the default font family name in the font file.
@lc-soft thanks! Does this mean we only can have one font for our application ui?
Can you explain what you mean from :
> Therefore, you need to use the default word family name in the font file.
Let's say I have Impact.ttf and Roboto.ttf is it possible to use them both in same ui page? if yes how?
Oh now I get it, the font name inside the font file! Some other note if someone seek for same thing, in html/css font path should be releative to css file but in lcui it should be relative to app/exe file.
/* Bold */
@font-face
{
src: url("app_Data/font.ttf");
}
/* Light */
@font-face
{
src: url("app_Data/font2.ttf");
}
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 :
And here's style.css :
Application runs without any error but the font never gets applied, am I missing something? How can I use a custom font?