PDA

View Full Version : How would you do this! :(



Dentafrice1
03-12-2006, 06:41 PM
http://habbotools.de/bild.php?schrift=Habboschrift&font=46&copy=Schriftgenerator+by+Habbotools.de

Its making me mad.. I just want it to use on my site.

How would you go about doing that.. did that make .ttf font files and use imagettftext?

omgDAN!
03-12-2006, 06:43 PM
They are probably fonts yes.

--ss--
03-12-2006, 06:43 PM
use the code at the bottom of the main site?

<h3 align="center">Schriftgenerator</h3>

<form name="generator" action="http://habbotools.de/bild.php" method="get" target="_blank">
<div align="center">
Text:<br><input type="text" name="schrift" value="Habboschrift" size="30"><br><br>
Schriftart:<br><select name="font"><option value="1">Normal überlappend</option>
<option value="2">Normal neben</option>
<option value="22">Mittel überlappend</option>
<option value="23">Mittel neben</option>
<option value="3">Klein überlappend</option>
<option value="4">Klein neben</option>
<option value="5">Groß überlappend</option>
<option value="6">Groß neben</option>
<option value="7">Love Schrift</option>
<option value="8">Bad Schrift</option>
<option value="9">Festival</option>
<option value="10">Teppich überlappend</option>
<option value="11">Teppich neben</option>
<option value="12">Habbowood überlappend</option>
<option value="13">Habbowood neben</option>
<option value="14">Habboclub überlappend</option>
<option value="24">Habboclub neben</option>
<option value="15">Habbo Gold groß A</option>
<option value="16">Habbo Gold groß B</option>
<option value="17">Habbo Battleball</option>
<option value="18">Habbo Gold A</option>
<option value="19">Habbo Gold B</option>
<option value="42">Habbo EisBlau A</option>
<option value="43">Habbo EisBlau B</option>
<option value="20">Habboclub Groß A</option>
<option value="21">Habboclub Groß B</option>
<option value="25">Habbo Beta A</option>
<option value="26">Habbo Beta B</option>
<option value="35">Buttons A</option>
<option value="36">Buttons B</option>
<option value="41">Teleporter A</option>
<option value="40">Teleporter B</option>
<option value="39">Feng Shui</option>
<option value="44">Habbo Lido</option>
<option value="45">Habbo Bones</option>
<option value="46">Habbo Explorer A</option>
<option value="47">Habbo Explorer B</option>
<option value="51">Socrates A</option>
<option value="49">Socrates B</option>
<option value="52">Trophy</option>
<option value="53">Iced A</option>
<option value="54">Iced B</option>
<option value="55">Iced C</option>
<option value="56">Habbo Home A</option>
<option value="57">Habbo Home B</option>
</select><br><br><input type="submit" value="Schrift generieren"><br>
<input style="border-width: 0px; font-family: Verdana; font-size: 10px; text-align: center;" name="copy" value="Schriftgenerator by Habbotools.de" onclick="window.location.href='http://habbotools.de'" size="50" readonly></div></form>

Dentafrice1
03-12-2006, 06:46 PM
I know.. but you know me.. if I see it.. I have to make it :P

I know its using GD librarys..

Invent
03-12-2006, 06:48 PM
Some are ttf fonts probably. But I know for a fact that alot are images [;

--ss--
03-12-2006, 06:49 PM
I know.. but you know me.. if I see it.. I have to make it :P

I know its using GD librarys..

lol like i said ages ago ' you wierdo' :o
urmm screenshot each letter and write a code so it recoinise each picture with a letter and puts it together ? :p

omgDAN!
03-12-2006, 06:53 PM
lol like i said ages ago ' you wierdo' :o
urmm screenshot each letter and write a code so it recoinise each picture with a letter and puts it together ? :p

That's what he's trying to do

SimplyTech
03-12-2006, 06:54 PM
i could do it in flash lol

Dentafrice1
03-12-2006, 06:54 PM
ok mentor (bag) told me this:

get width of image, + a few pixles for space, then add that as coordinate fpor next image

so its just putting each image beside each other.. hmm how tho

Wii:

Could you help me mate?

omgDAN!
03-12-2006, 06:55 PM
But in flash the user would have to take a screenie...

Dentafrice1
03-12-2006, 06:56 PM
I know.. this is using PHP GD.

And its making me mad :(

nets
03-12-2006, 06:57 PM
I'm assuming there's an image for each character, which are then joined using the imagecopymerge function. It's pretty simple, you'll just need to get the width of each character, add it together, create the image and then place each character (you could do it with a foreach loop).

Dentafrice1
03-12-2006, 06:59 PM
Could you help joshua?

Im not a noob at this but I just haven't worked with GD that much

nets
03-12-2006, 08:35 PM
I'll write a basic script you can ammend to fit your needs.

I had a similar script I wrote for someone else which I could structure it around:

<?php

require ('config.php');
header("Content-type: image/png");

// Check Message
if(preg_match("/^[a-zA-Z0-9 ]{0,30}$/", $_GET['message']) && !empty($_GET['message'])) {
$chars = str_split(str_replace(' ', '_', $_GET['message']));
} else {
$chars = str_split('Invalid_Message');
}

// Assign font variable
$fontDirectory = $fonts[$_GET['font']];
if($fontDirectory == '') $fontDirectory = 'test';

// Count size and create images
foreach($chars as $char) {
$cl = $fontDirectory.'/'.$char.'.png';
$charsImgs[] = imagecreatefrompng($cl);
@list($width) = getimagesize($cl) or exit;
$charsWidth[] = $width;
$imgWidth = $imgWidth+$width;
}

// Create and merge final image
$imgWidth = ($pos*2)+$imgWidth;
$img = imagecreate($imgWidth, height);
$bg = imagecolorallocate($img, 255, 255, 255);
foreach($charsImgs as $charsImg) {
$width = array_shift($charsWidth);
imagecopymerge($img, $charsImg, $pos, 0, 0, 0, $width, height, 100);
$pos = $pos+$width;
}

// Flush image
imagepng($img);
imagedestroy($img);
exit;

?>

File "config.php":

<?php

# CONFIG

#Image height:
define("height", 50);

#Left and right margin:
$pos = '10';

#Font and its directory (more may be added):
$fonts['test'] = 'test';
$fonts['blah'] = 'blah';

# CONFIG END --

?>
Create a folder with the name of your font, bearing each character (in PNG format). The space image should be named "_.png", as you can't have spaces in some O/Ss file names. Modify config.php to fit your needs. Don't worry about paying me.

omgDAN!
03-12-2006, 08:37 PM
I'll write a basic script you can ammend to fit your needs.

Could you supply me with the script too, thanks.

Dentafrice1
03-12-2006, 08:39 PM
Thanks joshua.

I will pay you when I get my paypal account unlocked

nets
03-12-2006, 08:45 PM
Bump. About paying, I wrote a script a similar script a while ago, so there wasn't much coding to do (thanks for the offer though). I've added the script to my previous post.

Dentafrice1
03-12-2006, 08:49 PM
http://www.ffwbmarion.com/imagergd/testj.php?message=test


Warning: Cannot modify header information - headers already sent by (output started at /home/ffwb/public_html/imagergd/configj.php:17) in /home/ffwb/public_html/imagergd/testj.php on line 4

Fatal error: Call to undefined function: str_split() in /home/ffwb/public_html/imagergd/testj.php on line 8

To those not using PHP 5:



<?php
require ('config.php');
if(!function_exists('str_split')){
function str_split($string,$split_length=1){
$count = strlen($string);
if($split_length < 1){
return false;
} elseif($split_length > $count){
return array($string);
} else {
$num = (int)ceil($count/$split_length);
$ret = array();
for($i=0;$i<$num;$i++){
$ret[] = substr($string,$i*$split_length,$split_length);
}
return $ret;
}
}
}
// Check Message
if(preg_match("/^[a-zA-Z0-9 ]{0,30}$/", $_GET['message']) && !empty($_GET['message'])) {
$chars = str_split(str_replace(' ', '_', $_GET['message']));
} else {
$chars = str_split('Invalid_Message');
}
// Assign font variable
$fontDirectory = $fonts[$_GET['font']];
if($fontDirectory == '') $fontDirectory = 'test';
// Count size and create images
foreach($chars as $char) {
$cl = $fontDirectory.'/'.$char.'.png';
$charsImgs[] = imagecreatefrompng($cl);
@list($width) = getimagesize($cl) or exit;
$charsWidth[] = $width;
$imgWidth = $imgWidth+$width;
}
// Create and merge final image
$imgWidth = ($pos*2)+$imgWidth;
$img = imagecreate($imgWidth, height);
$bg = imagecolorallocate($img, 255, 255, 255);
foreach($charsImgs as $charsImg) {
$width = array_shift($charsWidth);
imagecopymerge($img, $charsImg, $pos, 0, 0, 0, $width, height, 100);
$pos = $pos+$width;
}
// Flush image
header("Content-type: image/png");
imagepng($img);
imagedestroy($img);
exit;
?>

nets
03-12-2006, 08:57 PM
It's working fine now?

Dentafrice1
03-12-2006, 08:59 PM
http://www.ffwbmarion.com/imagergd/testj.php?message=a&font=blah


<?php
require ('configj.php');
if(!function_exists('str_split')){
function str_split($string,$split_length=1){
$count = strlen($string);
if($split_length < 1){
return false;
} elseif($split_length > $count){
return array($string);
} else {
$num = (int)ceil($count/$split_length);
$ret = array();
for($i=0;$i<$num;$i++){
$ret[] = substr($string,$i*$split_length,$split_length);
}
return $ret;
}
}
}

// Check Message
if(preg_match("/^[a-zA-Z0-9 ]{0,30}$/", $_GET['message']) && !empty($_GET['message'])) {
$chars = str_split(str_replace(' ', '_', $_GET['message']));
} else {
$chars = str_split('Invalid_Message');
}

// Assign font variable
$fontDirectory = $fonts[$_GET['font']];
if($fontDirectory == '') $fontDirectory = 'test';

// Count size and create images
foreach($chars as $char) {
$cl = $fontDirectory.'/'.$char.'.gif';
$charsImgs[] = imagecreatefromgif($cl);
@list($width) = getimagesize($cl) or exit;
$charsWidth[] = $width;
$imgWidth = $imgWidth+$width;
}

// Create and merge final image
$imgWidth = ($pos*2)+$imgWidth;
$img = imagecreate($imgWidth, height);
$bg = imagecolorallocate($img, 255, 255, 255);
foreach($charsImgs as $charsImg) {
$width = array_shift($charsWidth);
imagecopymerge($img, $charsImg, $pos, 0, 0, 0, $width, height, 100);
$pos = $pos+$width;
}

// Flush image
header("Content-type: image/png");
imagepng($img);
imagedestroy($img);
exit;

?>


comes up with a broken image :(

nets
03-12-2006, 09:04 PM
You've probably got some white-space in "configj.php" after or before the PHP tag.

http://i11.tinypic.com/2yod751.jpg

Dentafrice1
03-12-2006, 09:22 PM
Does anyone have any Habbo fonts other then the on on Habbofm.co.uk?

RYANNNNN
03-12-2006, 09:38 PM
www.habboname.com/habbo-fonts

Want to hide these adverts? Register an account for free!