Page 1 of 1

Defining more than one font at the same time ?

Posted: Wed Sep 15, 2010 1:00 pm
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 :)

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

Posted: Wed Sep 29, 2010 3:00 pm
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)

:)

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

Posted: Thu Dec 26, 2013 5:38 pm
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...

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

Posted: Thu Dec 26, 2013 6:59 pm
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.

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

Posted: Thu Dec 26, 2013 7:34 pm
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

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

Posted: Fri Dec 27, 2013 10:48 am
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:

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

Posted: Fri Dec 27, 2013 1:21 pm
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

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

Posted: Sat Dec 28, 2013 10:08 am
by NightRadio
Thanks, and happy new year too! :)

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

Posted: Mon Apr 07, 2014 12:28 am
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 :)

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

Posted: Fri Jun 20, 2014 3:05 pm
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.

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

Posted: Fri Jun 20, 2014 7:46 pm
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..?

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

Posted: Mon Jun 23, 2014 1:20 am
by xaccrocheur
Hum. So I guess nobody here knows how to do this? NightRadio, what can I possibly do to get this information?

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

Posted: Tue Jun 24, 2014 7:27 pm
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 :)

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

Posted: Wed Jul 02, 2014 12:56 am
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 :)