homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

Dynamic Image Creation...
Stroke / Bold text?

10+ Year Member

Msg#: 6638 posted 6:59 am on Jan 23, 2005 (gmt 0)

I'm new to the whole dynamic images thing.. I've picked up on a few simple commands so far, I can take an image apply simple writing on it and develop a new image from it using GD.

Here is the code so far:

$image = imagecreatefrompng("text_background.png");
$font_size = 7;
$color = imagecolorallocate($image, 255,255,255);
$black = imagecolorallocate($image, 0,0,0);
$text = "Test!";
$font = "TT0768M_.TTF";

ImageTTFText ($image, $font_size, 0, 4, 10, $black, $font, $text);

ImageTTFText ($image, $font_size, 0, 5, 10, $color, $font, $text);

header("Content-type: image/png");

Much I just picked up from some tutorials, so again I don't know too much.

What I want to do is create images using a unique font with a pre-made background image that have bold and stroke attributes.

Here is what I'm attempting to replicate automaticly instead of make a dozens manually :
5.25 KB, 60px by 16px.

[edited by: jatar_k at 5:31 pm (utc) on Jan. 23, 2005]



10+ Year Member

Msg#: 6638 posted 1:18 am on Jan 26, 2005 (gmt 0)

Due to conditions outside of my control this topic was not viewable for a period of time after its creation, hence forth nobody seen it. I'm bumping this topic (but once) in hope someone can view and respond.


WebmasterWorld Senior Member 10+ Year Member

Msg#: 6638 posted 6:30 pm on Jan 26, 2005 (gmt 0)

bold: using imagettftext(), you'll have to have a bold font. Some programs like browsers are able to emulate a bold font with a normal font when there's no bold font available, but imagettftext won't be able to do that for you. Stroke: you mean strikethrough? you might have to do this 'manually' with imageline().


10+ Year Member

Msg#: 6638 posted 10:37 pm on Jan 27, 2005 (gmt 0)

//Stroke: you mean strikethrough?

No, Stroke is when there is a outline or border color around the text.

I have been able to duplicate it by first setting down the text offset in each direction. Then using the main color in the center.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved