Page 1 of 1

[HELP] convert font to bmp with each char in cell 16x16 how-to?

Posted: 2016-12-16T05:33:54-07:00
by TXG
Hi,

I want to convert text from a text file with a ttf font to bmp.

I managed to create it with the following command but the output.bmp is not right I cannot get each character in a 16x16 cell

The original file how the output should look is in this url and also my output.

https://www.dropbox.com/sh/qarfqwir0mb1 ... twyoa?dl=0
convert -pointsize 12 -background black -fill white -font verdana -size 1920x32 caption:@dF_16x16.txt output.bmp
My output does create a bmp it should be a 4 color bmp and each character should be size 16x16 and followed by the next cell 16x16 containing the next character.

When possible I would like to have the second line of characters in the textfile dF_16x16.txt in a different color.

Any help would be appreciated.

Re: [HELP] convert font to bmp with each char in cell 16x16 how-to?

Posted: 2016-12-16T06:21:48-07:00
by snibgo
Verdana is a proportional font, which means the different characters take up different amount of space.

If you want to use a proportional font but with fixed spacing, I think the only way is to write a script that converts one character at a time, each to its own image, with "-extent" as required. Then append the images together.

Re: [HELP] convert font to bmp with each char in cell 16x16 how-to?

Posted: 2016-12-16T07:02:45-07:00
by TXG
Do you have an example for this ?

Re: [HELP] convert font to bmp with each char in cell 16x16 how-to?

Posted: 2016-12-16T07:26:35-07:00
by snibgo
For processing characters from a string into separate images, in Windows BAT, see scripts in my "Squishing images" page. It is probably easier in bash.