I
I
Ingerniated2019-04-24 23:32:33
css
Ingerniated, 2019-04-24 23:32:33

How to calculate font to adjust for increase or decrease in page size?

Hello!
Tell me, is there some formula for proportionality of the main font size to all sizes?
For example, if my headings are 36px with a screen width of 1440, what should I do at 1920 and 1024 so that the width of the text blocks does not become smaller or too large?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey delphinpro, 2019-04-25
@Ingernirated

The width of all characters is different (if the font is not monospaced).
The width of the character "0" (zero) in css is expressed by the unit 1ch
The width of the viewport (the visible part of the window) is expressed by the unit 1vw.
The dependence of the character width on its height (and on the font size is obtained) can only be viewed by opening the font in a special editor. This relationship will obviously be specific to any particular font family or style.
Go ahead, write formulas. Approximately, with an allowable error, probably, something will turn out to be sculpted.
You can not bother and go by the method of scientific poke.
Manually determine the desired dimensions at the minimum and maximum widths. And then use the method of adaptive fonts. In this article on Habré, the method is laid out in detail on the shelves "Responsive Font Size "

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question