HB-SHAPE(1) User Commands HB-SHAPE(1)

hb-shape - manual page for hb-shape 11.0.1

hb-shape [OPTION?] [FONT-FILE] [TEXT]

Shape text with given font.

Show help options
Show all help options
Options for the font face
Options for the font instance
Options for font variations used
Options for the input text
Options for the input context text
Options for the shaping process
Options for font features used
Options for the destination & form of the output
Options for the syntax of the output

Set font file-name
Set face index (default: 0)
Set face loader to use (default: ot)
Supported face loaders are: ot/ft
List available face loaders and quit

Font size (default: upem)
Set x,y pixels per EM (default: 0; disabled)
Set font point-size (default: 0; disabled)
Set synthetic bold (default: 0)
Set synthetic grade (default: 0)
Set synthetic slant (default: 0)
Set font functions implementation to use (default: ot)
Supported font function implementations are: ot/ft
List available font functions and quit
Set FreeType load-flags (default: 2)

Set named-instance index (default: none)
Comma-separated list of font variations
Variations are set globally. The format for specifying variation settings follows. All valid CSS font-variation-settings values other than 'normal' and 'inherited' are also accepted, though, not documented below.
The format is a tag, optionally followed by an equals sign, followed by a number. For example:
"wght=500" "slnt=-7.5"

Text options:

If no text is provided, standard input is used for input.

Set input text
Set input text file-name
Set input Unicode codepoints
Treat text as single paragraph

Set text context before each line
Set text context after each line
Set Unicode codepoints context before each line
Set Unicode codepoints context after each line

Set shapers to use (default: graphite2)
Supported shapers are: graphite2/ot/fallback
List available shapers and quit
Set text direction (default: auto)
Set text language (default: $LANG)
Set text script (default: auto)
Treat text as beginning-of-paragraph
Treat text as end-of-paragraph
Preserve Default-Ignorable characters
Remove Default-Ignorable characters
Glyph value to replace Default-Ignorables with
Glyph value to replace not-found characters with
Glyph value to replace not-found variation-selector characters with
Use UTF8 byte indices, not char indices
Cluster merging level (default: 0)
Rearrange glyph clusters in nominal order
Produce unsafe-to-concat glyph flag
Produce safe-to-insert-tatweel glyph flag
Interpret input as glyph string
Perform sanity checks on shaping results

Comma-separated list of font features
Features can be enabled or disabled, either globally or limited to specific character ranges. The format for specifying feature settings follows. All valid CSS font-feature-settings values other than 'normal' and the global values are also accepted, though not documented below. CSS string escapes are not supported. The range indices refer to the positions between Unicode characters, unless the --utf8-clusters is provided, in which case range indices refer to UTF-8 byte indices. The position before the first character is always 0.
Here is how it all works:
Value: Start: End:
Setting value:
"kern"
1 0 ? # Turn feature on
"+kern"
1 0 ? # Turn feature on
"-kern"
0 0 ? # Turn feature off
"kern=0"
0 0 ? # Turn feature off
"kern=1"
1 0 ? # Turn feature on
"aalt=2"
2 0 ? # Choose 2nd alternate
Setting index:
"kern[]"
1 0 ? # Turn feature on
"kern[:]"
1 0 ? # Turn feature on
"kern[5:]"
1 5 ? # Turn feature on, partial
"kern[:5]"
1 0 5 # Turn feature on, partial
"kern[3:5]"
1 3 5 # Turn feature on, range
"kern[3]"
1 3 3+1 # Turn feature on, single char
Mixing it all:
"aalt[3:5]=2" 2
3 5 # Turn 2nd alternate on for range

Set output file-name (default: stdout)
Set output format
Supported output formats are: text/json

text: [<glyph name or index>=<glyph cluster index within input>@<horizontal displacement>,<vertical displacement>+<horizontal advance>,<vertical advance>|...] json: [{"g": <glyph name or index>, "ax": <horizontal advance>, "ay": <vertical advance>, "dx": <horizontal displacement>, "dy": <vertical displacement>, "cl": <glyph cluster index within input>}, ...]

Prefix each line of output with its corresponding input text
Prefix each line of output with its corresponding input codepoint(s)
Prefix each line of output with its corresponding input line number
Prefix each line of output with all of the above
Output glyph indices instead of names
Do not output glyph positions
Do not output glyph advances
Do not output cluster indices
Output glyph extents
Output glyph flags
No Extra Data; Do not output clusters or advances
Output interim shaping results

Show version numbers
Run shaper N times (default: 1)

Shows results of shaping text with a given font in textual or JSON format.

0: Success.
1: Option parsing failed.
2: Failed loading font face.
3: Operation failed.
4: Failed setting font functions.

HB_FACE_LOADER=face-loader; Overrides the default face loader.
HB_FONT_FUNCS=font-funcs; Overrides the default font-funcs.
HB_SHAPER_LIST=shaper-list; Overrides the default shaper list.

hb-view(1), hb-shape(1), hb-subset(1), hb-info(1)

Find more information or report bugs at https://github.com/harfbuzz/harfbuzz

April 2025 HarfBuzz 11.0.1