Register | Login
Views: 19364387
Main | Memberlist | Active users | ACS | Commons | Calendar | Online users
Ranks | FAQ | Color Chart | Photo album | IRC Chat
11-02-05 12:59 PM
0 user currently in Programming. | 3 guests
Acmlm's Board - I2 Archive - Programming - PHP / Javascript text to image generator | |
Pages: 1 2Add to favorites | "RSS" Feed | Next newer thread | Next older thread
User Post
Yarx

Keese
That Zelda Fanatic
i am a wootest!
Danicess Snuggle Slave!
Fragapalooza!
RTFM!

Level: 20

Posts: 75/133
EXP: 37485
For next: 4954

Since: 03-15-04
From: Edmonton

Since last post: 132 days
Last activity: 18 days
Posted on 06-07-04 11:52 PM Link | Quote
Ahh, I did that in mine. Making them multiple lines. Basically I assume you are tracking the X coordinate in the image correct? To know where the next letter goes? Well all you have to do is track a Y coodinate as well. When you want to jump to the next line, you increment Y by however far down the next line will be (Line Feed), and then set X to 0 so that it goes to the begining of the line (Carriage Return).

As for resizing the base image. In mine, I step through the string and keep track of the height needed. Then after it's itterated through the entire string, I create my base image. Then using almost the exact same piece of code, do it again. Only this time I'm actually rendering the image, not just tracking coordinates for image size.
Weasel
Missionary in Peru
Level: 34

Posts: 396/454
EXP: 236444
For next: 17207

Since: 03-15-04
From: Washington

Since last post: 467 days
Last activity: 339 days
Posted on 06-08-04 12:05 AM Link | Quote
My problem is that I just altered numgfx.php a bit, so I'm not really aware of how to use PHP's image functions.
Elric

Chasupa


Currently Playing:
You Like A Lute.
Level: 40

Posts: 184/687
EXP: 440016
For next: 1293

Since: 03-15-04
From: Melniboné

Since last post: 6 hours
Last activity: 6 hours
Posted on 06-08-04 05:39 AM Link | Quote
I did the same thing Weasel did. For me, that puts all the letters into a for(); loop:

for($i=0;$i<$len;$i++){
$d=$n[$i];
if($d=="A") $d=1;
if($d=="B") $d=2;
if($d=="C") $d=3;
[more code here]
if($d=="y") $d=51;
if($d=="z") $d=52;
if($d==" ") $d=0;
ImageCopy($img,$gfx,($i+$ofs)*8,0,$d*8,0,8,8);
}
That's obviously not the whole code, but I think you get the idea.

I know that one of those 8's in the ImageCopy(); at the end is the height, since all the letters in the font are 8x8. Just not sure which.
Xkeeper
The required libraries have not been defined.
Level: NAN

Posts: -4147/-863
EXP: NAN
For next: 0

Since: 03-15-04

Since last post: 2 hours
Last activity: -753366 sec.
Posted on 06-12-04 09:34 AM Link | Quote

And I made my own font. I didn't use one from another game

You know, if you really want me to, I'll show you how I did it.

I can't believe I did something so simple with just the idea from someone else; I coded it, and I know diddily squat about it. I just played with it.

Hell, I even made this:


Which, depending on the two numbers you give it, will generate different sized bars. If one goes over 100, the smaller one will shrink proportonately.

And I did all of my work off of a modified numgfx, hence "numgfxl.php", for "numgfx long" [originally] or "numgfx letters" [just came up with it]

Edit: Even my little Pulse script works off of the same engine, just using expthing.php or whatever it's called [it also uses ?n= hehe]



I just downloaded the origonal Pulse script and had some fun... and if you notice, it ONLY does that with MY ID... any one else's will just return keys and rank


(edited by Xkeeper on 06-12-04 12:36 AM)
tz
Newcomer
Level: 4

Posts: 3/4
EXP: 193
For next: 86

Since: 03-25-04

Since last post: 505 days
Last activity: 339 days
Posted on 06-13-04 05:54 PM Link | Quote




It was sort of a "phase" I went through, making these things for fonts from a lot of games; it definitely passed quickly though :|
Also, it seems that I am doing variable width and character coordinate stuff differently from everybody else...
Actually, instead of having to deal with coordinates in a multiple-character-high image, I first wrote a script to dissect the original font image and output an image that is only one character high, with the characters in ascii order. It might seem like a weird extra step, but it makes writing the invididual text output scripts a lot simpler.

As for variable width, I just have an associative array that contains the widths of certain characters.
I would post the source, but it is incredibly messy; perhaps I will clean it up, and then post it.


(edited by tz on 06-13-04 09:06 AM)
(edited by tz on 06-13-04 09:07 AM)
Elric

Chasupa


Currently Playing:
You Like A Lute.
Level: 40

Posts: 215/687
EXP: 440016
For next: 1293

Since: 03-15-04
From: Melniboné

Since last post: 6 hours
Last activity: 6 hours
Posted on 06-14-04 09:13 AM Link | Quote
Spoiler:

tz
Newcomer
Level: 4

Posts: 4/4
EXP: 193
For next: 86

Since: 03-25-04

Since last post: 505 days
Last activity: 339 days
Posted on 06-14-04 11:46 PM Link | Quote
For the slash thing, try using stripslashes().

Also, I decided that since my FFT script is coded so poorly, cleaning it up will probably not help... so you can see it here.


(edited by tz on 06-14-04 02:47 PM)
(edited by tz on 06-14-04 03:02 PM)
Elric

Chasupa


Currently Playing:
You Like A Lute.
Level: 40

Posts: 223/687
EXP: 440016
For next: 1293

Since: 03-15-04
From: Melniboné

Since last post: 6 hours
Last activity: 6 hours
Posted on 06-15-04 01:20 PM Link | Quote
Originally posted by tz
For the slash thing, try using stripslashes().
I have no idea how to use that right.

As I posted earlier, my stuff is in a for { if() } loop...

This is how it's set up for the \ character:

if($d=="\\") $d=80;

I tried making it the following, all with no luck:

if($d=="\\") $d=stripslashes(80);
if($d=="\\") $d=stripslashes($_GET['80']);
if($d=="\\") $d=stripslashes($_GET['d']);
if($d=="\\") $d=stripslashes($_GET['d']) $d=80;

I even tried just putting it near the top, like this:

for($i=0;$i<$len;$i++){
$d=$n[$i];
$d=stripslashes(%_GET['d]);
if($d=="A") $d=1;

How should I do it?
Xkeeper
The required libraries have not been defined.
Level: NAN

Posts: -4035/-863
EXP: NAN
For next: 0

Since: 03-15-04

Since last post: 2 hours
Last activity: -753366 sec.
Posted on 06-16-04 02:10 PM Link | Quote







Alrighty, I'll show you how I did it soon enough. Just let me try and optimize it some more, kay? ^^


(edited by Neko-Areksuchan on 06-16-04 05:12 AM)
Elric

Chasupa


Currently Playing:
You Like A Lute.
Level: 40

Posts: 226/687
EXP: 440016
For next: 1293

Since: 03-15-04
From: Melniboné

Since last post: 6 hours
Last activity: 6 hours
Posted on 06-16-04 03:30 PM Link | Quote
Sure, optimize away!

Those fonts look nice, by the way. I need to make a good one. Hmm...
Pages: 1 2Add to favorites | "RSS" Feed | Next newer thread | Next older thread
Acmlm's Board - I2 Archive - Programming - PHP / Javascript text to image generator | |


ABII


AcmlmBoard vl.ol (11-01-05)
© 2000-2005 Acmlm, Emuz, et al



Page rendered in 0.007 seconds.