Skip to content

Instantly share code, notes, and snippets.

@nkostic
Created March 11, 2014 05:05
Show Gist options
  • Save nkostic/9479785 to your computer and use it in GitHub Desktop.
Save nkostic/9479785 to your computer and use it in GitHub Desktop.
Figure out which font needs to be removes/reinstalled.
<cfset fontobj = createobject("java","com.adobe.fontengine.fontmanagement.FontLoader")>
<cfdirectory action="list" directory="c:\windows\fonts" name="fontdir">
<table border="1" style="border-collapse:collapse">
<tr>
<th>Font Name:</th>
<th>Error</th>
</tr>
<cfloop query="fontdir">
<cftry>
<cfset loaded = fontobj.load(createobject("java","java.net.URL").init("file:///C|/windows/fonts/#fontdir.name#"))>
<cfif arraylen(loaded) gt 0>
<cfset dummy="#loaded[1].getPlatformFontDescription()[1].toString()#" >
</cfif>
<cfcatch>
<cfif findnocase("platform",cfcatch.message)>
<tr>
<td><cfoutput>#fontdir.name#</cfoutput></td>
<td><cfoutput>#cfcatch.message#</cfoutput></td>
</tr>
</cfif>
</cfcatch>
</cftry>
</cfloop>
</table>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment