|
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
Text to image for Non CSS font resolution
>Is there any CF solution to apply some kind of text to image conversionDavid Moore 08/22/08 01:43 P Have a look at sIFR - http://wiki.novemberborn.net/sifrKay Smoljak 08/22/08 09:11 P I think I have everything correct, but the background of my dynamically created image is black. Nothing I do will change that. Can someone tell me what I am doing wrong. See the test site at:David Moore 08/27/08 03:27 P Try a .jpg. I've had funny issues with .gif files before.Jake Churchill 08/27/08 03:30 P Jake Churchill Wrote:>Try a .jpg. I've had funny issues with .gif files before.David Moore, Jr. 08/27/08 03:40 P > I think I have everything correct, but the background of myC S 08/27/08 10:05 P C Wrote:> Not to rule out other options, but try setting the background color when the image object is created: ><cfset myImage=ImageNew("",500,20, "rgb", "ffffff")> > Though, I do not think you want to create the images every time the page loads.David Moore, Jr. 08/28/08 10:05 A what i did a while ago (before I discovered sIFR) a client was:Azadi Saryev 08/28/08 11:36 A > C Wrote:> Not to rule out other options, but try setting theMary Wheeler 09/02/08 11:50 A I have a client who must use Scala Sans for their Titles and still wants everything dynamic. As I explained over and over again that Scala Sans is not universally available on every computer and that every time they want to have a header it would have to be an image, I am trying to find a dynamic solution. One thought is that I insert a stylesheet.cfm to apply some dynamic css into all my websites. Is there any CF solution to apply some kind of text to image conversion for anything that has an <h3> heading or if I searched on an id or anything? I know nothing of <cfimage> yet and was wonderig if there was something in it that would create a text image solution or anything else... Ideas, thoughts, solutions others have used. Clients you have shot trying to explain this to. ~David G. Moore, Jr. >Is there any CF solution to apply some kind of text to image conversion > ~David G. Moore, Jr. And then a thread comes along that gives me an answer without answering my question at all: <cfset ImageDrawText(myImage,"Congratulations!",10,50,attr)> One day I will learn ColdFusion? ~David Have a look at sIFR - http://wiki.novemberborn.net/sifr Uses JavaScript and Flash to dynamically replace text headings with the desired font. It degrades gracefully so that user agents with no flash or no javascript will just get the text. Search engine friendly and no additional markup in your headings, and because it's Flash the text is still selectable. The only actual Flash you'll need to do is to export the font file (and that's a pretty simple process). We use it on almost every site we create these days - check out the headings on http://www.perththeatre.com.au/ http://www.creativequiltingservices.com.au/ http://www.richardsmyth.com.au/ http://www.fullcirclefeedback.com.au/ Cheers, K. ----- Excess quoted text cut - see Original Post for more ----- I think I have everything correct, but the background of my dynamically created image is black. Nothing I do will change that. Can someone tell me what I am doing wrong. See the test site at: http://www.wawalker.com/index.cfm?PageID=32&ParentPageID=44&NavLink=7 <table width="100%" border="0" cellspacing="15" cellpadding="5"> <cfoutput query="getActiveArtists"> <cfset myImage=ImageNew("",500,20)> <cfset attr = StructNew()> <cfset attr.size=18> <cfset attr.font="ScalaSans Regular"> <cfset ImageSetAntialiasing(myImage,"on")> <cfset ImageSetBackgroundColor(myImage,"FFFFFF")> <cfset ImageSetDrawingColor(myImage,"f15a31")> <cfset ImageDrawText(myImage, "#Trim(Ucase(getActiveArtists.FirstName))# #Trim(Ucase(getActiveArtists.LastName))#",10,17, attr)> <cfimage source="#myImage#" action="write" destination="#getConfig.FilePath#/images/titles/aa_#getActiveArtists.ArtistNumber#.gif" overwrite="yes"> <tr><td valign="top"><img src="#getConfig.URL#/images/titles/aa_#getActiveArtists.ArtistNumber#.gif"></td></tr> </cfoutput> </table> Thanks in advance for anyone's help. Or set me in a new direction... ~David Try a .jpg. I've had funny issues with .gif files before. Jake Churchill CF Webtools 11204 Davenport, Ste. 100 Omaha, NE 68154 http://www.cfwebtools.com 402-408-3733 x103 David Moore wrote: ----- Excess quoted text cut - see Original Post for more ----- Jake Churchill Wrote:>Try a .jpg. I've had funny issues with .gif files before. Didn't fix it. Still black background. I copied the code write off the Adobe Live Docs website? What could I have done. Anyone else. I saw the suggestion in this thread of using sIFR. What should I do? Any advice from others. Should I stick with this and get it working or go with sIFR? The client has to use Scala Sans in a lot of places including some Headers, navigation, etc. And all of the content is being dymically generated from an access database that I pull over from their business every night. Help? ~ David Moore _________________________________________________________________ Talk to your Yahoo! Friends via Windows Live Messenger. Find out how. http://www.windowslive.com/explore/messenger?ocid=TXT_TAGLM_WL_messenger_yahoo_082008 > I think I have everything correct, but the background of my > dynamically created image is black. Nothing I do will change that. > .. > <cfset myImage=ImageNew("",500,20)> Not to rule out other options, but try setting the background color when the image object is created: <cfset myImage=ImageNew("",500,20, "rgb", "ffffff")> Though, I do not think you want to create the images every time the page loads. C Wrote:> Not to rule out other options, but try setting the background color when the image object is created: ><cfset myImage=ImageNew("",500,20, "rgb", "ffffff")> > Though, I do not think you want to create the images every time the page loads. That helps, but I still need help. It did do the trick, but is it the best solution? I am not going to create it each time. Just each time they need new text. I will build an image inventory and check to see if the FileExists. I hate the way this will work, but I can't talk them into doing it any other way. I am using a combination of sIFR and this. (I got the sIFR working late last night). I don't like any of it, but an Agency created the design using ScalaSans everywhere, even with me explaining how text resolves. And the site is completely dynamic. Has anyone else run into this and found a better solution. If text comes out of a database dynamically and it must be a non-universal font, is there any other solution other than Text to Image or sIFR? Thanks, ~David Moore _________________________________________________________________ Talk to your Yahoo! Friends via Windows Live Messenger. Find out how. http://www.windowslive.com/explore/messenger?ocid=TXT_TAGLM_WL_messenger_yahoo_082008 what i did a while ago (before I discovered sIFR) a client was: - create a separate image for each letter and punctuation mark in the font they wanted to use, naming each image file according to what is in it (A.png, B.png, ect). NOTE: the font they used was uppercase-only, so i was spared creating upper AND lowercase images... NOTE 2: some punctuation marks can't be used in filenames on a windows comp, so had to rename them to some other character which were unlikely to be used in a text string, like $ for space, [ for ., etc. - in the text string replace any chars that are not allowed in file names with the ones i used instead. - loop through the text string letter-by-letter outputting images instead. worked pretty well: www.mekongspirit.com - all page titles are done this way i suspect it may not be too great for SEO purposes, though... hth Azadi Saryev Sabai-dee.com http://www.sabai-dee.com/ David Moore, Jr. wrote: ----- Excess quoted text cut - see Original Post for more ----- ----- Excess quoted text cut - see Original Post for more ----- > > I am using a combination of sIFR and this. (I got the sIFR working > late last night). I don't like any of it, but an Agency created the > design using ScalaSans everywhere, even with me explaining how text > resolves. And the site is completely dynamic. Has anyone else run into > this and found a better solution. > > If text comes out of a database dynamically and it must be a > non-universal font, is there any other solution other than Text to > Image or sIFR? > > Thanks, > > ~David Moore > _________________________________________________________________ > Talk to your Yahoo! Friends via Windows Live Messenger. Find out how. > I'm actually going through this process right now of setting up dynamic header images to replace text headers on a page because they are complaining about anti-aliasing issues. My understanding is that the font just needs to be supported by the JDK for this to work. We've not run into any issues yet, just needed to add them to the server and reboot. But thankfully they're not asking for anything to out there in regards to fonts. You'll want to write the image to the browser instead of saving a new image each time. action="writetobrowser" format="png" in the cfimage tag. Pages that helped me ALOT: + Transparent Images - The documentation from Adobe on this function isn't the best, but this page tells you how to create transparent images that are written to the browser. http://www.bennadel.com/blog/1045-Creating-Transparent-Images-With-ColdFusion-8-And-ImageNew-.htm + Dynamically Replace Text with Image - This is the original script using PHP and javascript. You won't need the php section, but the javascript is useful. It will test the browser first to see if it uses images, if it does it'll use an image instead of text. This keeps the pages 508 compliant. http://www.alistapart.com/articles/dynatext + Sizing the Image to the Text - This is just a great script for allowing the canvas of the image to be the same size as the text. http://www.coldfusionjedi.com/index.cfm/2008/1/16/ColdFusion-8-Image-functions-and-text-size Good luck! - Mary
|
Mailing Lists
|
Latest Fusion Authority Articles
|
||||||