TTF Converter for DRAW STRING

Post your FreeBASIC source, examples, tips and tricks here. Please don’t post code without including an explanation.
jofers
Posts: 1525
Joined: May 27, 2005 17:18

TTF Converter for DRAW STRING

Post by jofers »

http://www.betterwebber.com/stuff/ttf_to_gfxlib.zip

EDIT: for version 0.20, use this version:
http://betterwebber.com/stuff/ttf_to_gfxlib_v20.zip

A little Windows GUI program that makes a GfxLib font for DRAW STRING for 32-bit modes from a TTF font. Italic fonts might look a bit akward because right now the DRAW STRING font format has no left/right margin info. But most fonts look decent. Saves the fonts in BMP format.
Last edited by jofers on Jan 12, 2009 23:40, edited 1 time in total.
rdc
Posts: 1741
Joined: May 27, 2005 17:22
Location: Texas, USA
Contact:

Post by rdc »

Very cool.
cha0s
Site Admin
Posts: 5319
Joined: May 27, 2005 6:42
Location: USA
Contact:

Post by cha0s »

this is pimp dude...
redcrab
Posts: 623
Joined: Feb 07, 2006 15:29
Location: France / Luxemburg
Contact:

Post by redcrab »

That's cool... a great example to insert into the FBC sample code distribution package....
Does it exist any issue with copyrighted TTF ?...
If you convert all M$ fonts into BMP to be use as Draw String Font , it's like converting a font format to another font format... then in addition if you distribute these BMP to the community...

Is it a worthly question ?
jofers
Posts: 1525
Joined: May 27, 2005 17:18

Post by jofers »

Fonts are protected under the law, but you can use the fonts that come standard with Windows for free, if I understand. Fancy fonts you'll probably have to buy if you want a 100% thumbs-up from Uncle Sam.
relsoft
Posts: 1767
Joined: May 27, 2005 10:34
Location: Philippines
Contact:

Post by relsoft »

Whoooa!!!!!

that's nize!!!
anonymous1337
Posts: 5494
Joined: Sep 12, 2005 20:06
Location: California

Post by anonymous1337 »

Are there any free from copyright format fonts? Maybe someone should make one if there isn't :P
jofers
Posts: 1525
Joined: May 27, 2005 17:18

Post by jofers »

TTF themselves aren't copyright, it's a pretty open standard, but the fonts themselves are. There are dozens of free fonts on the internet out there, just google for them.
Dr_D
Posts: 2451
Joined: May 27, 2005 4:59
Contact:

Post by Dr_D »

Cool project. It would be nice to have an option to save the bitmap as a square(WxH), instead of just a linear image though. That would be useful for creating fonts for use with OpenGL. I guess there isn't any reason it can't be used the way it is now though. ;)


EDIT: I was unable to open the generated file with Photoshop 6.0. You got any idea why?
Last edited by Dr_D on Jun 28, 2006 1:26, edited 1 time in total.
Sisophon2001
Posts: 1706
Joined: May 27, 2005 6:34
Location: Cambodia, Thailand, Lao, Ireland etc.
Contact:

Post by Sisophon2001 »

I have a CD full of free fonts, but the quality of free TTF tends not to be a good as the fonts the Microsoft ships with windows. I must see if I can find the CD, it had lots of font conversion programs. I am sure if you search online you will find free fonts. Search for bitstream also.

FB programs can be used on Linux, so using copyrighter windows fonts is not ideal. It would be better to find genuine free fonts.

Thanks jofers for this utility.

Garvan
jofers
Posts: 1525
Joined: May 27, 2005 17:18

Post by jofers »

I can open the generated file with CS2 and Paint. But the bmps are only meant to be opened by BLOAD. I don't know the OpenGL font format, but there are utilities already out there for using TTF fonts with OpenGL such as this one.

EDIT:
Arial, Courier, Georgia, Times New Roman, Trebuchet MS, Verdana, Comic Sans MS, Impact, and Webdings are all free to distribute, so don't worry about using any of the standard "web" fonts with your programs.

Also, a good place to find free fonts is to google for "open fonts", there are quite a few people collecting them.
Last edited by jofers on Jun 28, 2006 2:00, edited 1 time in total.
relsoft
Posts: 1767
Joined: May 27, 2005 10:34
Location: Philippines
Contact:

Post by relsoft »

Try this site ;*)

Courtesy of a link from DBF...
http://cooltext.com/Default.aspx

It's a free foa ll font archive!!!
Dr_D
Posts: 2451
Joined: May 27, 2005 4:59
Contact:

Post by Dr_D »

jofers wrote:I can open the generated file with CS2 and Paint. But the bmps are only meant to be opened by BLOAD. I don't know the OpenGL font format, but there are utilities already out there for using TTF fonts with OpenGL such as this one.

I've been using that program for a while now, but I just thought it would be cool to have a FreeBASIC program that replaced it. Whenever possible, I use homegrown FB stuff. ;)

EDIT: I also wanted to show you something...

This is image is of the native FB text, saved directly from FB.
Image

This is the quality of the Font builder image of the same size.
Image
sir_mud
Posts: 1401
Joined: Jul 29, 2006 3:00
Location: US
Contact:

Post by sir_mud »

Works with WINE under linux just fine. But the produced bitmaps don't seem to be in the correct format and don't work.
jevans4949
Posts: 1186
Joined: May 08, 2006 21:58
Location: Crewe, England

Post by jevans4949 »

anonymous1337 wrote:Are there any free from copyright format fonts? Maybe someone should make one if there isn't :P
Yes, there are plenty of free fonts out there, although most are wacky designs.

Most, I believe, have a copyright statement; I guess you may be able to negotiate with the artist to convert the format. If they are offering it free, why should they object, provided they get a mention?
Post Reply