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.
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Dynamic CSS - Changing Font Size
I've written a bit of script that allows a user to change the font size on a web page. I am aware that this can be done via browser settings, but the client wants the feature on the web page. My script uses a cookie to keep the users font choice persistent. However, when I run the script, the web page doesn't recognize the users font choice unless I refresh the page. Once I refresh the page, everything works fine. So I'm confused as to why the browser doesn't recognize the font choice right away. Any suggestions? Code:
Changing (jpg) Image Size
I am looking for a way to resize uploaded (jpg) images automatically. My ISP hasn't got any preinstalled image manipulation library installed on the (centos) serverhost, so I either have to come up with something in PHP, Perl, Java or some other (CGI) applet/application. GD is installed and active, but I can't find any suitable function so far. Preferrably I stick to PHP, but if it isn't possible I would opt for any of the alternatives.
Postcript Library And Fonts - Printer Embedded Font
Ok..am about to embark on making PHP generate basic formatted reports to a postscript printer attached to the server. After many struggles I have the postscript extensions installed and have been reading the documentation to at least eliminate the most basic stupid questions. One stupid question remains: How do I select a (printer) embedded font?...
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.
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
Thoughts On Font-size Control
I have been researching some different techniques to controll font size on a webpage and offer users a way to easily manipulate the font and was curious as to what methods others were using/had used in the past for this sort of thing. I have been using static point font sizes on a stylesheet. With a script that swaps out the stylesheet for one with larger point sizes upon clicking a button. I chose this technique out of all the others I have seen because it seemed to offer the most compatability with slightly out of date browers etc. However the built in font controll from IE, Firefox etc. still wreaks havoc on my sites layout. I am worried about using em's as I just dont see how to make that work in conjunction with images that are far less plyable than the text and other design elements. is there any way to supress the view>textsize? Has anyone had success with em's? Or does anyone have an interesting way to tackle this problem?
Image Fonts
I have written some PHP code to write dynamic text onto a menu bar for my web page, and while it works with the default fonts used by PHP, I cannot get different fonts to load correctly. I have tried to use the ImagePSLoadFont() function, but all I get is the following error message : Call to undefined function: imagepsloadfont() Has anyone here worked with fonts and image creation with PHP? Is this the function I want to use?
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:
Changing Textbox Size In Phpmyadmin
I'm using phpmyadmin to edit text in the database. My only problem is the small size of the text boxes on the edit page. Does anyone know what code needs to be changed to make them larger?
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);
<font Size="-1">
I can put out a Word Doc from PHP but if I try and manipulate the font size in the PHP part it outputs a blank Word Document. Here is what I have: <?php $fname="report.doc"; $handle = fopen( $fname, "rb" ); $buf = fread( $handle, filesize( $fname )); fclose( $handle ); $len = strlen( $buf ); header( "Pragma: public" ); header( "Cache-Control: private" ); header( "Connection: close" ); header( "Content-Type: application/msword" ); header( "Content-Length: $len" ); header( "Content-Disposition: inline; filename="$fname"" ); print $buf;
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 ..
GD And Changing The Color Of An Image
I'm trying to come up with a script that will change the color of a transparent png to a new color. Like #FF0000 to #0000FF. The images I'm using are solid color with a transparent background. Anyways it's not going so well. I have this script that works for palpated images but when I try to use it with an image that has alpha transparency it gets all weird on me and shows up as solid blocks of color. Code:
Changing Existing Image
I am fetching data from an xml file where the format is: <firstname>David</firstname> <lastname>Rosberg</lastname> <division>ABC</division> <photolink>1_thumb.jpg</photolink> Using xforms i am able to change the firstname, lastname and divison fields but i am not able to change photolink from the webform. I need the user to change the existing image so that the new link is updated or replaced in the XML file.
Changing An Image For Text/hyperlink
I have the following piece of code, which uses an image as a button. I want to remove the image and just have some text/hyperlink which has the same effect when clicked? Would someone please help and advise what needs to be changed... <?php echo tep_image_submit('button_wishlist.gif', 'Add to Wishlist', 'name="wishlist" value="wishlist"');?> ....
Dynamically Changing Image Sizes
I have an uploader that uploads an image, then lets the user crop it to the size they want. If the user uploads an image 800 x 600, and i set the height to 400 and width to 300, when i goto crop it, it screws everything up and renders out a solid color.
Image Size
I am trying to find out how I can find the dimensions of images. Here is my script: PHP Code:
Image Size
Does anybody know how to open an image (gif/jpg) end echo its size? I know the syntax for gifs, but it do not work on jpegs.
Get Image Size
I have a page that generates a dynamic button like: button.php?text=button Now, from my html page I would like to add the image like: <img src="image.php?text=button" /> This works fine, but then I try to use the getimagesize function like: function displayButton($text) { list($width, $height, $type, $attr) = getimagesize("image.php?text=$text"); echo "<img src="image.php?text=$text" $attr />"; } when I try to do a <?php displayButton("button");?> I get a warning about the image not existing or wrong path. My question is: is it possible to get the height & width attributes from a dynamic image?
Size Of An Image In A Variable
I am passed an image from down a socket the image is called $img, what i need is the size of this varibale then i can echo the size in my headers to display the image. PHP Code:
Image Size And Ext Filter
I have been testing my image filters and have a few problems, for some reason it blocks .exe, .rar, .zip and a few others i have tested and does the if else code, but .psd .pdf (i have yet to test more)slip through the else code(they dont get uploaded but it creates a empty record. Not what i want. (why would it do that when in my array i only include, jpg, jpeg, gif and png files) The other problem is that it recongnises a jpeg if over the size limit and does the else code but png files bigger that the allowed size skip the else code and create an empty record(they dont get uploaded either) Code:
Getting Image Dimensions And Size With Php?
If I have an image being used in an art gallery fashion, is it going to be php I use to to display with the dimensions and file size of the image that is being loaded in? Or am I going to be using a different kind of code to pull that information?
Can Php Change The File Size Of An Image?
Is it possible to use php to scale down image sizes? for example an 800 by 600 pixel image is uploaded to the server and then PHP scales down the image to say 400 by 300 pixels?. I know that it can generate graphs and things like that but can it change the actuall size of the image?
Reducing An Image File Size?
im aware there is a method which enables you to reduce the file size of an image using PHP. This is obviously great for creating smaller sized, fast loading thumbnails of a larger image without having to manipulate the image yourself at all. Great for people who dont really know anything about image manipulation too! Ok then so my question is: "Does anyone know how this is done!?" Or can anyone suggest a better way to do this without having to manipulate the image yourself and then upload it to the server before it can be accessed.
Image Upload - How To Restrict A Size?
I have an image upload form that works fine, I can limit the size of the file, but now I need to limit the users to a certain pixel range. Something like size MUST be 50 x 50 pixels. Is there anyway to do this? Here is the current code I have: Code:
Reduce Image Quality And Size?
Is there a function of some sort that can reduce the size of an image on upload by changing the quality of the image or something?
Image Resize, Trying To Find The Final Size?
I use a function to set some maximum image dimensions for display on a page.That works fine but now I trying to find out what the final dimensions would be after the resize function and finding myself stuck. PHP Code:
Why Cant I Show Correct Image From Sybase When Size>17K?
I use php4+sybase11+apache,when i select image from sybase($result=sybase_query("select image from imagetable where id=1"), if size<16k,everything is right,when size>17k,the image is only half(size=16384b).when i use "select datalength(image) from imagetable",the size is 28990b.why cant i read image over 16k?
Reduce Image Size/resolution On Upload
does anyone know if its possible to reduce the resolution of an image as it is being uploaded by php. For example this website: www.netmechanic.com allows you to view all of the images on a specified website and also shows you what they would look like in a slightly lower resolution. How do they do it? Basically i want to make sure that images being uploaded to my website are not too large and i want to avoid having to tell people to reduce the image size before uploading.
Reduce Image File Size Upon Upload
what im trying to do is allow a user to upload their pictures using an online GUI, however as the images are being uploaded and saved to the server i would like to reduce the file size some what. The reason for doing this is to save on download times and disc space alike. I know how to temporarily change the image size as the image file is actually being called, however this is not permanent and the image file size is never actually changed and thus disc space is not being saved.
Image Type And Size Filter For Upload
I have this code that works well for me.Just need the added function to check that "uploadFile" is a jpeg, jpg, gif or png and is no bigger than a meg. Code:
HOW DO I: Image Submit At Fixed Size(88x31)
What i want to do is have it so when an image is submitted to my site it is at a fixed 88 by 31. Is there something i do with the sql or php or both. also I am trying to learn as much from this experience(making the script.) so could you give me just what i need to create that part of the script and no more. if i have anymore questions on this script, i will ask in this thread(of course there are other parts to the script) also if that seems rude or anything, sorry, i just want to say that i did some of the work on my own, and without asking a hundred billion questions.
Image Upload Failing (Large File Size)
I'm having a problem with this image upload script since I upgraded Apache. I noticed in my .htaccess files it no longer let me set maxupload size and it blanks it out saying it is now controlled by the .ini file. This script worked fine till the upgrades. The error I get is for files over 309 KB. Code:
Help: GD, PHP, And Fonts..
I am having problems with imageloadfont() function, does anyone have a good link with explaination on how to use this function? I tried the php manual, but it's useless, I tried loading the font: $i = imageloadfont("font.bmp"); but it gives me an error saying "error loading font".. anybody know how to create the font? I dont think we can use TTF, the function accepts a bitmap font..any idea what that is? I used a program that creates bitmap font, which saves it to a .bmp file, and this file didnt work (for the above function, but view as image, it does work).
Using Fonts And Gd
I would like to use gd to edit an image and add some text,i am using PHP Version 4.3.8 and i am using the following code. <?php $im = imagecreatefrompng('bars/title_test.png'); putenv('GDFONTPATH=usr/www/users/mimi7818/fonts/'); $fontname="HIROSHT"; $texttobeadded = "test text for button"; $x = 10; $y = 100; $color = imagecolorallocate ($im, 249,255,0); imagettftext ($im,50,0,$x,$y,$color,arial,$texttobeadded); header ('content-type: image/png'); imagepng ($im); ?> i get this error Warning:# imagettftext(): Could not find/open font in /usr/www/users/mimi7818/add_text_to_bar_image.php on line 10 1.please could you tell me what is wrong? 2.is the gdfontpath absolute or relative? if so how do i find out the correct path? 3.do i need to include .ttf in my font name?
Gd + Ce Ttf Fonts
Is there a way to get Central European specific characters (croatian, to be specific) out of ttf fonts (arial, tahoma, verdana etc) in pictures generated with GD library? Right now I'm getting squares and blanks.
Using Ttf Fonts
At the risk of many coffee splashed monitors . Can I upload a ttf font called font.ttf in the website folder and use that exact font to display certain text on the webspace . I've had good on php.net and this is closest I got . ----- void swf_definefont ( int fontid, string fontname ) The swf_definefont() function defines a font given by the fontname parameter and gives it the id specified by the fontid parameter. It then sets the font given by fontname to the current font. -----
Gd Fonts
how do you access fonts for GD use? I know locally you use your windows directory to your fonts folder, but online, how do you access true type fonts?
GD Fonts
when you use putenv('GDFONTPATH=C:WINDOWSFonts'); it gets your fonts, but if you were to be using it on a web server you don't want it going back to your hard drive to get the fonts, can you copy the fonts into a folder on your webserver and just reference it there?
|