purplevortex Posted May 9, 2007 Share Posted May 9, 2007 Hi, I have been creating a font site and have entered all my data into a mysql database and written my php code to display these fonts in images on the fly. All works great except for 3 fonts out of the 2500, and I have noticed on other sites using php to display fonts on the fly some of them don't display as well, can anyone tell me why and can I fix this? I know the font files are valid ttf files, extension is lower case as well, if they were not either valid, uploaded or lowercase extension I would get little boxes with x's in them but instead i just get blank boxes. I have no idea how to resolve this but it is driving me nuts that they won't display. Thanks so much Purplevortex Quote Link to comment https://forums.phpfreaks.com/topic/50652-solved-weird-display-of-images-on-fly/ Share on other sites More sharing options...
neel_basu Posted May 9, 2007 Share Posted May 9, 2007 I didn't understand at all. Quote Link to comment https://forums.phpfreaks.com/topic/50652-solved-weird-display-of-images-on-fly/#findComment-248992 Share on other sites More sharing options...
only one Posted May 9, 2007 Share Posted May 9, 2007 fly?? what way are you doing it?? echo "<font face=the font name>text</font>"; (the person viewing this will need to have it iunstalled on their computer) or are you using GD? Quote Link to comment https://forums.phpfreaks.com/topic/50652-solved-weird-display-of-images-on-fly/#findComment-248994 Share on other sites More sharing options...
purplevortex Posted May 9, 2007 Author Share Posted May 9, 2007 I am using Imagettftext($image, 36,0,0,$y,$dblue,$font,$text); along with <img src='df.php?sc=st&f=$ff&text=$txt' alt='' /> I query the database and pass a variable with the link calling for the image, the variable contains the font file name. After entering so many into the database I have pretty much covered all mistakes, re if the extension is TTF instead of ttf, if the font file isn't uploaded, if the font file data isn't entered into the database, if the font file is for some reason corrupted,,, all of those instances give me a box with an x,, you know what typically occurs on any web page that the graphic is missing. But what I get is a blank image,, such as a spacer.gif or blank.gif. If it was the code then this would occur for all of them being that it is one piece of code that is being used, my initial thought was that maybe the character map used for the font was in the non normal ascii section, the section one typically needs to use an alt key or character map to retrieve that character. It still could be this I was just wondering if anyone else has ever had this problem where only a couple of the images come up empty, meaning the background is drawn but not the foreground. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/50652-solved-weird-display-of-images-on-fly/#findComment-249006 Share on other sites More sharing options...
only one Posted May 9, 2007 Share Posted May 9, 2007 hm.. i dont see why there would be anything wrong with that... but try this.. ImageString ($image, $font, 36, 0, 0, "$text", $dblue); i dont no what your do so i just guessd... but just use an image string... Quote Link to comment https://forums.phpfreaks.com/topic/50652-solved-weird-display-of-images-on-fly/#findComment-249014 Share on other sites More sharing options...
purplevortex Posted May 9, 2007 Author Share Posted May 9, 2007 Ok I tried that and it gives me a box with an x in it for several fonts, including the ones that were fine before Quote Link to comment https://forums.phpfreaks.com/topic/50652-solved-weird-display-of-images-on-fly/#findComment-249021 Share on other sites More sharing options...
purplevortex Posted May 9, 2007 Author Share Posted May 9, 2007 Ok where there is a will there is a way It definately has to do with the glyth positioning within the font file itself, rather than looking for a piece of php code that will read the glyphs not used on the keyboard I just went in and positioned the letters in the correct spots and now they display just fine. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/50652-solved-weird-display-of-images-on-fly/#findComment-249124 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.