P
P
Pyotr Liteiny2019-01-23 02:34:56
Layout
Pyotr Liteiny, 2019-01-23 02:34:56

How to balance the length of text lines?

Question about aesthetics from the field of typography.
A simple example for understanding the question: there is a heading block of two lines and 8 words - 7 words fit in the first line, and the 1st word was transferred to the second line = 7/1.
It does not look very good - you need to auto-level (balance) the length of the lines: 4/4 or 5/3 words.
Is it possible to auto-balance it with code?
* Frame fixed and wide, the number of words is always different.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
aldroid, 2019-01-23
@aldroid

It is possible in PHP, it is possible in JS. The algorithm (its complexity) - depends on you (how you will divide, whether you will take into account the weight and length of words when transferring). Implementation - from your source (what you have where it is and what it is taken from - either it's bare HTML on the local and you enter text with pens, or it's a remote server with MySQL with page formation through PHP).

K
Konstantin Tsvetkov, 2019-01-23
@tsklab

Non-breaking spaces.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question