Create Image For Each Individual Character In A Truetype Font (.ttf)
Is there any possible way to create an individual image for each character in a TrueType font file (.ttf)? Eiether in PHP, or some Windows program that would do it?
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Image With Functions And Font Face.
does anybody know how to change font-face in Arial,Verdana etc. when i'm using image-functions of PHP? Font-Size is clear to me... $fontSize=2 imagestring($im, $fontSize, $px, 34+($i*1.2), $line, $orange);
Font Color In Jpeg Image (nearly) Always Orange
I am trying to run a basic script that displays an existing jpeg image and writes some text over it. Sounds simple, but I cannot seem to be able to colour the font correctly. In the example below it should be black but it comes out orange. In fact, even if I change the colour to 0, 0, 255 it's orange. I've read in the PHP documentation (the user contributed notes) that there are issues with jpeg font colouring. But I've not seen any details. Can anyone shed light on this for me please? The example code below is called as a function. The $image variable is a path to the existing image file and the $ttf variable is a path to a TrueType font. The $text variable contains a text string. header("Content-type: image/jpeg"); $base_image = imagecreatefromjpeg($image); $font = $ttf; $fontcolor = imagecolorallocate($base_image, 0, 0, 0); imagettftext($base_image, 18, 0, 10, 100, $fontcolor, $font, $text); imagejpeg($base_image); imagedestroy($base_image);
Changing Font Size Of GDF Fonts Over PNG Image
I used imagecreatefrompng("ur.png"), and created a png image. And used imagestring($im, $fontgdf, $leftPos, $height, $text, $txtcolor); to write over the png image. I downloaded and used gdf fonts. Function imagestring() does not take fontsize as parameter, therefore i could not change the font size.
Read True Type Font (ttf) Tags (font Name...)
I try to acces to the font name of my ttf fonts using a php script with the file name. I've found a script reading idv tags from mp3 files, but it's too specific. Can anyone say me how to read a ttf file in php ?
[GD] Could Not Find/open Font - Font Problem
I know this subject was up several times but Icant get it work use gd2 on win32 <? putenv('GDFONTPATH=f:swdfont'); $font = "f:/swd/font/arial.ttf"; $im = imagecreate (250, 28); $black = ImageColorAllocate ($im, 0, 0, 0); $yellow = ImageColorAllocate ($im, 235, 235, 51); ImageTTFText ($im, 20, 0, 10, 20, $yellow, $font, "comming text or not?"); ImagePNG($im,test.png); ?> <img src="test.png" alt="image"> but I allway get error about not finding font ..
How To Create An Image On The Fly?
I've created an image with this code Header("Content-Type: image/png"); $image = ImageCreate($W,$H); $white = ImageColorAllocate($image,255,255,255); $black = ImageColorAllocate($image,0,0,0); ImageLine($image,0,0,$W,$H,$black); ImagePng($image); ImageDestroy($image); but now I wish to add a line echo "Hello"; before the image code, then I only get garbage, the header command is probably invalid now. So how do I create the image without having to save the image to a file?
Image Create?
i need to create a php image like pie chart and i can create that but when i create it dynamicaly and the chart data will come from database then i cant understad that how will i do that. is there anybody who can help me how will i use database to make a pie chart.
Create One Image From Two Diffrent Gif:s!
does anyone know how I create one image from two diffrent gif:s ? And is there someone who knows if you can create one image from one gif file and one png file ??? I had some problems with the header there.
Create And Save An Image
As a test to understand how to create and save a file on my server i created the next code: --- <html> <head> </head> <body> <?php $thumb = imagecreatetruecolor(100, 100); Imagejpeg($pic,"pic.jpg"); ImageDestroy($pic); ?> <img src="pic.jpg"> </body> </html> ---
Create Image From Bytes
I have a web service returning me an Array of Bytes in the form of a Jpg. I am trying to us the GD lib to create the image. Here is my code ($imageBytes is the array of Bytes) //Create the image from Bytes to JPEG. $img = imagecreatefromstring($imageBytes); header('Content-Type: image/JPEG'); header("Content-Length: " .strlen($imageBytes)); imagejpeg($img); But the image is not displaying. Should I use GD, or should I use something else. Any ideas what I am doing wrong.
Create An Image With Imagettftext
I'm trying to create an image using imagettftext - at the moment I am just trying to get some basic image to work and then I plan to do stuff with it. Code:
Create Image With TWO Fonts
I am using PHP's image creation functions to create dynamic titles on the fly with a corporate logo. Now there are 2 versions of the said logo, a regular ttf and an extra bold ttf. I have found it easy to use one or the other. But what I REALLY want to do is have the first word in one font and the second word in another. But as I dont know how long the first word will be....I dont know how to space the second word. Now there has to be someone out there who has done this or knows how to calculate the spacing. Code:
Segmentation Fault On Image Create
i want to do ImageString ($im, 10, 5, 5, "..........", $text_color); ImagePng ($im) i get a Segmentation fault in Apache error log Apache version 1.3.28 gdlib 2.0.15 libpng 1.2.5 php 4.3.2 Stable everything self compiled. i tried to compile a bunch of other versions on gd like 2.0.10, but got no better result Reproduce code: --------------- <? header ("Content-type: image/png"); $im = @ImageCreate (650, 100) or die ("Auf diesem Server funktioniert die Erstellung von PNG Grafiken nicht"); $background_color = ImageColorAllocate ($im, 255, 25, 255); $text_color = ImageColorAllocate ($im, 233, 255, 91); ImageString ($im, 10, 5, 5, "Auf diesem Server funktioniert die Erstellung von PNG Grafiken", $text_color); ImagePng ($im); ?> Expected result: ---------------- nothing happens. Segmentation faul of a Child process in Apache error_log
Create A Link To Delete An Image?
I'm making a really simple cms, but having problem deleting images. I've managed to create a page to upload the images to a folder. I also have a page that shows all the images and file names. Now I'm trying to add a link to delete images, but I can't get it to work. First of all I don't know what to put in the href tag...? Someone said I should create a new page that deletes the image and then redirects you back to the page displaying the images...? Code:
Trying To Create Dynamic Image Links
Im trying to create a basic dynamic gallery, so the details for each entry are taken from the mysql database i need to create a link structure that looks like the one below, but im not sure how to avoid issues with speech marks etc. <a href="gallery/".$row['Imagename']." " rel="Gallery" title="".$row['Caption'].""><img src="gallery/".$row['Thumbname']."" width="".$row['Width']."" height="".$row['Height']."" alt="" border="0"/></a>
Create Image From Movie Frame
I'm design a new website based on PHP, I haveing a module to umpload images (jpg,gif) and upload movies (mpeg,wmv). To create thumbs from the uploading mages I'm using the GD to resize the original images. Now I want to create a thumbs for the movies too, in the past I used the convert command (ImageMagic) on my personal Linux machine, but the option to execute command from the webserver is blocked due to security issue. I find that ther is ffmpeg-php modules to do my task (create and image from movie frame) but my server's hosting company does not use it. Is there any option in PHP / GD to do it?
Include Gd-created Image AND Variables Used To Create It...
I am trying to make my own captcha. I have the image creation part done, but I can't get the image into an php/html page. I have tried include('file'), but it throw image/png headers, and confuses the script (does that make sense?). Is there a way I can include the file that creates the image (image.php) as an image, along with the variables used to create it? ($string for example)
Using GD Library To Create An Image Overlay For Colors?
I'm creating a script that will generate a user avatar based on some inputted variables, like armor type and color. my biggest hurdle right now is trying to figure out how to add color to a section of an image using GD. Say someone wants their helmet to be green (now, only one part of the helment should be green, the rest should stay grey). I thought about making a mask in photoshop of the area that is to turn color, make that white, and the rest of the image transparent. So you now have 2 images. The greyscale helmet, and the mask that fits OVER the helmet image which you intend to color and blend. Still with me? If so... I've done that. I've got my helmet image, and the mask which covers the areas I want to change color with solid white. Now, my issue is, if I add color to my mask image, and then overlay it, the transparency of the mask is GONE. The whole image becomes green! Only the white is supposed to turn green!
Image Create Default Background Color
I have a script that crops and image and resizes it, but that's not the problem. If the image is smaller than the crop area, PHP just fills it in with black. Is there a way to make PHP fill it in with white instead of black?
Image Upload, Resize, Rename And Create Record In Mysql
I have limited knowledge in php and I am having trouble with uploading an image to a remote directory and resizing it if it's larger and renaming it to a unique id, while at the same time I would like to create a record in mysql database. I've tried to find some tutorials but I've had trouble finding any good ones. Wondering if anybody has good examples or link to a good tutorial.
Hit Counters For Individual Objects
I've been Googling for about an hour, and I must be using the wrong terminology because I'm only finding guides to overall site hit counters. I'm looking for some help devising hit counters for blog entries. I want to display (probably for myself) how many views, possibly unique views, and new comments using PHP and MySQL. What should I be Googling for, or does anyone have some useful links? I'm not very knowledgeable about SESSIONS, so I could use some really good tutorials regarding them as well.
Explode Individual Characters
<?PHP $var = 'hello everybody $tar = explode('', $var); foreach($tar as $key => $val) { if($val != 'e') { echo $val; } } ?> this does not work. the error tells me that the explode delimeter is empty but this is what i want. im trying to explode the string into an array of its letters instead of just its words. is there another way of doing this then?
Summing Individual Rows In Mysql
I have created a php score sheet that allows graders to enter scores for different criteria. It uses a mysql database to store the information. I want each row to total, and cannot figure out how to do that. Since new people and new scores will be added to the list, the total row needs to total new people as well. I'm pretty new to this, so don't assume I know syntax, etc. Can anyone tell me how to do this? Name Spelling Math Science Total Joe 15 11 45 Mary 11 22 41 Sam 7 3 11
Replacing Individual Characters With Preg_replace
I found this code in a PERL script that was written by someone else: $password =~ tr/a-zA-Z/n-za-mN-ZA-M/; For example, "newuser1" translates to "arjhfre1" and vice versa. I realize this isn't the best password encryption, but then I didn't write the originating software either. I am trying to convert this to it's PHP equivalent. I understand why this works in PERL, but I can't figure out the syntax for the preg_replace command to get it working in PHP. Can someone please take a crack at it?
Breaking Up A String Into Individual Words
I have a text box that I will use to search a database. I would like to use it so that it will not use a whole string (ie. 'red striped top') but instead break it up into individual words (ie. 'red', 'striped', 'top') and maybe put it into and array. I will then use the words in the array to search the database. How do I break a string up this way? Also, is this the most common way of creating a means of searching a database?
Trim() A Phrase Instead Of Individual Characters
I have a script that takes a URL and trims characters from it for storage in a database. My intention is to trim http:// from the start of the URL and and trailing slashes. For this I have been using the following: $url = trim($url, "http://"); Unfortunately a problem has arisen in that any url's ending in .net have "t" trimmed from the end because, I realise, trim() strips out individual characters, not phrases. Is there any way trim() can be modified to only find and remove the instance of http:// in it's entirety, and ignore single instances of the letters, or is there an alternative function I should be looking at?
Web Calendar Group/individual View Events?
There seem to be a lot of web calendars out there and I am having a tough time sorting out which ones to even try - a lot of the more popular ones were created 2 or 3 years ago. Can anyone recommend a good one that uses php and mysql preferably? One of the main uses would be for family to indicate their holidays so all in the family can see. Thus, it would require a group/public feature that allows users to see all "public" holidays or just their own holidays.
Listing Table Data With An Option To Delete Each Individual Item.
Was wondering if anyone could help me with a PHP, MySQL problem. I am completely new to PHP and MySQL. I have been trying to find a way to list data from a table on a web page and after each individual item have a hyperlink to allow users to delete the information listed. Can anyone help? i.e. Name Age Sex ------------------------------------------ Adam 21 M delete Betty 22 F delete Chris 23 M delete Daisy 24 F delete ------------------------------------------------------------------------------------------------------------------------------ (delete after 'Sex' would be the hyperlink to delete that entire line (row) from the table).
PS Font
I have been trying to use .pfb fonts (Type 1) to generate dynamic images. However the text in the images is very aliased and blurred. This is of course not because of the font or the font style itself. Please let me know if you have any ideas or opinions about it. Code snippet: $SIZE = 14; $FONT_PATH = "/usr/X11R6/lib/X11/fonts/Type1/hell.pfb"; $FONT = ImagePSLoadFont($FONT_PATH); $im = ImageCreate(100, 100); $white = ImageColorAllocate($im, 255, 255, 255); $gray = ImageColorAllocate($im, 134, 134, 134); // draw ImagePSText($im, $str, $FONT, $SIZE, $gray, $gray, 0, $SIZE,0,0,0,16); ImagePSFreeFont($FONT);
Can You Arc A Font With PHP?
I am writing a program with the GD library and need to arc a font like Photoshop does. I know how to write text, slant a font, etc., but I cannot figure out how to arc it and do other things. Is this possible with PHP?
With Includes / Font Tag
I was wondering how I would be able to strip the <font> tags from a file when I include it so it can take on the characteristics of my own stylesheet instead of the font tag attributes.
PHP Font Boundingbox Help
I'm trying to understand how to work with bounding boxes around text with the GD2 library. I thought I understood the concepts and wrote a simple program to make sure. Here it is: <?php putenv('GDFONTPATH=c:windowsfonts'); $bbox=imagettfbbox(10,0,"arial.ttf","Hello World"); echo "upper left ($bbox[6],$bbox[7])-----upper right ($bbox[4],$bbox[5])<br><br>"; echo "lower left ($bbox[0],$bbox[1])-----lower right ($bbox[2],$bbox[3])"; ?> The idea is for me to find out the bounding box coordinates for a Hellow World message. The output produced has me very confused though. It shows the coordinates as follows: upper left (-1,-10)-----upper right (66,-10) lower left (-1,-1)-----lower right (66,-1) I understand how the lower left coordinate can be -1,-1, and the lower right coordinate seems logical, too. How, though, can the upper coordinates have y values of -10? That's below the baseline! It would seem logical that since I specified a font size of 10 my Y coordinates on the top would be roughly 10 more than the y coordinates of the lower corners. So, I'd expect the upper coordinates to be something like (-1,10) and (66,10). Where is the negative 10 coming from?
Embed A Font
How do I embed a font onto a remote user's machine? Say he dont have a Papyrus but I want him to view the webpage using the Papyrus font.
Add A New Font To Editor
I want to add a new font to the editor(Innovaeditor).. I changed the font name in editor side and add that font in my fonts folder in control panel... But the name of the font is like this "??"
ImageString: How Do I Use A Font That Is Not One Of The Default 5?
I am playing with imagegd for generating images, and was wondering if there is a way I could use a font that is not one of the default 5? I remember reading somewhere about a TT font library for imagegd, but don't remember the specifics. If someone could point me in the right direction I would appreciate it.
GD & Text / Font Tricks Anyone?
Does anyone know any tricks->(Read: code) for creating different font effects using the GD Lib. I know how to create images using ttf fonts but they all pretty plain and boring. Shading Effects, Glows, Shadows etc?
Fixed Font Size
I making a web site where people can change the font size with a form on a seperate page. I store the value in session-variables and read them every time a page is loaded. I wonder if it is possible to prevent people changing the fontsize with Mozilla or IE menu's? Can anyone tell me more about this?
Change Font Size
I need a little help in changing the output of a script with the font size, I am using a users online script, but the output of the font is not specified so it comes out as the browser default size. this is the echo statement // Show all users online if ($user==1) {echo $user.' user online'} else {echo $user.' users online'} ?> Is there a way to add something to this to output a differant font size, I am clueless with php, Not even sure if this is the bit of the script that will change this.
Change Font GD Extension
I found a tutorial on how to write text onto an existing image, but now I am having trouble changing the font of the outputted text. Code:
Windows -> UNIX Font
i programmed a security image thing, but i programmed it on my computer, so it's taking it's fonts from C:WINDOWSfonts the webserver i am trying to implement it on is UNIX..can anyone help on what to set the font path at to load a font? and what's a good font to use? i want to use a serif font since the terminal ones are easier to read via bots.
Font Size In Imagestring()
How do you change the font size when using imagestring() ?? I know you can choose between 1 and 5 but since I added in a font, I do not know how to specify the font size Here is my code: imagestring($captcha, 5, 20, 10, $string, $colour); but as soon as i replace the 5 with my $font, it becomes tiny
Fpdf Adding Font Problm
Have anyone experience problem when trying to add font on fpdf (window version) for type1 font?
Change Font Style In PDF-files
I'm trying to change the font style for Tahoma from normal to italic. I inserted Tahoma and TahomaBD. But I can't find anything about changing the style, but underline...
|