Author Topic: Bitmap fonts prog  (Read 326 times)

LordAdef

  • Member
  • ****
  • Posts: 588
Bitmap fonts prog
« 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

jj2007

  • Member
  • *****
  • Posts: 8504
  • Assembler is fun ;-)
    • MasmBasic
Re: Bitmap fonts prog
« Reply #1 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...

daydreamer

  • Member
  • ***
  • Posts: 465
Re: Bitmap fonts prog
« Reply #2 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

Quote from Flashdance
Nick  :  When you give up your dream, you die.
*wears a flameproof asbestos suit*

LordAdef

  • Member
  • ****
  • Posts: 588
Re: Bitmap fonts prog
« Reply #3 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.

Siekmanski

  • Member
  • *****
  • Posts: 1548
Re: Bitmap fonts prog
« Reply #4 on: May 29, 2018, 05:32:23 AM »
Do you mean this?


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

LordAdef

  • Member
  • ****
  • Posts: 588
Re: Bitmap fonts prog
« Reply #5 on: May 29, 2018, 05:36:40 AM »
Do you mean this?


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

felipe

  • Member
  • ****
  • Posts: 866
  • Eagles are just great!
Re: Bitmap fonts prog
« Reply #6 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:
Felipe.

LordAdef

  • Member
  • ****
  • Posts: 588
Re: Bitmap fonts prog
« Reply #7 on: May 29, 2018, 12:58:40 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--

  • Administrator
  • Member
  • ******
  • Posts: 5476
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: Bitmap fonts prog
« Reply #8 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.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :biggrin:

jj2007

  • Member
  • *****
  • Posts: 8504
  • Assembler is fun ;-)
    • MasmBasic
Re: Bitmap fonts prog
« Reply #9 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.

daydreamer

  • Member
  • ***
  • Posts: 465
Re: Bitmap fonts prog
« Reply #10 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

Quote from Flashdance
Nick  :  When you give up your dream, you die.
*wears a flameproof asbestos suit*

LordAdef

  • Member
  • ****
  • Posts: 588
Re: Bitmap fonts prog
« Reply #11 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.

FORTRANS

  • Member
  • *****
  • Posts: 1008
Re: Bitmap fonts prog
« Reply #12 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.