~mrms/unifont2h

01293724c6dd8f356f6be5450bf654cb958025ea — Marek Ma┼íkarinec 1 year, 3 months ago 35d356e master
add hex group names
1 files changed, 8 insertions(+), 4 deletions(-)

M main.c
M main.c => main.c +8 -4
@@ 77,9 77,11 @@ int main(int argc, const char *argv[]) {
			printf(
				"};\n"
				"#endif\n"
				"#if defined(UNIFONT_GROUP_%d) || defined(UNIFONT_GROUP_ALL)\n"
				"#if defined(UNIFONT_GROUP_%d)"
					" || defined(UNIFONT_GROUP_0x%x)"
					" || defined(UNIFONT_GROUP_ALL)\n"
				"static uint16_t group_%d[256][16] = {\n",
				i / 256, i / 256
				i / 256, i / 256, i / 256
			);

		printf("\t{");


@@ 96,12 98,14 @@ int main(int argc, const char *argv[]) {
	printf("uint16_t *unifont[256] = {\n");
	for (int i=0; i < 256; ++i)
		printf(
			"#if defined(UNIFONT_GROUP_%d) || defined(UNIFONT_GROUP_ALL)\n"
			"#if defined(UNIFONT_GROUP_%d)"
				" || defined(UNIFONT_GROUP_0x%x)"
				" || defined(UNIFONT_GROUP_ALL)\n"
			"&group_%d[0][0],\n"
			"#else\n"
			"NULL,\n"
			"#endif\n",
			i, i
			i, i, i
		);

	printf("};\n#endif\n");