Windows Server 2016 Standard
Lucee 5.3.8.189 New Install
Trying to test the fonts with a simple code example below.
The text doesn’t change when I modify the font.
Is there a way to point Lucee to use the fonts in c:\windows\fonts ?
Is there a way to add custom fonts? I don’t see the fonts.jar in any of the Lucee folders in this new version.
<cfset imgText = ImageNew("",320,20,"argb")>
<cfset ImageSetDrawingColor(imgText,"black")>
<!--- Set the attributes of the text --->
<cfset textattribs = StructNew()>
<cfset textattribs.font="Arial">
<cfset textattribs.size = 20>
<!--- Draw the text. --->
<cfset ImageDrawText(imgText, "Test text", 10, 15, textattribs)>
<cfimage action="writeTobrowser" source="#imgText#" >
@dmarinello I checked with your code and fonts are working fine with lucee, Changing the font name reflects the output. Could you please check with this below example?
<cfloop array="#imageFonts()#" index="fonts">
<cfset imgText = ImageNew("",320,20,"argb")>
<cfset ImageSetDrawingColor(imgText,"black")>
<!--- Set the attributes of the text --->
<cfset textattribs = StructNew()>
<cfset textattribs.font="#fonts#">
<cfset textattribs.size = 20>
<!--- Draw the text. --->
<cfset ImageDrawText(imgText, "Test text", 10, 15, textattribs)>
<cfimage action="writeTobrowser" source="#imgText#" >
</cfloop>
I did. It gives me an error on the following line: <cfset sFont = oFont.createFont(oFont.TRUETYPE_FONT, stream) />
Isn’t there a way to add fonts one time to the Lucee Default Fonts? I remember doing something with a fonts.jar file. I don’t see that file anywhere in the Lucee subdirectories.