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?
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
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 ..
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);
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...
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);
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?
To Install A New Font While View Page!!!!
I am working with chinese fonts and experienced the difficulty as a user to view that page in chinese... How can i add (or install )chinese fonts to the user's system while the user try to view that page!!!!
How To Load Font At Client Side?
How to load font at client side..likeIf I am searching keywords "Hindi" in google search engine..So in the result page I can see the fonts are in hindi, even though hindi font is not installed @ my(client) side.. I dont want to install manually @ client side.. It would be directly handeled via server.. (like above example)so how its possible in php?
Adding Font Effects To A Very Small Php Bit
So I have this small PHP bit and I want a red and bold font on the line that says "This post has been deleted by:" but not sure how to get it in there. Here's the bit: $post = 'This post has been deleted by:'. $usr; $ta = array ('post' => $post,); $db_string = $this->ipsclass->DB->compile_db_update_string( $ta ); $this->ipsclass->DB->simple_exec_query( array( 'update' => 'posts', 'set' => $db_string, 'where' => 'pid'.$pid ) );
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:
Imagettftext Error Cannot Open/Find Font
I uploaded the font to a folder I created called fonts, but it doesn't seem to wanna open. I tried CHMOD the file to 777 the folder to 777. I also tried leaving off the .ttf like someone in the manual suggests. No luck. Do .ttf files need to be uploaded in some special manner? (like a perl file). I basically copied the text from the php site and changed the file path to reflect my arrangement: PHP Code:
Chinese, Japanese Font Issues With Mail
Can anyone provide me the simplest working solution to send mails in a multilingual website that too with no issues relating to display of characters, as of now I have find a solution which is working quite well, which is to paste a japanese or chinese lang. sentences to an editor like dreamweaver in design mode and paste the generated char code eg. #1045 to the database table to create a mail template, this is working fine but a labour job. Can you provide me with a more intelligent solution? such as by setting the charSet or something else as of I am using the phpmailer class for the purpose...
Encoding/characterset/font Family Confusion
I could use a bit of guidance on the following matter. I am starting a new project now and must make some decisions regarding encoding. Environment: PHP4.3, Postgres7.4.3 I must be able to receive forminformation and store that in a database and later produce it on screen on the client (just plain HTML). Nothing special. I do this for many years, but I never paid a lot of attention to special characters. A few day ago I discovered that the euro-sign is not defined in all fontfamilies. They cannot produce the right sign no matter if I use € or the hexadecimal equivalent. After a little research I found I could put font-tags around the euro-sign with another font-family (Arial in this case) to get the Euro sign. I am completely graphical impaired, and only understand programmingcode (and HTML/JavaScript of course) , so this is a weak point on my side, hence this question. I target on Europe only at the moment (no need for Chineese charactersupport) That said, will the following setup make sense? Postgresql db encoding scheme: LATIN1 In the headers of all my HTML: content-type: text/html charset: iso-8859-1 A few related questions: 1) Will people be able to copy/paste info from other sources (like wordprocessing programs and other websites) into my forms? 2) Can I use regular expressions as I am used to (ASCII) in my PHP code? Will I match e acute, eurosign, etc? 3) Will the roundtrip describe here under have problems with normal expected european characters? client copies some text from some source -> paste in the form -> receive by PHP -> insert in Postgresql (or update) -> retrieve from postgresql -> display as HTML (with content-type: text/html charset: iso-8859-1) Is that OK? Any pitfalls? Should I maybe use UTF-8?
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.
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?...
Displaying Php Chart Text On My Host Using An Uploaded Font
Hi im trying to get a chart to display using php. I get an error at the moment when i use the function (or any requiring an uploaded font to be used): imagettftext($image, 6, 0, 0, $initial_point, $colorRed, 'Verdana', $initial_value); The error stems from the loading of the verdana ('Verdana') font file which IS uploaded and works locally but for some reason the script cant find the file on your site so its returning an error. Does anyonw know what what might be the cause of this? For example I am using a mac to work locally and then uploading to the php server which is linuz might i need to use diferent fonts or something on the server?
Warning: Imageloadfont() [function.imageloadfont]: Error Reading Font
I want type text inside image , but I want use any language (or characterset) other than english language. when I type this command line: $fontnum=imageloadfont ("MARLETT.TTF"); this massage appear: Warning: imageloadfont() [function.imageloadfont]: Error reading font in /home/ktammam/public_html/test/image_php2.php3 on line 3 Note: I copy the font file from (OS win98) and copy it to my site on the web (OS Linux). Configure Command for my php is: Code:
<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;
|