A
A
Artem Komarov2015-06-12 14:35:36
css
Artem Komarov, 2015-06-12 14:35:36

How to make it so that when the page loads, the content does not jump due to the downloaded fonts?

I connect a non-standard font using @font-face. When the page loads, the following happens: html and css have already loaded, and the font itself is still loading. After the font has loaded everything is as it should be, but there is a visual jump. How to get rid of it?

Answer the question

In order to leave comments, you need to log in

5 answer(s)
P
Pavel Kononenko, 2015-06-12
@premas

It is polite to ask the user to install this font into their system.

4
4ikist, 2015-06-12
@4ikist

Use a safe font as close as possible to the non-standard one.
Load custom font using js.
At the time of successful loading, add a class to the element, for example (font-loaded).
In styles, assign a custom font to this class.

R
Rodion Svetlitskiy, 2015-06-12
@rsvetlitskiy

Use Typekit or Google Fonts if the font you need is there.

D
Dmitry Shinkar, 2015-06-12
@DeadCowsDontMoo

Is the pretty and popular Verdana not cool anymore?
PS. about Google Fonts - good advice.
ZZY. It is possible to prescribe some kind of pre-load and cache the whole thing in one... But depending on how much your wonderful fonts hang...

A
Alexander Zonov, 2015-06-12
@amazonov

Try explicitly setting the height and width for blocks that change their size a lot, which they acquire when loading the desired fonts. Yes, tedious and painstaking, yes, it does not always help, but it can reduce the severity of the problem.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question