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

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
TXG
Posts: 2
Joined: 2016-12-16T05:16:41-07:00
Authentication code: 1151

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

Post 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.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

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

Post 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.
snibgo's IM pages: im.snibgo.com
TXG
Posts: 2
Joined: 2016-12-16T05:16:41-07:00
Authentication code: 1151

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

Post by TXG »

Do you have an example for this ?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

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

Post 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.
snibgo's IM pages: im.snibgo.com
Post Reply