Defining more than one font at the same time ?

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

Defining more than one font at the same time ?

Postby spiny » Wed Sep 15, 2010 1:00 pm

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 ?

Postby spiny » Wed Sep 29, 2010 3:00 pm

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: 306
Joined: Wed Jun 13, 2012 11:07 am
Location: Spain
Contact:

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

Postby samrai katt kovboy » Thu Dec 26, 2013 5:38 pm

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: 2751
Joined: Fri Jan 23, 2004 12:28 am
Location: Ekaterinburg. Russia
Contact:

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

Postby NightRadio » Thu Dec 26, 2013 6:59 pm

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: 306
Joined: Wed Jun 13, 2012 11:07 am
Location: Spain
Contact:

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

Postby samrai katt kovboy » Thu Dec 26, 2013 7:34 pm

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: 2751
Joined: Fri Jan 23, 2004 12:28 am
Location: Ekaterinburg. Russia
Contact:

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

Postby NightRadio » Fri Dec 27, 2013 10:48 am

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: 306
Joined: Wed Jun 13, 2012 11:07 am
Location: Spain
Contact:

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

Postby samrai katt kovboy » Fri Dec 27, 2013 1:21 pm

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: 2751
Joined: Fri Jan 23, 2004 12:28 am
Location: Ekaterinburg. Russia
Contact:

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

Postby NightRadio » Sat Dec 28, 2013 10:08 am

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 ?

Postby spiny » Mon Apr 07, 2014 12:28 am

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: 66
Joined: Sat Feb 27, 2010 3:16 pm
Location: Africa
Contact:

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

Postby xaccrocheur » Fri Jun 20, 2014 3:05 pm

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.
Check out My music but be warned, it will blow your mind =@

User avatar
xaccrocheur
Posts: 66
Joined: Sat Feb 27, 2010 3:16 pm
Location: Africa
Contact:

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

Postby xaccrocheur » Fri Jun 20, 2014 7:46 pm

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..?
Check out My music but be warned, it will blow your mind =@

User avatar
xaccrocheur
Posts: 66
Joined: Sat Feb 27, 2010 3:16 pm
Location: Africa
Contact:

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

Postby xaccrocheur » Mon Jun 23, 2014 1:20 am

Hum. So I guess nobody here knows how to do this? NightRadio, what can I possibly do to get this information?
Check out My music but be warned, it will blow your mind =@

User avatar
NightRadio
Site Admin
Posts: 2751
Joined: Fri Jan 23, 2004 12:28 am
Location: Ekaterinburg. Russia
Contact:

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

Postby NightRadio » Tue Jun 24, 2014 7:27 pm

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 ?

Postby spiny » Wed Jul 02, 2014 12:56 am

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 :)


Return to “Pixilang”

Who is online

Users browsing this forum: No registered users and 1 guest

cron