Jump to content

Recommended Posts

Posted

Добрый день!

Как установить для UniLabel свой шрифт?

 

Спасибо

 

Posted

Шрифт которого нет в системе. В HTML: 
@font-face {
font-family: Days;
src: url(itim.otf) format("opentype");
}

  • 2 weeks later...
Posted

Унигуи системные  шрифты не нужны, посмотрите как выглядит объект в браузере и сделайте выводы

  • 7 years later...
Posted

Добрый день,

Возможно, уже неактуально, но для тех, кто найдёт этот тред.

Шрифт, которого нет в системе, подключается через @font-face, устанавливать его не нужно: браузер сам загружает файл с сервера.

1. Положите файл шрифта в папку files, например files\fonts\itim.otf

2. ServerModule.CustomCSS ->

@font-face {

  font-family: "Days";

  src: url("files/fonts/itim.otf") format("opentype");

}

3. UniLabel1.Font.Name := 'Days';

Font.Name напрямую передаётся в font-family, поэтому так работает и для других компонентов (UniEdit и т.д.), и при смене в рантайме.

Или через CSS-класс:

.daysfont {

  font-family: "Days" !important;

}

UniLabel1.LayoutConfig.Cls := 'daysfont';

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...