Defining more than one font at the same time ?

Pixilang programming language
Post Reply
User avatar
spiny
Posts: 46
Joined: Mon Jul 19, 2010 4:28 pm

Defining more than one font at the same time ?

Post by spiny »

Hi,
I have 'drawn' a nice 32x32 font which I'm using for a scroller, but I would also like a small 8x8 font to stick some other text on screen.
Is it possible to define more than one font ? also what does: "get_pixi_font - get current font-image" actually do ? can it be used to swap fonts during a program ?

cheers, Phil :)
User avatar
spiny
Posts: 46
Joined: Mon Jul 19, 2010 4:28 pm

Re: Defining more than one font at the same time ?

Post by spiny »

ah, this was a really stupid question :D

I can just define as many as I like and swap between them during the program with

pixi_font (whatever)

:)
User avatar
samrai katt kovboy
Posts: 309
Joined: Wed Jun 13, 2012 11:07 am
Location: Spain
Contact:

Re: Defining more than one font at the same time ?

Post by samrai katt kovboy »

I am in the same situation as you and have realized that the only way to get into Pixilang is to start to study some programming.
The easiest way to me seems to be to start with Processing as there is a lot of good tutorials for beginners and most of them make you learn by doing some more fun and interesting coding to get you to learn step by step...
SOOOOOOOOOOOOOOO MANY CIRCLES
User avatar
NightRadio
Site Admin
Posts: 3941
Joined: Fri Jan 23, 2004 12:28 am
Location: Ekaterinburg. Russia
Contact:

Re: Defining more than one font at the same time ?

Post by NightRadio »

It's my fault.
Right now the Pixilang is very useful language for my own projects. But i have no enough time to make the good tutorials. Sorry :( I will try to do this in future...
But now you can ask absolutely anything on this forum. I'm always ready to answer.
User avatar
samrai katt kovboy
Posts: 309
Joined: Wed Jun 13, 2012 11:07 am
Location: Spain
Contact:

Re: Defining more than one font at the same time ?

Post by samrai katt kovboy »

But Mr Nightradio!
There is 24 hours in a day and if you only cut out dinners, lunch and sleep you will have some time!
Stop using silly excuses that you do not have time!!!
Because we want tutorials and one update after another every week on all your programs plus at least a new revolutionary program once a month!
You can do it! You can do it!!!
We are tired of you slacking around instead of satisfying our thirst for more excitement!
Just sleeping long into the afternoon playing with your cat/s and then taking looong siestas, c'mon...
I bet you do not even spend twenty minutes a week coding!

Ti hi
SOOOOOOOOOOOOOOO MANY CIRCLES
User avatar
NightRadio
Site Admin
Posts: 3941
Joined: Fri Jan 23, 2004 12:28 am
Location: Ekaterinburg. Russia
Contact:

Re: Defining more than one font at the same time ?

Post by NightRadio »

Because we want tutorials and one update after another every week on all your programs plus at least a new revolutionary program once a month!
Oh, ok :oops:
User avatar
samrai katt kovboy
Posts: 309
Joined: Wed Jun 13, 2012 11:07 am
Location: Spain
Contact:

Re: Defining more than one font at the same time ?

Post by samrai katt kovboy »

Hey Mr Nightradio...
Even if you stopped now doing anything more you would still be a hero and the only sad thing would be when the programs stop working for one reason or another.
Spectacular creations and today will be a whole day dedicated to Virtual ANS and the last five days have been taking as much time as possible to compose in SunVox...
Just love your programs!
It will be so cool when Pixilang and SunVox play nicely together even if I can not code but just to take advantage of other peoples creations!

Happy NEW YEAR to you and can not wait to see what your brain + time will bring us for 2014!

mjiauuu mjiauuu mjiau
SOOOOOOOOOOOOOOO MANY CIRCLES
User avatar
NightRadio
Site Admin
Posts: 3941
Joined: Fri Jan 23, 2004 12:28 am
Location: Ekaterinburg. Russia
Contact:

Re: Defining more than one font at the same time ?

Post by NightRadio »

Thanks, and happy new year too! :)
User avatar
spiny
Posts: 46
Joined: Mon Jul 19, 2010 4:28 pm

Re: Defining more than one font at the same time ?

Post by spiny »

like others have said, I found it easiest to just get stuck in and see what works and what didn't - I expect some of the things I couldn't get to work might be possible if I new more about coding, but the more I practice, the more I learn :)
User avatar
xaccrocheur
Posts: 77
Joined: Sat Feb 27, 2010 3:16 pm
Location: Africa
Contact:

Re: Defining more than one font at the same time ?

Post by xaccrocheur »

spiny wrote:
pixi_font (whatever)

:)
You meant set_font(whatever) right? Or is pixi_font() a function that you defined elsewhere? Or maybe a builtin from an earlier version..?

Please, can you kindly show me how set_font() works, so I can understand how to use different fonts (well, actually the same, only resized at 200% (w/o interpolation) at the same time? And if it is not possible (after all, no example file shows text displayed in more than one way) please, tell me.
Yassin Philip - Check out My music =@
User avatar
xaccrocheur
Posts: 77
Joined: Sat Feb 27, 2010 3:16 pm
Location: Africa
Contact:

Re: Defining more than one font at the same time ?

Post by xaccrocheur »

Why is nobody answering me? I really need an answer to this question :

Is it possible to print() two fonts at the same time ?

A simple "no" would be really useful. And if it is possible, a quick example would really boost my understanding of Pixilang.
Apparently, print() creates a container. Maybe this container can be re-shaped..?
Yassin Philip - Check out My music =@
User avatar
xaccrocheur
Posts: 77
Joined: Sat Feb 27, 2010 3:16 pm
Location: Africa
Contact:

Re: Defining more than one font at the same time ?

Post by xaccrocheur »

Hum. So I guess nobody here knows how to do this? NightRadio, what can I possibly do to get this information?
Yassin Philip - Check out My music =@
User avatar
NightRadio
Site Admin
Posts: 3941
Joined: Fri Jan 23, 2004 12:28 am
Location: Ekaterinburg. Russia
Contact:

Re: Defining more than one font at the same time ?

Post by NightRadio »

You can't use two fonts within one print() call. But you can do it by using two print() calls with switching between different fonts :)
User avatar
spiny
Posts: 46
Joined: Mon Jul 19, 2010 4:28 pm

Re: Defining more than one font at the same time ?

Post by spiny »

xaccrocheur wrote:
spiny wrote:
pixi_font (whatever)

:)
You meant set_font(whatever) right? Or is pixi_font() a function that you defined elsewhere? Or maybe a builtin from an earlier version..?

Please, can you kindly show me how set_font() works, so I can understand how to use different fonts (well, actually the same, only resized at 200% (w/o interpolation) at the same time? And if it is not possible (after all, no example file shows text displayed in more than one way) please, tell me.
I was using v2 of pixilang when I started this thread, the font stuff has changed in v3, so pixi_font (whatever) is no longer a valid command.

V3 uses this (which you probably know) :

font = load( "font5.gif" )
set_font( 32, font, 10, 10 )


to use multiple fonts, just define another one, the code might look like this:

font = load( "font5.gif" )
font2 = load("whatever.gif")
set_font( 32, font, 10, 10 )

print( "font one", 0, 100)
set_font( 32, font2, 10, 10 )
print( "font two", 0, 200)

I think :)
Post Reply