Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Pixel Font Converter!

Lets you create your own TTF fonts out of pixel font images! · By YellowAfterlife

Is there a way generate letters with these and then take those letters and apply them to a different font?

A topic by Uraynuke™ created Aug 17, 2023 Views: 220 Replies: 1
Viewing posts 1 to 2

this was sparked by some letters not being able to be converted
I guess what I'm asking [if there is even a way to do this, I'm quite a novice on the topic] is if you could generate letters using ABCD, for example, and then put them on a different font, assigned to different characters?

TL;DR: Is it possible to:
1> Generate, for example 𝗭𝗬𝗫, with the glyphs in ABC
2> Take out the letters 𝗭𝗬𝗫 that have been generated with the font
3> Put them in a different font, actually assigned to the unicode of 𝗭𝗬𝗫

or really, anything akin to this - I don't know what I'm doing

Developer

You could do so with FontForge’s scripting - I used to use that to post-fix fonts coming out of BitFontMaker2. Here’s an example:

ff_uppercase.bat

@echo off
if "%1" == "" goto help
if "%2" == "" goto help
fontforge -quiet -script %~dp0ff_uppercase.pe %1 %2
goto end
:help
echo Usage: ff_uppercase in.ttf out.ttf
:end

ff_uppercase.pe

Open($argv[1]);
//
name = $1:r;
p1 = Strrstr(name, "/");
p2 = Strrstr(name, Chr(92));
if (p1 < p2)
	p1 = p2;
endif
if (p1 >= 0)
	name = Strsub(name, p1 + 1)
endif
name = name + ".uc";
SetFontNames(name, name, name);
//
n = CharCnt();
//
replaceable = Array(n);
i = 32;
while (i < n)
	replaceable[i] = 1;
	++i;
endloop
replaced = 0;
//
i = 32;
while (i < n)
	if (IsUpper(i) && WorthOutputting(i))
		Select(i);
		Copy();
		lower = ToLower(i);
		if (replaceable[lower])
			replaced++;
			replaceable[lower] = 0;
			Select(lower);
			Clear();
			Paste();
		endif
	endif
	++i;
endloop
Print("Replaced " + ToString(replaced) + " glyphs.");
Generate($argv[2]);

The Python API is probably easier to work with.