---
name: "unihexrotate"
section: "1"
platform: "linux"
package: "unifont-bin"
version: "1:15.1.01-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/unihexrotate"
---

# unihexrotate(1)

rotate Unifont hex glyphs in quarter turn increments

## NAME

unihexrotate - rotate Unifont hex glyphs in quarter turn increments

## SYNOPSIS

**unihexrotate** \[-n *quarter-turns*\] \[*input-font.hex*\] \> *output-font.hex*

## DESCRIPTION

**unihexrotate** reads a GNU Unifont .hex format file named on the command line, or from stdin if no filename is given.  If a number of quarter turns is specified, it rotates each glyph clockwise by that number of quarter turns, or counterclockwise if the number is negative. The resulting modified .hex file is written to stdout. The format of a .hex file is described in the [**unifont**(5)](/unifont/5.md) man page.

If the number of quarter turns is not specified, **unihexrotate** will rotate each glyph by a default value of one quarter turn (i.e., 90 degrees) clockwise.

**unihexrotate** only supports Unifont .hex files with glyphs that are 8 columns and 16 columns wide.  If an 8-column glyph is rotated, it is first centered within a 16-column glyph so the rotation will be performed on a 16-by-16 pixel glyph.  One additional use of this program is that a glyph can be converted from 8 columns wide to 16 columns wide by specifying a rotation of 0 quarter turns.

## OPTIONS

- **-n**

  Specify an integer number of quarter turn clockwise rotations to perform, typically as "-n 0" through "-n 3" (alternatively as "-n=0" through "-n=3") for rotations of 0, 90, 180, or 270 degrees, respectively.  Negative values will perform counterclockwise rotations by the specified number of quarter turns.

## EXAMPLES

This example extracts the Mongolian glyphs in the "unifont-base.hex" file (located in the "font/plane00" directory) and pipes them to **unihexrotate** to rotate by the default amount of one quarter turn clockwise (i.e., by 90 degrees). The basic Mongolian glyphs are in the Unicode range U+1800 through U+18AF. The original glyphs in "unifont-base.hex" are drawn for horizontal rendering (as per the Unicode Standard).  The output rotated glyphs are suitable for rendering Mongolian in its traditional vertical form.  Because no filename is specified to **unihexrotate** in this example, its input is taken from stdin.

grep "^18\[0-A\]" unifont-base.hex \| **unihexrotate** \> vertical.hex

The next example reverses the rotation performed above, by one quarter turn counterclockwise.  In this example, the input filename "vertical.hex" is specified.

**unihexrotate** -n -1 vertical.hex \> horizontal.hex

## FILES

Unifont .hex format input and output files.

## SEE ALSO

[**bdfimplode**(1)](/bdfimplode/1.md), [**hex2bdf**(1)](/hex2bdf/1.md), **hex2otf**(1), [**hex2sfd**(1)](/hex2sfd/1.md), [**hexbraille**(1)](/hexbraille/1.md), [**hexdraw**(1)](/hexdraw/1.md), [**hexkinya**(1)](/hexkinya/1.md), [**hexmerge**(1)](/hexmerge/1.md), **johab2syllables**(1), [**johab2ucs2**(1)](/johab2ucs2/1.md), [**unibdf2hex**(1)](/unibdf2hex/1.md), [**unibmp2hex**(1)](/unibmp2hex/1.md), [**unibmpbump**(1)](/unibmpbump/1.md), [**unicoverage**(1)](/unicoverage/1.md), [**unidup**(1)](/unidup/1.md), [**unifont**(5)](/unifont/5.md), **unifont-johab631**(5), [**unifont-viewer**(1)](/unifont-viewer/1.md), [**unifont1per**(1)](/unifont1per/1.md), [**unifontchojung**(1)](/unifontchojung/1.md), [**unifontksx**(1)](/unifontksx/1.md), [**unifontpic**(1)](/unifontpic/1.md), **unigen-hangul**(1), [**unigencircles**(1)](/unigencircles/1.md), [**unigenwidth**(1)](/unigenwidth/1.md), [**unihex2bmp**(1)](/unihex2bmp/1.md), [**unihex2png**(1)](/unihex2png/1.md), [**unihexfill**(1)](/unihexfill/1.md), [**unihexgen**(1)](/unihexgen/1.md), **unihexpose**(1), **unijohab2html**(1), [**unipagecount**(1)](/unipagecount/1.md), [**unipng2hex**(1)](/unipng2hex/1.md)

## AUTHOR

**unihexrotate** was written by David Corbett.

## LICENSE

**unihexrotate** is Copyright © 2019 David Corbett.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

## BUGS

No known bugs exist.
