Jump to content

[SOLVED] weird display of images on fly


purplevortex

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

Ok where there is a will there is a way  :P  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 :)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.