Spacing
Control distances between characters and words, and fine-tune specific gaps with kerning.
Character Spacing
Characters within a word are separated by char-space, which defaults to 2 grid units:
[grid]||B392/B666[grid;crop=7;margin=0.25]||B392/B666Spacing is measured between stroke centers, not between ink edges. This means changing stroke-width affects how spacious or tight characters appear without changing the actual spacing. Thicker strokes may benefit from a wider char-space:
[grid;stroke-width=1]||B392/B666[grid;stroke-width=1;char-space=2.5]||B392/B666| Option | Default | Range |
|---|---|---|
char-space | 2 grid units | 0 or more |
Word Spacing
The visible gap between words is 8 grid units by default, but it is made up of two parts: a 2-unit advance width that naturally follows every character (the same as char-space), plus 6 units of actual word spacing:
[grid]||B392/B666//B431//B4The word-space option controls the full gap. Each extra / (///, ////) adds 6 units (the gap minus the advance width that is already there):
[grid]||B392/B666///B431//B4A space at the start or the end of a composition counts in full: the picture ends where a next word would start, so with margin=0 two pictures placed side by side line up as one sentence would. To trim the picture to the ink instead, use crop=auto:
[grid]||B392/B666//[grid;crop=auto]||B392/B666//Like char-space, word-space may benefit from adjustment when using a thicker stroke-width.
| Option | Default | Range |
|---|---|---|
word-space | 8 grid units | 0 or more |
Automatic Spacing Adjustments
Some characters have built-in spacing adjustments. Punctuation marks like period (B4) and comma (B5) are placed with half the normal word spacing before them, so they sit closer to the preceding word:
[grid]||B392/B666//B431//B4Digits also have default kerning that reduces the space between them by 1 unit, so sequences of digits appear grouped:
[grid]||B452/B10/B11These adjustments happen automatically and respond to changes in word-space and char-space.
External Glyph Spacing
When using external glyphs (X-codes for Latin & Cyrillic characters), control their spacing with external-glyph-space:
| Option | Default | Range |
|---|---|---|
external-glyph-space | 0.8 grid units | 0 or more |
Kerning
For precise control between specific characters, use kerning codes. Unlike char-space which affects all characters uniformly, kerning adjusts the space before a specific character:
Bliss characters don't have automatic kerning yet, but this is planned for a future version. For now, use RK or AK manually to adjust spacing between specific characters. Latin & Cyrillic characters do have intrinsic kerning derived from their underlying font.
Relative Kerning (RK)
RK adjusts spacing relative to what it would otherwise be:
B106/B313B106/RK:-1/B313How RK works:
RK:0- No change from default- Positive values increase spacing by that amount
- Negative values decrease spacing by that amount
If characters would normally be 2 units apart, RK:-1 makes them 1 unit (2 - 1).
Absolute Kerning (AK)
AK sets exact spacing in grid units, ignoring all other spacing settings:
B313/AK:0/B1103B313/AK:2/B1103How AK works:
AK:0- Characters touch (no space)AK:2- Standard-ish spacing- Any value sets the exact distance regardless of other settings
Kerning as an Option
RK: and AK: are the short spellings. The same two values are also plain options, which is what you need when the value comes from a program rather than from written text:
B106/[relative-kerning=-1]B313 (same as B106/RK:-1/B313)
B313/[absolute-kerning=0]B1103 (same as B313/AK:0/B1103)builder.glyph(1).setOptions({ relativeKerning: -1 });All three spellings draw the same picture, and the output settles on the short one: [relative-kerning=-1] comes back from toString() as RK:-1.
Kerning is the gap before a character, so the option belongs on one. Written at part, word or global scope it is dropped with a MISPLACED_KERNING_OPTION warning and the content renders unchanged.
Mixing Kerning Types
Combine different kerning approaches in one composition:
B291/RK:-2/B291/AK:6/B291Kerning codes affect the space before the next character, not after the previous one.
So the next element has to be a character. A space takes no kerning: a marker before one (B313/AK:10//B291) or a kerning option written on one (B313/[relative-kerning=3]QSP) is dropped with a MISPLACED_SPACE_DECORATION warning, and the picture is drawn as if it had never been written. The gap between words is set by word-space. A marker at the very end, with no character after it (B313/AK:10), has no gap to set either, and is dropped with a MISPLACED_KERNING_OPTION warning.
A character takes one kerning value, however you write it. Set it more than once and the last value written wins, with an option beating an RK:/AK: marker; each value that loses is reported with a MULTIPLE_KERNING_VALUES warning rather than disappearing. So B99/AK:4/RK:3/B291 kerns by RK:3 and says that AK:4 was ignored. A bracket on its own between two slashes (B99/[absolute-kerning=4]/RK:3/B291) is not an option on B291: it is an empty character, a slot, holding kerning of its own, and the two values add up (a gap of 4 + 3) with no warning.
Note: When automatic kerning is added in a future version, existing RK adjustments will adapt naturally since they are relative to whatever the base spacing is. AK values will remain unchanged since they set absolute distances.
Options Reference
| Option | Default | Range | Description |
|---|---|---|---|
word-space | 8 grid units | 0 or more | Space between words (//) |
char-space | 2 grid units | 0 or more | Space between characters (/) |
external-glyph-space | 0.8 grid units | 0 or more | Space for external glyphs |
All three draw the value you write, at any spacing from 0 up. A spacing nothing can draw is refused instead: a negative one or an infinity reports OUT_OF_RANGE_OPTION_VALUE, and a value that is not a number, including the key written with no value, reports INVALID_OPTION_VALUE. Nothing is written in place of a refused value, so the spacing keeps its default. A null or undefined passed in an options object is refused and reported too, and because neither can be written down, it is left out of the composition rather than saved with it.
| Kerning Code | Syntax | Option spelling | Description |
|---|---|---|---|
RK | RK:value | [relative-kerning=value], { relativeKerning: value } | Relative adjustment to spacing |
AK | AK:value | [absolute-kerning=value], { absoluteKerning: value } | Absolute spacing in grid units |