News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Bitmap fonts prog

Started by LordAdef, May 29, 2018, 04:13:23 AM

Previous topic - Next topic

LordAdef

guys, Has any of you made any prog converting a font into a bitmap atlas image?
I've done one many years ago but cannot find it..
i found a couple of free ones in the internet but if any of you has made such a thing I would rather use it instead.
Or I might code it myself, although I rather just use it and save the time.
Cheers Alex

jj2007

What is a bitmap atlas image? Many years ago I wrote a screen and printer driver that used fonts to plot pixels. But that was 68000 Motorola assembler, and I doubt that Windows fonts are still structured like that...

daydreamer

I Think you can do it with a textarea,loop thru the desired font and settext and open area with ddraw(this time skip the clear screen part) and lock and search for x,y where textarea text are starting and read in bitmap and save as binary file,unfortunatly ddraw dont work well on newer computers/os's
I dont know enough about GDI+ if its possible to screencapture,but maybe SDL would be better approach on newer computer,because DOSbox seem to make use of that api

my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

LordAdef

A texture Atlas is one single image with pre baked images all placed together inside. It's very used used in games, where you load this one atlas with all your assets in there, as opposed to load many single images separately.
I want to pre bake a font into a jpg "atlas" file.

Siekmanski

Do you mean this?


Use this font image to draw text to the screen?
Creative coders use backward thinking techniques as a strategy.

LordAdef

Quote from: Siekmanski on May 29, 2018, 05:32:23 AM
Do you mean this?


Use this font image to draw text to the screen?
Yes!

felipe

I used GalePortable (free and no need to installation  :biggrin:) to put all the santa's bitmaps into one. Is nice and  easy to use too. :idea:

LordAdef

Quote from: felipe on May 29, 2018, 12:05:55 PM
I used GalePortable (free and no need to installation  :biggrin: ) to put all the santa's bitmaps into one. Is nice and  easy to use too. :idea:


Thanks for the tip Felipe, I'll check it out!

hutch--

Long ago you used to be able to get software for creating bitmap fonts but I have not seen it for a very long time. Really depends on what you are after, fonts like fixedsys and a few other system based fonts are bitmap fonts but if you are after images of text characters, its reasonably easy to do if you have a good collection of true type fonts. You can use normal API functions to display the fonts and save the display area to a file.

I confess I don't have the time to do this stuff as I have long owned an app called IconWorkshop and if I need text based images, I just make them as a transparent PNG with text on them with whatever colour I need.

jj2007

Another route:
- create a compatible DC
- use TextOut to draw all the characters you need
- and BitBlt with the respective offsets to get a specific one

And, first of all, check if TextOut isn't already fast enough.

daydreamer

Isnt it most useful with extended ascii and some unicode sets,one that support different geometric shaped,another game stuff:chess,playing cards,mahjong tiles etc

my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

LordAdef

Thanks guys,
And yes, it's quite simple to make one of these. I found some free ones that do the job. I don't want to spend the time making one, and I don't know where my old proggy is. I was just checking if any of you already have one.
JJ: That's a good point, although textOut is slow as hell too... But having a bitmap text file ensure I have the font on any system, and without caring for loading indirect and so forth..
I found a paid one that even outputs the font in a asm format.

FORTRANS

Hi,

   I have some CGA class fonts in *.ASM format if you want
really low resolution.  Made for a CGA Mode 6 graphics
drawing program.  0 to 7F characters IIRC.  Maybe no graphics
for the control codes?  (It has been a while, and they had more
than one source.)

Cheers,

Steve N.