GNU Unifont 16.0.02
Pan-Unicode font with complete Unicode Plane 0 coverage and partial coverage of higher planes
|
unihexgen - Generate a series of glyphs containing hexadecimal code points More...
#include <stdio.h>
#include <stdlib.h>
Go to the source code of this file.
Functions | |
int | main (int argc, char *argv[]) |
The main function. More... | |
void | hexprint4 (int thiscp) |
Generate a bitmap containing a 4-digit Unicode code point. More... | |
void | hexprint6 (int thiscp) |
Generate a bitmap containing a 6-digit Unicode code point. More... | |
Variables | |
char | hexdigit [16][5] |
Bitmap pattern for each hexadecimal digit. More... | |
unihexgen - Generate a series of glyphs containing hexadecimal code points
This program generates glyphs in Unifont .hex format that contain four- or six-digit hexadecimal numbers in a 16x16 pixel area. These are rendered as white digits on a black background.
argv[1] is the starting code point (as a hexadecimal string, with no leading "0x".
argv[2] is the ending code point (as a hexadecimal string, with no leading "0x".
For example: unihexgen e000 f8ff > pua.hex This generates the Private Use Area glyph file.
This utility program works in Roman Czyborra's unifont.hex file format, the basis of the GNU Unifont package.
Definition in file unihexgen.c.
void hexprint4 | ( | int | thiscp | ) |
Generate a bitmap containing a 4-digit Unicode code point.
Takes a 4-digit Unicode code point as an argument and prints a unifont.hex string for it to stdout.
[in] | thiscp | The current code point for which to generate a glyph. |
Definition at line 160 of file unihexgen.c.
void hexprint6 | ( | int | thiscp | ) |
Generate a bitmap containing a 6-digit Unicode code point.
Takes a 6-digit Unicode code point as an argument and prints a unifont.hex string for it to stdout.
[in] | thiscp | The current code point for which to generate a glyph. |
Definition at line 223 of file unihexgen.c.
int main | ( | int | argc, |
char * | argv[] | ||
) |
The main function.
[in] | argc | The count of command line arguments. |
[in] | argv | Pointer to array of command line arguments (code point range). |
Definition at line 112 of file unihexgen.c.
char hexdigit[16][5] |
Bitmap pattern for each hexadecimal digit.
hexdigit[][] definition: the bitmap pattern for each hexadecimal digit.
Each digit is drawn as a 4 wide by 5 high bitmap, so each digit row is one hexadecimal digit, and each entry has 5 rows.
For example, the entry for digit 1 is:
{0x2,0x6,0x2,0x2,0x7},
which corresponds graphically to:
–#- ==> 0010 ==> 0x2 -##- ==> 0110 ==> 0x6 –#- ==> 0010 ==> 0x2 –#- ==> 0010 ==> 0x2 -### ==> 0111 ==> 0x7
These row values will then be exclusive-ORed with four one bits (binary 1111, or 0xF) to form white digits on a black background.
Functions hexprint4 and hexprint6 share the hexdigit array; they print four-digit and six-digit hexadecimal code points in a single glyph, respectively.
Definition at line 84 of file unihexgen.c.