Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Return the pixel width of the given strings for the given font
C
branch: master

README.asciidoc

txtw(1)

Name

txtw - Compute text widths

Synopsis

txtw [-h|-v|-f FONT|-s SIZE|-F ALT_FONT|-S ALT_SIZE] STRING

Description

Returns the width in pixels of the given strings for the the given font.

Options

-h

Print the synopsis to standard output and exit.

-v

Print the version information to standard output and exit.

-f FONT

Set the main font.

-s SIZE

Set the size of the main font.

-F ALT_FONT

Set the alternate font.

-S ALT_SIZE

Set the size of the alternate font.

String Syntax

By default the main font is used to compute the width.

The alternate font is used for the parts of the string enclosed between \( and \).

Example

txtw -f 'DejaVu Sans' -s 11 -F SimpleIcons -S 16 'One \(U\) Two \(D\) Three'

Author

Bastien Dejean <nihilhill at gmail.com>

Something went wrong with that request. Please try again.