Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 fonts
Index -> Programming, Turing -> Turing Help
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
noobprogrammer123




PostPosted: Tue Mar 23, 2004 8:05 am   Post subject: fonts

i just started using turing and im not sure how to change the font of words
Sponsor
Sponsor
Sponsor
sponsor
Dan




PostPosted: Tue Mar 23, 2004 11:25 am   Post subject: (No subject)

when using only the put comand to put text on the screen you can only chage the color and loaction but not the font for size.

Alougth there is another comand (Font.Draw) that will let you chage the size and font of the text it displays but it can only display strings and not ints or other types (unless you covert them to string)

you can find out more info about this comand here: http://www.compsci.ca/v2/viewtopic.php?t=967
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
Paul




PostPosted: Tue Mar 23, 2004 5:15 pm   Post subject: (No subject)

Yep, I hate how you can't change the font without accessing the graphics part of Turing.
Jodo Yodo




PostPosted: Tue Mar 23, 2004 5:36 pm   Post subject: (No subject)

Is there anyway to use a custom font without installing it into the whole WINDOWS folder thing? I use it on a school computer, and they restrict our access from the fonts. Thus, I have no idea how to use the custom font. Does anyone know how I can use it?
Thuged_Out_G




PostPosted: Tue Mar 23, 2004 5:43 pm   Post subject: (No subject)

you could TRY.. to just put in the full pathname of the font you want to use, but i dont know for sure if it will work. just an idea. someone posted a turing program to make your own fonts...use that Laughing lol
Mazer




PostPosted: Tue Mar 23, 2004 8:17 pm   Post subject: (No subject)

Jodo Yodo wrote:
Is there anyway to use a custom font without installing it into the whole WINDOWS folder thing? I use it on a school computer, and they restrict our access from the fonts. Thus, I have no idea how to use the custom font. Does anyone know how I can use it?

Yeah, that kinda pisses me off. For my final project last year I wanted to use some cool fonts that the school computers didn't have. I actually tried using turing's File.Copy function to put the font in the FONTS directory and even though that worked, the font couldn't actually be installed like that. Luckily that was back when you could easily get into the C: with modified shortcuts and I could place the font in there myself. Just talk to your teacher and see if he can make sure he has those fonts when he runs the program.
Jodo Yodo




PostPosted: Tue Mar 23, 2004 10:17 pm   Post subject: (No subject)

Putting in the path name doesn' t work, and I asked my teacher, and he said no (he said if he did it for me, he would have to do it for everyone), which sucks. Now I have to do a Star Wars-esque program with Arial. Boo.
Mazer




PostPosted: Wed Mar 24, 2004 7:41 am   Post subject: (No subject)

Damn. Just more proof that I should have admin access at school Razz
OK, worst vase scenario, I guess if you don't have alot to do using Font.Draw and the text is all hardcoded you could probably just make it in paint using the Star Wars font (Star Vader?) and save it as a pic.
Sponsor
Sponsor
Sponsor
sponsor
BioHazardousWaste




PostPosted: Thu Mar 25, 2004 2:46 pm   Post subject: (No subject)

Dudes, and Dudettes... I have a problem

I was sitting here, working on my final project, as usual. I am just about done the first section, and I started importing pics and BG. Now, whenever I use put it overwrites the BG with whatever colorback is set too. Evil or Very Mad

So I looked up the Font stuff, and it was simple enough, after some bitching about having to use x,y co-ords... but oh well. Then I ran into a problem. VARIABLES {dun, dun, dun}... So I browsed compsci.ca for 20 mins or so and found the answer, posted by Tony

Quote:
it doesnt work the same way was put does. See those commas? It actually things that the variable name is the next argument for the function, so it gets confused. You should use + sign instead to add strings together.


BUT It still doesn't work, because the variable I want to display is an integer; so I get the error "Operands of '+' must both be integer or real, compatible sets, or strings"

So does someone know of a way to fix this besides using a LOT of draw commands? (one for text, then a seperate one for variable, then another one for ending text)

code:


var MaxRoidScan : int := 500 %any variable

Font.Draw ("How many would you like? (max " + MaxRoidScan + ")", 375, 275, FntRegular, white)
Dan




PostPosted: Thu Mar 25, 2004 5:05 pm   Post subject: (No subject)

i dont got turing on this comp, but dose this work:

var temp :string := "How many would you like? (max " + MaxRoidScan + ")"
Font.Draw (temp, 375, 275, FntRegular, white)
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
Hackster




PostPosted: Thu Mar 25, 2004 6:35 pm   Post subject: (No subject)

no it does not, ... what the heck is "MaxRoidScan" anyway?
Mazer




PostPosted: Thu Mar 25, 2004 9:50 pm   Post subject: (No subject)

It seems to me that MaxRoidScan, as seen in BioHazardousWaste's program, is as integer. So the only thing you need to do is convert it to a string. And by that I mean:
code:

Font.Draw ("How many would you like? (max " + intstr (MaxRoidScan) + ")", 375, 275, FntRegular, white)
Dan




PostPosted: Thu Mar 25, 2004 10:20 pm   Post subject: (No subject)

oh sorry about that, i was thinking about the java where u dont have to covert. coverting to string should fix that up, thank u mazer for corcting me.
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
Jodo Yodo




PostPosted: Thu Mar 25, 2004 10:47 pm   Post subject: (No subject)

You can intstr the variable. Do it like this:

code:

var MaxRoidScan : int := 500 %any variable
var MaxRoidOtherScan : string

MaxRoidOtherScan := intstr (MaxRoidScan)

Font.Draw ("How many would you like? (max " + MaxRoidOtherScan + ")", 375, 275, FntRegular, white)


SUPER JUICY!
BioHazardousWaste




PostPosted: Fri Mar 26, 2004 9:50 am   Post subject: (No subject)

Thanx guys, once again I owe you...

Game is mostly a textbased (HTML) inter-planetary combat, turn based, strategy type game lol. (I got the idea from www.planetarion.com)

and a MaxRoidScan is the maximum number of asteroids a person can scan for... (asteroids produce resources)
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 2  [ 17 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: