Using FON or TTF

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
QBASICKER
Newbie
Posts: 1
Joined: Tue Nov 25, 2008 11:08 pm

Using FON or TTF

Post by QBASICKER » Tue Nov 25, 2008 11:10 pm

Hello guys,

I searched over and over and didn't found anything (well, i did found a library for using TTF files, but it just doesn't work) about this. I would like to use Courier New for an application i'm building and i need to know how to use TTF or FON font files.

User avatar
burger2227
Veteran
Posts: 2435
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Post by burger2227 » Wed Nov 26, 2008 12:17 am

Got to love that name! Why did you add the "K"? There is no K in Qbasic...... Are you SICK?

You can use a Paint program to make bitmaps of fonts and use them in QB with graphics functions. You will need a bitmap loader program in QB.

Ted
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0

User avatar
Nodtveidt
Veteran
Posts: 826
Joined: Sun Jul 25, 2004 4:24 am
Location: Quebradillas, PR
Contact:

Post by Nodtveidt » Wed Nov 26, 2008 5:39 am

In order to use fonts directly in QBasic, you would need to be able to parse the format and recreate the structure. FON is quite a bit easier (raster-based); you would have to have a good grasp of vectors to handle TTF. burger's idea is better if you don't want to have to go through the trouble of reading the files directly, though it'll take work too.

OPRESION
Veteran
Posts: 61
Joined: Tue Jan 16, 2007 4:15 am
Location: Mexico

*.FNT

Post by OPRESION » Fri Dec 05, 2008 1:35 am

http://www.geocities.com/SiliconValley/ ... entes.html

Here it is a program to make fonts for the DOS; it's in spanish but it has Quickbasic's source to be able to use the fonts you create in your programs.

It has 90 fonts already made including 'Courier New'. The type of tonts are *.FNT, all of them of 4096 bytes.
MY PAGE: http://Qbasic.phatcode.net" target="_blank
(I ONLY USE WINDOWS 98SE YET, BELIEVE IT OR NOT)

Ralph
Veteran
Posts: 148
Joined: Fri Feb 09, 2007 3:10 pm
Location: Katy, Texas

Post by Ralph » Sun Dec 07, 2008 11:27 pm

Opreson: Thanks for the url, it certainly lools promising! I have downloaded it, and, when I ran the file, "LEEFONT.BAS", it reports the error message, "Sub program not defined", and points to the word CALL, in the line. "CALL INTERRUPTX)&H10, reg1, reg2)" How do I proceed? Hope you can help me here.
Ralph, with QuickBASIC 4.5, operating under Windows XP, wiht anHP LaserJet 4L Printer. Bilingual in English/Spanish

User avatar
burger2227
Veteran
Posts: 2435
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Poor Raphie Boy!

Post by burger2227 » Mon Dec 08, 2008 3:57 am

Try loading QB.EXE / L for the library in 4.5

Are you getting senile on us?

Ted
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0

Ralph
Veteran
Posts: 148
Joined: Fri Feb 09, 2007 3:10 pm
Location: Katy, Texas

Post by Ralph » Mon Dec 08, 2008 7:48 pm

Of course now, Ted! I've been that way for the last 10 years. But, here's my data:

I have a "shortcut" whtich reads, in the "Program" tab,
c:\qb\qb.exe /ad/L
Is this not correct?
Ralph, with QuickBASIC 4.5, operating under Windows XP, wiht anHP LaserJet 4L Printer. Bilingual in English/Spanish

User avatar
burger2227
Veteran
Posts: 2435
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Post by burger2227 » Mon Dec 08, 2008 8:24 pm

I Don't know what /ad does, but I just use the path and QB.EXE /L for the library.

Here is a batch file command line that I use to keep my IP connection in XP:

Code: Select all

REM Line below for use with XP or NT PC's only! REM out for Win 9x.
REM       Arrays huge, QLB library 
REM START QB.EXE /L QB.QLB /AH 
REM     Low resouces with window maximized
REM cmd /c start /low /max qb.exe /L

REM     Low resouces used when QB affects internet connections
CMD /C START /LOW QB.EXE /L


REM      Use line below for Win 9x PC's only! 
REM To use just REM out START line and remove REM from below line

REM QB.EXE /L
You do not need a path when the BAT file is in the QB.EXE folder.

Ted
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0

User avatar
Nodtveidt
Veteran
Posts: 826
Joined: Sun Jul 25, 2004 4:24 am
Location: Quebradillas, PR
Contact:

Post by Nodtveidt » Mon Dec 08, 2008 9:35 pm

/AD? Doesn't sound like a valid switch. /A, /D, and /AH are all valid. Maybe it's just a typo, or maybe Ralph knows something we don't...

User avatar
burger2227
Veteran
Posts: 2435
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Post by burger2227 » Mon Dec 08, 2008 9:37 pm

I'd bet on a typo! LOL sometimes he can't spell his name correctly.......
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0

Ralph
Veteran
Posts: 148
Joined: Fri Feb 09, 2007 3:10 pm
Location: Katy, Texas

Post by Ralph » Mon Dec 08, 2008 10:47 pm

Ha, ha, yes, it WAS a typo. The line was, c:\qb\qb.exe /AH/L, so, I changed it to, c:\qb\qb.exe /L, but this gives me the same error as originally... What;s next?

Ted: My shortcut is in a folder called Office, which I have as a sidebar on the left side of the screen, with the property, Hide. So, I need the full paths to qb.exe.
Ralph, with QuickBASIC 4.5, operating under Windows XP, wiht anHP LaserJet 4L Printer. Bilingual in English/Spanish

User avatar
burger2227
Veteran
Posts: 2435
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Post by burger2227 » Mon Dec 08, 2008 11:10 pm

You could make a new shortcut in the QB folder and add the space /L to it. Try that. If you want to put it on the desktop just copy it there.

Why do you need /AH anyway? I seldom use that anyhow.

Ted
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0

Ralph
Veteran
Posts: 148
Joined: Fri Feb 09, 2007 3:10 pm
Location: Katy, Texas

Post by Ralph » Tue Dec 09, 2008 6:23 pm

Sorry for the delay in my response, Ted.

After struggleing with my problem, I finally decided that, unless I changed a number of things, I was not going to be able to run the program successfully, I copped out! I just made a new folder, in C:, called Fuentes, with all the fuentes files there. Then, I copied the QB program files (all 21 of them, such as qb.exe, etc.). Now everything runs, the font chosen by the LEEFONT.BAS is loaded, and ... the program stops, with the message, "FUENTE ACTIVADA!!! OK, what does one do now? Maybe Opresion can answer this?
Ralph, with QuickBASIC 4.5, operating under Windows XP, wiht anHP LaserJet 4L Printer. Bilingual in English/Spanish

Ralph
Veteran
Posts: 148
Joined: Fri Feb 09, 2007 3:10 pm
Location: Katy, Texas

Post by Ralph » Tue Dec 09, 2008 7:39 pm

Ted:

As to the "Why do you need /AH?", well, I don't. It's just that I had a round with trying to find out what the largest possible array sizes were, and that reauired the /AH switch; I have now taken it out.

Now, I'm sure that copying all the program files for qb into the folder where files for a particular qb program reside is not the normal way to operate. In my way of thinkiong, I have this path, C:/qb for my qb files, then, a number of folders under that qb "mother" folder. Normally, I don't use library calls, so, by just double clicking on any of my programs, qb starts up and loads that file. Then, I can run it fine.

So, what would be the best way to make sure that files requiring libraries run propaerly? Would copying the .lib files to the folder requiring librayries be it? Or, is there a better way. I don't want to copy all my qb program files to the "mother" folder, even though that would ensure their running. I would appreciate hearing from you on this. Thanks.

Ted: Did I spell things OK? I have what is called "macular degeneration", which is progressive and makes it difficult to make out letters, at my present stage, so, I expect to "typo" here and there. Please forgive me, in advance.
Ralph, with QuickBASIC 4.5, operating under Windows XP, wiht anHP LaserJet 4L Printer. Bilingual in English/Spanish

User avatar
burger2227
Veteran
Posts: 2435
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Post by burger2227 » Tue Dec 09, 2008 8:12 pm

All library and other QB files should be together. If you want to put the LIBrary, Include, and Help folders in different areas, you have to set the paths in QB options.

I have all of my programs in one folder with all of the QB EXE files. You can create batch files to run programs in other folders. That is too much work to me.

Sorry to hear about your eyes! I won't joke about typo's anymore.

Ted

PS: What does "FUENTE ACTIVADA!!!" mean? lol
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0

Ralph
Veteran
Posts: 148
Joined: Fri Feb 09, 2007 3:10 pm
Location: Katy, Texas

Post by Ralph » Tue Dec 09, 2008 10:24 pm

FUENTE ACTIVADA" menas "FONT ACTIVATED" (of course, now that you know, you?ll exclaim, ?It?s obvious!?, right?

Even though Opresion recommended using this program, it is ALL in Spanish, so it would be too difficult to use for a person who does not know Spanish. It is well presented, but I am having problems in using it, But, again, that?s standard, for me. I need all things to be ?logical?, as I am not an intuitive person. I guess that comes from my engineering/mathematical background, in which all is black and white?most of the time, anyway!

Ted, I did primary school here, in New Orleans, then did high school and university, plus ten more years, in Costa Rica, then, since 1966, I?ve worked as an electrical engineer (power), so, I consider myself a 100% bi-lingual person. If you need any translation between Spanish and English, or vice-versa, I?m your man, so to speak.

That's OK, I can take a ribbing and laught with the ribber. I have found that this keeps the peace, and reaps far more rewards for all, than to get upset and angry. I still remember my first encounter with you, inwhich you called me Ralphie and sonny. I thought that yo probably believed I was in the first year of high school, but, I decided to just roll with the punhes and laugh with you. And, it worked! You've treated me decently, even though you just can't control your quips and humor! But, that's OK with me. You make me laugh, most of the time. Just please don't keep
kidding others, when they show that they don't like the jabs!


Edited a little later, as follows:
Say, I hjappened to read your post again, Ted, and I think that you elieve that I have various QB files, such as libraries, Include files, and Help files in different folders. No, I call these and similar, qb files. The .bas files and such, I call qb program files. Is there a better way to talk about this two group of files?
Ralph, with QuickBASIC 4.5, operating under Windows XP, wiht anHP LaserJet 4L Printer. Bilingual in English/Spanish

User avatar
burger2227
Veteran
Posts: 2435
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Post by burger2227 » Tue Dec 09, 2008 10:50 pm

No, I never assumed you were in highschool! Gradeschool perhaps, lol.
The typing was what made me wonder though, but many programmers are so used to the IDE, they think it will just fix itself.

I don't know how to arrainge your files, but I just toss them all into the same folder. I can't seem to use OPEN WITH QB for the Libraries in XP. You can associate Notepad text files to open in QB though. Just no library and all associated reference files have to be in the QB folder.

I don't see you much except here lately. And that has been a while! I saw that you are an "Ancient Guru" at QBNews. So I figured you were about my age. Most of the people playing with QB are a lot younger so they might not understand some of our jokes. Oh well.........

Ted
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0

Ralph
Veteran
Posts: 148
Joined: Fri Feb 09, 2007 3:10 pm
Location: Katy, Texas

Post by Ralph » Wed Dec 10, 2008 9:13 pm

Getting back to FUENTES (FONTS). Unzipping the original file, fuentes.zip, gives two folders, IMAGENES (IMAGES, all .GGP files), and TIPOS (TYPES, or FONTS, all .fnt files), and eight more files. Of these, FUENTES.TXT pretty much explains how to use these files.

As I said previously, all is in Spanish.

Regarding my question for LLEFONT.BAS (READFONT.BAS) and the resulting ?FUENTED ACTIVADA?, I now have found my answer. I now see that this program loads a particular font in memory. The font files are binary files. And, that is what that program does, that?s why it prints the ?FONT ACTIVATED?, and then stops. As to how to use them, for me, that is another story, which I might attempt on some rainy day, but, not tonight!

As to my not appearing in other places, I got too tired of the constant chat talk in the site I think you mean, so, I?ve gone back to this site and QasicNews, at least for a while. Also, my wife broke one of her femurs recently, and I?m spending a lot of time at her side at the hospital. She is steadily improving in a rehabilitaion hospital, and will be coming home soon. Then, I?ll get more time on the computer and the forums.
Ralph, with QuickBASIC 4.5, operating under Windows XP, wiht anHP LaserJet 4L Printer. Bilingual in English/Spanish

User avatar
burger2227
Veteran
Posts: 2435
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Post by burger2227 » Thu Dec 11, 2008 12:04 am

Two years ago I broke my right femur ball off and had a new hip socket and ball put on. Very painfull! Take care of her dude.

I cannot wait to find fun again! I don't have anybody to argue with, but posts about QB. And I think that you are worth more than that!

Ted
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0

Post Reply