UI: Allow Float Kerning for Text Objects #105181

Merged
Harley Acheson merged 1 commits from pioverfour/blender:dp_kerning_float into main 2023-04-12 19:12:07 +02:00

1 Commits

Author SHA1 Message Date
Damien Picard 8b230c598e Font kerning: allow float values
Currently, the kerning used to change spacing between characters in a
text object is defined as int values. This is enough for most cases,
but for very demanding typesetting, say a logo or calligram, one may
need more precision.

Say you want to combine "u" and "n" for your DunE logo:

```
nnnnnn    nnnnnn       nnnn  nnnnnnnn
n::::n    n::::n       n:::nn::::::::nn
n::::n    n::::n       n::::::::::::::nn
n::::n    n::::n       nn:::::::::::::::n
n::::n    n::::n         n:::::nnnn:::::n
n::::n    n::::n         n::::n    n::::n
n::::n    n::::n         n::::n    n::::n
n:::::nnnn:::::n         n::::n    n::::n
n:::::::::::::::nn       n::::n    n::::n
 n:::::::::::::::n       n::::n    n::::n
  nn::::::::nn:::n       n::::n    n::::n
    nnnnnnnn  nnnn       nnnnnn    nnnnnn
```

You might want to combine the right stem of the u, with the left stem
of the n:

```
nnnnnn  nnnn  nnnnnnnn
n::::n  n:::nn::::::::nn
n::::n  n::::::::::::::nn
n::::n  nn:::::::::::::::n
n::::n    n:::::nnnn:::::n
n::::n    n::::n    n::::n
n::::n    n::::n    n::::n
n:::::nnnnn::::n    n::::n
n::::::::::::::::n  n::::n
 n:::::::::::::::n  n::::n
  nn:::::::::::::n  n::::n
    nnnnnnnn  nnnn  nnnnnn
```

To achieve this you need fine precision to align the letters together.

Another limitation this change removes is that the kerning is
currently limited to the [-20,20] range. If you’re trying to fill a
shape with words, you may need very large kerning to take the letter
far enough apart from each other. You could also use spaces, but they
have the drawback that they have to be inserted manually between each
pair of letters, instead of just kerning the entire line at once.

In addition, this change adds shortcuts to increase or decrease
kerning by increments of 1/10.
2023-02-25 18:41:42 +01:00