The MASM Forum

General => The Campus => Topic started by: LordAdef on May 29, 2018, 04:13:23 AM

Title: Bitmap fonts prog
Post by: LordAdef on May 29, 2018, 04:13:23 AM
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
Title: Re: Bitmap fonts prog
Post by: jj2007 on May 29, 2018, 04:32:13 AM
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...
Title: Re: Bitmap fonts prog
Post by: daydreamer on May 29, 2018, 04:34:57 AM
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

Title: Re: Bitmap fonts prog
Post by: LordAdef on May 29, 2018, 05:04:42 AM
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.
Title: Re: Bitmap fonts prog
Post by: Siekmanski on May 29, 2018, 05:32:23 AM
Do you mean this?
(http://members.home.nl/siekmanski/D3d9Font.png)

Use this font image to draw text to the screen?
Title: Re: Bitmap fonts prog
Post by: LordAdef on May 29, 2018, 05:36:40 AM
Quote from: Siekmanski on May 29, 2018, 05:32:23 AM
Do you mean this?
(http://members.home.nl/siekmanski/D3d9Font.png)

Use this font image to draw text to the screen?
Yes!
Title: Re: Bitmap fonts prog
Post by: 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:
Title: Re: Bitmap fonts prog
Post by: LordAdef on May 29, 2018, 12:58:40 PM
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!
Title: Re: Bitmap fonts prog
Post by: hutch-- on May 29, 2018, 01:58:51 PM
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.
Title: Re: Bitmap fonts prog
Post by: jj2007 on May 29, 2018, 04:59:44 PM
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.
Title: Re: Bitmap fonts prog
Post by: daydreamer on May 29, 2018, 08:56:10 PM
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

Title: Re: Bitmap fonts prog
Post by: LordAdef on May 29, 2018, 10:20:09 PM
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.
Title: Re: Bitmap fonts prog
Post by: FORTRANS on May 29, 2018, 11:17:28 PM
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.