Re: Adding a border to text using CFImage
Terry - Sorry, I have no clue about a cause. But the error sounds vaguely familiar. Check the CF bug database. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:350010 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Adding a border to text using CFImage
Leigh it went from better to worse. I said it worked when I put the 3 files in a folder off wwwroot called wordart in my laptop with CF 9. It works perfectly. I then uploaded it to my windows 2003 server with CF 9 into a sub folder called wordart in my website. It worked PERFECTLY ONCE. now if I go back there I get this error: Variable ___IMPLICITARRYSTRUCTVAR0 is undefined. Why does it run without errors on my local machine and not the server. I googled the error and Ben Nadel has a post on it, but I can't decipher the reason it's happening on one and not the other. Terry ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:350009 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Adding a border to text using CFImage
> and the png images with superlong filenames are there. > I then hand typed the url to the images and they displayed perfectly. The url in the generated image tags is probably pointing to the wrong location. You can change the defaults for the various paths in the init() function: ie init( urlPath, artDir, fontDir) ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:35 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Adding a border to text using CFImage
No worries. It was a fun question .. and I learned something new myself. While perusing the cfc source I figured out how to create the "outer" stroke effect :) > So this cfc will not work using CF8 I think it should work if you get rid of the CF9 specific syntax. But you would have to try it to be sure. Since CF8 does not allow the implicit syntax within function calls, just declare the options structure separately. #wordart.getArt(text='Start',options=attr )# -L ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:34 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Adding a border to text using CFImage
LEIGH, This is crazy again. I uploaded the folder with the test.cfm and the cfc to a CF9 server and as I said it worked. I sent you my last reply stating that. Went back and reran the file and I get red x's where the demo images were but the plain text is there net to the red x. I deleted the folder, reuploaded and red x's again. I looked at the directory structure and it has created a tree of new folders and the png images with superlong filenames are there. I then hand typed the url to the images and they displayed perfectly. Terry ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349998 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Adding a border to text using CFImage
Yes, I thought I stated that somewhere in the original thread. I tried it in CF9 and it works, thank you a bunch leigh for putting up with my lack of knowledge. So this cfc will not work using CF8 or could you show me a way to call it in there? Terry ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349995 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Adding a border to text using CFImage
> {font="LinLibertine", fontstyle="bolditalic", fontSize=30} Terry - Works perfectly with CF9. Any chance you are using CF8? I do not think implicit structures were supported in function calls until CF9. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349991 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Adding a border to text using CFImage
Leigh, Here is my test page using the Basic Example as you said: Untitled #wordart.getArt("CFWheels is the future and the future is written in ColdFusion", {font="LinLibertine", fontstyle="bolditalic", fontSize=30})# #wordart.getArt("The future is written in ColdFusion")# It is running in c:\inetpub\wwwroot\wordart\ The 2 files, test.cfm, wordart.cfc are in that folder with no subfolders. Here is the error: The CFML compiler was processing: An expression beginning with wordart.getArt, on line 9, column 10.This message is usually caused by a problem in the expressions structure. The body of a cfoutput tag beginning on line 8, column 2. The error occurred in C:\inetpub\wwwroot\1wordart\test.cfm: line 9 7 : 8 : 9 : #wordart.getArt("CFWheels is the future and the future is written in ColdFusion", 10 : {font="arial", fontstyle="bolditalic", fontSize=30})# 11 : #wordart.getArt("The future is written in ColdFusion")# ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349989 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Adding a border to text using CFImage
Terry, The examples on the website say if you are using it with CFWheels you "just [call the] getArt() function since it is made available to your controllers and views.". Otherwise, you need to create an instance of the component first and call init(). Then use yourInstance.getArt() instead of just getArt(). Try the code in the "Basic Example" section. That should work for you. http://www.codecurry.com/2009/12/introducing-wordart-for-coldfusion.html -Leigh- ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349988 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Adding a border to text using CFImage
Leigh, All I did was to run the index as is. I do not know where to change the syntax which is probably why I am getting errors. Terry ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349986 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Adding a border to text using CFImage
> I just sent a request asking if his wordart.cfc is > still active and open source. Great. I would be curious if there are any updates. BTW: Did you try using the non-cfwheels syntax ie wordArt.getArt()? Because that worked fine for me. -Lei ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349982 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Adding a border to text using CFImage
> Check out the Alagad Image Component Yeah, I was going to suggest taking a look at existing image components. Do you know if it supports text borders? Nothing jumped out at me from a brief look at the documentation. -Leigh ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349980 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Adding a border to text using CFImage
Lei- Exactly right. In Photoshop its done with layers and stroke and the stroke can be Inside, outside and middle. I just sent a request to sam...@codecurry.com asking if his wordart.cfc is still active and open source. Hopefully he will reply as the documentation as to what it can do is awesome and would be a worthwhile Tool to have in your toolbox. Terry ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349979 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Adding a border to text using CFImage
> Is that a better explanation? Yep. If you think about how the border effect is created, the behavior makes sense. Basically you are working with a glyph, or a shape of the text. Stroking affects how that shape is filled. It does not change the shape itself. So the thickness has to move inward (so to speak). I am no artist. But I think the effect you are looking for is often achieved by overlaying a smaller shape over a slightly larger one. Similar to creating a shadow effect. It should be possible to apply the same concept to text. But I would have to look around to see if that is the right way to approach it. Btw: It goes without saying if there is an existing library that supports text borders, by all means use it ;-) No reason to reinvent the wheel. But it is fun talking about how all this stuff works internally ;-) -Lei ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349978 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Adding a border to text using CFImage
Well when I play with the numbers in the code it seems if I raise the init setting it widens the stroke/border, but the thickness seems to go inwards instead of outwards from the outside edge of the text. Is that a better explanation? His code is awesome, I just would like to know how to size things and understand it better as I am no java programmer, just a half-assed Coldfusion scripter that enjoys the heck out of this stuff. Terry -Original Message- From: Leigh [mailto:cfsearch...@yahoo.com] Sent: Monday, February 20, 2012 2:56 PM To: cf-talk Subject: Re: Adding a border to text using CFImage > I finally got it all pieced together and it works as you said it would. Well the code may have gotten a bit garbled somewhere, adding to the confusion. Sorry about that. > maybe make the stroke go outside instead of inside? What do you mean by outside? The font and stroke width can be changed through the constructor. (Btw, I am no expert myself. I just spent a lot of time reviewing the javadocs ;-) http://docs.oracle.com/javase/6/docs/api/java/awt/Font.html#Font%28java.lang .String,%20int,%20int%29 ie textFont = Font.init("Arial", Font.PLAIN, **fontSize); http://docs.oracle.com/javase/6/docs/api/java/awt/BasicStroke.html#BasicStro ke%28float%29 ie stroke = createObject("java", "java.awt.BasicStroke").init( *width ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349977 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Adding a border to text using CFImage
> > I finally got it all pieced together and it works as you said it would. > Is there anywhere I can find documentation that will allow me to resize the > fontsize and the stroke width and maybe make the stroke go outside instead > of inside? > Check out the Alagad Image Component http://www.alagad.com/projects.imageComponent I have used it in the past, pre-CFImage. I know that it works on CF7 and I just tested it and wrote text to an image using CF 9. If anything it will provide examples of manipulating fonts. Sorry about the goose chase earlier. HTH, G! On Mon, Feb 20, 2012 at 5:19 PM, Terry Troxel wrote: > > Thanks Leigh, > I finally got it all pieced together and it works as you said it would. > Is there anywhere I can find documentation that will allow me to resize the > fontsize and the stroke width and maybe make the stroke go outside instead > of inside? > > Obviously I am not a java pro like you and I do not want to become more of > a > pain then I already am. > But this is really great. > Terry > > > > ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349976 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Adding a border to text using CFImage
> I finally got it all pieced together and it works as you said it would. Well the code may have gotten a bit garbled somewhere, adding to the confusion. Sorry about that. > maybe make the stroke go outside instead of inside? What do you mean by outside? The font and stroke width can be changed through the constructor. (Btw, I am no expert myself. I just spent a lot of time reviewing the javadocs ;-) http://docs.oracle.com/javase/6/docs/api/java/awt/Font.html#Font%28java.lang.String,%20int,%20int%29 ie textFont = Font.init("Arial", Font.PLAIN, **fontSize); http://docs.oracle.com/javase/6/docs/api/java/awt/BasicStroke.html#BasicStroke%28float%29 ie stroke = createObject("java", "java.awt.BasicStroke").init( *width ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349975 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Adding a border to text using CFImage
Thanks Leigh, I finally got it all pieced together and it works as you said it would. Is there anywhere I can find documentation that will allow me to resize the fontsize and the stroke width and maybe make the stroke go outside instead of inside? Obviously I am not a java pro like you and I do not want to become more of a pain then I already am. But this is really great. Terry ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349974 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Adding a border to text using CFImage
You are missing the code that draws the actual border. // create a thin border stroke = createObject("java", "java.awt.BasicStroke").init( 1 ); graphics.setStroke( stroke ); // ** this line is missing graphics.setColor( Color.decode("##80") ); //** this line is missing graphics.draw( shape ); //** this line is missing graphics.dispose(); (See my previous response for a complete working exa ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349973 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Adding a border to text using CFImage
This is the complete code which displays the text perfectly in GREEN with NO border. I am at a loss. Terry width = 330; height = 150; text = "Crossfade"; // Create a new image that supports transparency transparentImage = ImageNew("", width, height, "argb"); graphics = ImageGetBufferedImage(transparentImage).createGraphics(); // Add rendering hints to smooth text edges RenderingHints = createObject("java", "java.awt.RenderingHints"); graphics.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON ); graphics.setRenderingHint( RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY ); // Create a graphical representation of the text Font = createObject("java", "java.awt.Font"); textFont = Font.init("Arial", Font.PLAIN, width / 5 ); fontContext = graphics.getFontRenderContext(); layout = createObject("java", "java.awt.font.TextLayout").init(text, textFont, fontContext); // Center text outline transX = (width/2) - (layout.getBounds().getWidth()/2); transY = (height/2) + layout.getDescent(); transform = createObject("java", "java.awt.geom.AffineTransform").init(); transform.setToTranslation( 5, 100 ); // Draw the text outline onto the image shape = layout.getOutline(transform); // fill in the text Color = createObject("java", "java.awt.Color"); graphics.setColor( Color.decode("##80aa1c") ); graphics.fill( shape ); // create a thin border stroke = createObject("java", "java.awt.BasicStroke").init( 5 ); graphics.dispose(); ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349972 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Adding a border to text using CFImage
Terry, I do not see anything obviously wrong. Other than the very last line, it looks the same. Here is the complete test code I used on CF8/CF9. The result is green text with a purple-ish border -Leigh width = 330; height = 150; text = "Crossfade"; // Create a new image that supports transparency transparentImage = ImageNew("", width, height, "argb"); graphics = ImageGetBufferedImage(transparentImage).createGraphics(); // Add rendering hints to smooth text edges RenderingHints = createObject("java", "java.awt.RenderingHints"); graphics.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON ); graphics.setRenderingHint( RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY ); // Create a graphical representation of the text Font = createObject("java", "java.awt.Font"); textFont = Font.init("Arial", Font.PLAIN, width / 5 ); fontContext = graphics.getFontRenderContext(); layout = createObject("java", "java.awt.font.TextLayout").init(text, textFont, fontContext); // Center text outline transX = (width/2) - (layout.getBounds().getWidth()/2); transY = (height/2) + layout.getDescent(); transform = createObject("java", "java.awt.geom.AffineTransform").init(); transform.setToTranslation( 5, 100 ); // Draw the text outline onto the image shape = layout.getOutline(transform); // fill in the text Color = createObject("java", "java.awt.Color"); graphics.setColor( Color.decode("##80aa1c") ); graphics.fill( shape ); // create a thin border stroke = createObject("java", "java.awt.BasicStroke").init( 1 ); graphics ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349968 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Adding a border to text using CFImage
That sucks. Sorry about that. I have no idea. Like I said. "I just found it" :) G! On Mon, Feb 20, 2012 at 9:35 AM, Terry Troxel wrote: > > Gerald, > > I cannot believe all the things this cfc is supposed to do, but it keeps > throwing errors about missing arguments and I can't find anything wrong. > > Missing argument name > > > C:\inetpub\wwwroot\1wordart\index.cfm: line 105 > > > 103 : Output: > > 104 : > > 105 : #wordart.getArt(text="CFWheels is the future and the future is > written in ColdFusion", > > 106 : options={style="simple", font="Trebuchet MS", > fontstyle="bolditalic", fontSize=30, wrapWidth=350})# > > 107 : > > > > I sure hope someone else has better success as this is a cool tool if it > works. > > Terry > > > > ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349960 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Adding a border to text using CFImage
Gerald, I cannot believe all the things this cfc is supposed to do, but it keeps throwing errors about missing arguments and I can't find anything wrong. Missing argument name C:\inetpub\wwwroot\1wordart\index.cfm: line 105 103 : Output: 104 : 105 : #wordart.getArt(text="CFWheels is the future and the future is written in ColdFusion", 106 : options={style="simple", font="Trebuchet MS", fontstyle="bolditalic", fontSize=30, wrapWidth=350})# 107 : I sure hope someone else has better success as this is a cool tool if it works. Terry ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349959 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Adding a border to text using CFImage
Leigh, I removed the 2 lines and pasted in the example lines with a semi colon at the end. The result is a solid image, but no stroke. Here's what I added: // color in the text Color = createObject("java", "java.awt.Color"); graphics.setColor( Color.decode("##80aa1c") ); graphics.fill( shape ); // create a thin border stroke = createObject("java", "java.awt.BasicStroke").init( 1 ); graphics.setStroke( stroke ); graphics.setColor( Color.decode("##800080") ); graphics; Can you see anything wrong? Terry ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349958 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Adding a border to text using CFImage
Gerald, Thank you almighty Digital Pack Rat Really Thank you. I haven't opened it yet, but I am on my way. Terry -Original Message- From: Gerald Guido [mailto:gerald.gu...@gmail.com] Sent: Sunday, February 19, 2012 6:55 PM To: cf-talk Subject: Re: Adding a border to text using CFImage ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349957 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Adding a border to text using CFImage
If you do a search here, last year there was a discussion about using java to add and manipulate text on the fly. Look around October-ish. I was doing a contract ad a casket maker and they did websites for funeral homes. One of the site features was being ablet o make a slide show of images plus custom text that had you can put saying or whatever you wanted. This code was based off of some work ben Nadel did and I expanded on that with another list member (I am forgetting her name ATM...sorry, I am horrible with names). That discussion may help you. I did post the final code I had to the list. Eric -Original Message- From: Leigh [mailto:cfsearch...@yahoo.com] Sent: Sunday, February 19, 2012 9:59 PM To: cf-talk Subject: Re: Adding a border to text using CFImage > With a few small changes, it could fill in the text shape with one color and use setStroke to create a border of another color: ie Change these two lines: graphics.setColor(textColor); graphics.draw(shape); ... to something like this // color in the text Color = createObject("java", "java.awt.Color"); graphics.setColor( Color.decode("##80aa1c") ); graphics.fill( shape ); // create a thin border stroke = createObject("java", "java.awt.BasicStroke").init( 1 ); graphics.setStroke( stroke ); graphics.setColor( Color.decode("##800080") ); graphics ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349955 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Adding a border to text using CFImage
> With a few small changes, it could fill in the text shape with one color and > use setStroke to create a border of another color: ie Change these two lines: graphics.setColor(textColor); graphics.draw(shape); ... to something like this // color in the text Color = createObject("java", "java.awt.Color"); graphics.setColor( Color.decode("##80aa1c") ); graphics.fill( shape ); // create a thin border stroke = createObject("java", "java.awt.BasicStroke").init( 1 ); graphics.setStroke( stroke ); graphics.setColor( Color.decode("##800080") ); graphics ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349954 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Adding a border to text using CFImage
> Post it anyways. I am curious. I skimmed the cfc and it is essentially doing the same things internally. Just more and a lot fancier :) It grabs the underlying graphics and uses draw(), setStroke(), etcetera to fill in the text, create borders, etcetera. Here is an old entry on creating a text outline. With a few small changes, it could fill in the text shape with one color and use setStroke to create a border of another color: http://cfsearching.blogspot.com/2009/10/coldfusion-draw-text-outline-on-image.html -Leig ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349953 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Adding a border to text using CFImage
>> I was about to post a simple example from an old blog entry, Post it anyways. I am curious. >> Wow .. that is very cool! Init() though? That is some bad ass code fu. G! On Sun, Feb 19, 2012 at 10:10 PM, Leigh wrote: > > > This is the site with some docs and demos: > > Wow .. that is very cool! I was about to post a simple example from an old > blog entry, but that totally blows mine out of the water. > > > Three cheers for the digital pack rat ;-) > > > -Leigh > > ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349952 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Adding a border to text using CFImage
> This is the site with some docs and demos: Wow .. that is very cool! I was about to post a simple example from an old blog entry, but that totally blows mine out of the water. Three cheers for the digital pack rat ;-) -Leigh ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349951 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Adding a border to text using CFImage
Terry, I remember seeing something about that a while and tried to hunt it up for you. I could not remember the name of it so I could not find it via the google... I was cleaning out my hard drive just now and I ran across it... Talk about dumb luck. w00t!!! This is the site with some docs and demos: http://www.codecurry.com/2009/12/introducing-wordart-for-coldfusion.html But the DL link is hosed. Luckily I saved a version of the file. It is under the BSD licence so I can redistribute the code. Hot damn do I love OSS! https://docs.google.com/open?id=0B_JS0uv8wk1ZNDMwNTkwM2YtMWU1Mi00MDFkLTgxOGUtODU5NGU4NDg1NzQ5 Every once in a while being digital pack rat pays off. G! On Sun, Feb 19, 2012 at 4:54 PM, Terry Troxel wrote: > > I have searched all over and so far am empty handed trying to put a > > color border or stroke around text created with CFImage. > > I also own Efflare's Imageflare and don't see anything in there either. > > If someone has any suggestions or links, I would appreciate it greatly. > > > > Terry > > > > ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349950 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Adding a border to text using CFImage
I have searched all over and so far am empty handed trying to put a color border or stroke around text created with CFImage. I also own Efflare's Imageflare and don't see anything in there either. If someone has any suggestions or links, I would appreciate it greatly. Terry ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349944 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm