Log In  


Cart #font_creator-0 | 2025-05-12 | Code ▽ | Embed ▽ | No License

Export & Use

1) Use 🅾️/❎ to copy a binary string of your font.

2) Copy the following code into your cart and fill out the necessary parameters.

local font_dat="" -- place binary string here

-- extra parameters:
local width=8
local big_width=8
local height=8
-- optional:
local offset_x=0
local offset_y=0
local flags=0
local tab_width=8

--
function ords(str)
	o={}
	for c in all(split(str,"")) do
		add(o,ord(c))
	end
	return o
end

-- convert into font
poke(0x5600,unpack(ords(font_dat)))
poke(0x5600,unpack({width,big_width,height,offset_x,offset_y,flags,tab_width}))

Dev Journal

This one has been sitting in my pocket for a while... I just needed to add an export feature!
That said, I wanted to push it out there to see if people get any use out of it. I don't know how people make their fonts w/o a visual editor, or if something like this already exists?
Anyways, I hope it makes your workflow easier.

A few notes:

  • There is no import/save (you'll have to keep it open if you want to come back).
  • drawing in the top row might affect character width/y offset? (I didn't know this was a feature!)
  • Not all of the bugs are fixed yet!


The first row is special characters, they are use to set the variable widths for each character. Change the color of the cursor you can see it when deleting. was hard to tell what I was doing. I got this from a video about pico, It sets the character wide. You can always have a button to save a screen shot of the font and they can import on next use.

poke(0x5605,1)

spacing={
--0
"𝘢𝘥𝘨𝘩𝘸𝘰𝘵𝘲𝘷𝘹𝘺nvwadhoqtuxy04",
--+1
"m𝘮𝘷%$&",
--+2
"#@𝘬",
--+3
"",
-- -4
"i𝘪𝘴j1𝘫𝘯",
-- -3
" ",
-- -2
".,;:'()[]235689s",
-- -1
"𝘤𝘣𝘳𝘦𝘧𝘭𝘱𝘻bkgcefplrz7?+-={}<>|/\\"
}
 apply_spacing()
poke(0x5f58,0x81)

function apply_spacing()
	for i=1,#spacing do
		local chars=spacing[i]
		for j=1,#chars do
			adjust_char(chars[j],i-1)
		end
	end
end

function adjust_char(c,val)
	local addr= 0x5600 + ord(c)\2
	local shft= (ord(c) & 1) *4
	local mask= 0xf << shft
	poke(addr, (peek(addr) & ~mask)| (val << shft))
end


[Please log in to post a comment]