Author Topic: A tool to create those "binaries" fonts?  (Read 8597 times)

0 Members and 1 Guest are viewing this topic.

Offline .:] Druid [:.

  • freebasic n00b
  • Pentium
  • *****
  • Posts: 563
  • Karma: 47
    • View Profile
    • Intro-Inferno
A tool to create those "binaries" fonts?
« on: November 22, 2006 »
Hello,
Sorry if it's dumb or been asked several times (I did not find any..) but I'm just wondering if there is an other way to create those:

data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0
data 0,0,0,1,1,0,0,0,0
data 0,0,0,1,1,0,0,0,0
data 0,0,0,0,1,0,0,0,0

other than editing via notepad etc?

Thanks for your help!
[sheep]: im sure he wants to goto prison.. they didnt get him last time.. he was promised a big cock up his arse.. and no doubt looking forward to it.. lets hope he gets his wish this year.

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: A tool to create those "binaries" fonts?
« Reply #1 on: November 22, 2006 »
Most people only use data statements if they want to avoid using external files.  Ideally you'd load your font from a bitmap - there are lots of tools for creating bitmaps from Windows fonts, for instance.

Jim
Challenge Trophies Won:

Offline benny!

  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4384
  • Karma: 228
  • in this place forever!
    • View Profile
    • bennyschuetz.com - mycroBlog
Re: A tool to create those "binaries" fonts?
« Reply #2 on: November 22, 2006 »
@Druid-tro:

Do you mean a tool for "drawing" fonts that outputs the final font in this data-structure
or do you mean a tool for converting e.g. system fonts to this way ?
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Offline .:] Druid [:.

  • freebasic n00b
  • Pentium
  • *****
  • Posts: 563
  • Karma: 47
    • View Profile
    • Intro-Inferno
Re: A tool to create those "binaries" fonts?
« Reply #3 on: November 23, 2006 »
Benny,

Any of those.  If it cant be converted but can be drawn, I'll survive :)
[sheep]: im sure he wants to goto prison.. they didnt get him last time.. he was promised a big cock up his arse.. and no doubt looking forward to it.. lets hope he gets his wish this year.

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: A tool to create those "binaries" fonts?
« Reply #4 on: November 23, 2006 »
I make mine the hard way :( The good thing is that if your font is say 8 pixels wide you can make each line fit into a byte if you can be arsed to do it which makes it really tiny in the exe :)
Shockwave ^ Codigos
Challenge Trophies Won:

Offline .:] Druid [:.

  • freebasic n00b
  • Pentium
  • *****
  • Posts: 563
  • Karma: 47
    • View Profile
    • Intro-Inferno
Re: A tool to create those "binaries" fonts?
« Reply #5 on: November 26, 2006 »
Thanks for your answers...now, i'll add another question then :)

do you have some tuts about using drawed fonts?  also, i'd like to have the fonts included in the exe (bin2bas maybe?) , any hint is welcome

Many thanks in advance!
[sheep]: im sure he wants to goto prison.. they didnt get him last time.. he was promised a big cock up his arse.. and no doubt looking forward to it.. lets hope he gets his wish this year.

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: A tool to create those "binaries" fonts?
« Reply #6 on: November 26, 2006 »
That wouldn't be too difficult to do. Have you managed to load a bitmap picture yourself yet?
Shockwave ^ Codigos
Challenge Trophies Won:

Offline .:] Druid [:.

  • freebasic n00b
  • Pentium
  • *****
  • Posts: 563
  • Karma: 47
    • View Profile
    • Intro-Inferno
Re: A tool to create those "binaries" fonts?
« Reply #7 on: November 26, 2006 »
that's waht i'm working on lately to be honnest :)  It drives me crazy ... but it did not yell for help yet :)  Oki, I'll do that first then once it's done, i'll come back with those fotns questions ;)
[sheep]: im sure he wants to goto prison.. they didnt get him last time.. he was promised a big cock up his arse.. and no doubt looking forward to it.. lets hope he gets his wish this year.

Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2757
  • Karma: 493
    • View Profile
    • https://www.rbraz.com/
Re: A tool to create those "binaries" fonts?
« Reply #8 on: November 26, 2006 »
@Druid: to load a 256 color bitmap, there's an example source included with bmp2raw, any problem, let me know!


Challenge Trophies Won:

Offline rdc

  • Pentium
  • *****
  • Posts: 1495
  • Karma: 140
  • Yes, it is me.
    • View Profile
    • Clark Productions
Re: A tool to create those "binaries" fonts?
« Reply #9 on: November 26, 2006 »
For FreeBasic .17 there is a DrawFont command which is what I am using for some of my demos. You can get the info on the FB wiki. Jofers also wrote a little utility to convert TTF fonts to drawfont format. You can find a link on that on the FB forums. I have used it and it works quite well.


Offline .:] Druid [:.

  • freebasic n00b
  • Pentium
  • *****
  • Posts: 563
  • Karma: 47
    • View Profile
    • Intro-Inferno
Re: A tool to create those "binaries" fonts?
« Reply #10 on: November 26, 2006 »
@rbraz: thanks a LOT it works just like a charm !!! :)

@rdc: i'll give it a try, thanks mate!
[sheep]: im sure he wants to goto prison.. they didnt get him last time.. he was promised a big cock up his arse.. and no doubt looking forward to it.. lets hope he gets his wish this year.

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: A tool to create those "binaries" fonts?
« Reply #11 on: November 26, 2006 »
Glad that you've got a picture loaded mate :)
Shockwave ^ Codigos
Challenge Trophies Won:

Offline .:] Druid [:.

  • freebasic n00b
  • Pentium
  • *****
  • Posts: 563
  • Karma: 47
    • View Profile
    • Intro-Inferno
Re: A tool to create those "binaries" fonts?
« Reply #12 on: February 10, 2007 »
Sorry to bring that old post....but I finally managed to use bmp fonts! i'm coding an intro to use those new functions i'm writing.

If anyone is interrested I can put the code explaining how to import and use those fonts...just let me know in this post
[sheep]: im sure he wants to goto prison.. they didnt get him last time.. he was promised a big cock up his arse.. and no doubt looking forward to it.. lets hope he gets his wish this year.

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: A tool to create those "binaries" fonts?
« Reply #13 on: February 10, 2007 »
:) That would earn you some Karma I am sure.

Here's a tip when you are using bitmap fonts.. Make sure that you set them out in ASCII order, for example;

Code: [Select]
!"#$%'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ

And you can then do the calculation;

Code: [Select]
ASC(MID(STRING,OFFSET,1))-31

To find your letter.. It's the fastest and most elegant way of coding it :)
Shockwave ^ Codigos
Challenge Trophies Won:

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: A tool to create those "binaries" fonts?
« Reply #14 on: February 10, 2007 »
Here's the one I use (src+exe) to generate the bmp fonts for my engine.
http://members.iinet.net.au/~jimshaw/Yabasic/makefont.zip
You have to watch the bmps it spits out though, they're 24bit uncompressed.
The font I generated for the Blocks demo was 3.9Mb until I loaded it into another package and turned it into 8bit RLE BMP and then it came down to 90Kb.

Jim
Challenge Trophies Won:

Offline .:] Druid [:.

  • freebasic n00b
  • Pentium
  • *****
  • Posts: 563
  • Karma: 47
    • View Profile
    • Intro-Inferno
Re: A tool to create those "binaries" fonts?
« Reply #15 on: February 11, 2007 »
really interresting tool Jim!  Thanks for sharing it!

Shockwave: thanks for the tip and it's how I managed to make it work...but I received some fonts, coming from intros, demos...and most of the time, it's not working as is...so, i use "ASC(MID(STRING,OFFSET,1))" without the -31 and by using a select  I make a ch-n ... working...
The good point of this: if the char is not supported, instead of putting a wrong char, you can select yourself the one you prefer to use...hmm..;by rereading i'm not sure i'm clear in the explanation :s  if it's the case, let me know ;)
[sheep]: im sure he wants to goto prison.. they didnt get him last time.. he was promised a big cock up his arse.. and no doubt looking forward to it.. lets hope he gets his wish this year.

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: A tool to create those "binaries" fonts?
« Reply #16 on: March 02, 2009 »
Pixel Outlaw requested a version that does all the extra DOS characters, 128-255.  Here it is
http://members.iinet.net.au/~jimshaw/makefont256.zip

Jim
Challenge Trophies Won:

Offline Pixel_Outlaw

  • Pentium
  • *****
  • Posts: 1382
  • Karma: 83
    • View Profile
Re: A tool to create those "binaries" fonts?
« Reply #17 on: March 02, 2009 »
It is a great update!


I'll probably use this more in the future!

EDIT

I just got the font I needed working. This is a great tool Jim.
« Last Edit: March 02, 2009 by Pixel_Outlaw »
Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: A tool to create those "binaries" fonts?
« Reply #18 on: March 02, 2009 »
Thanks Jim :)
Shockwave ^ Codigos
Challenge Trophies Won:

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: A tool to create those "binaries" fonts?
« Reply #19 on: March 03, 2009 »
It needs another screen up-front before I release it.  Right now if I want a variable width font on a blue background I just go into the source and change it.
3 things need selecting:
1) Fixed or Variable spacing
2) Background Colour
3) Width/Height of texture.  Right now, 256 wide by any height.  To allow gfx to be packed together vertically ;)  And the variable width code writes out the uv's in format known only to myself...

Jim
Challenge Trophies Won: