The work for Font Info UDF stems from a question posted in the support forums about retreiving a list of fonts installed on the system and finding their corresponding filename. So I wrote two functions.
;=============================================================================== ; ; Function Name: _FontGetList() ; Description: Returns an array with a list of all fonts currently installed on the system. ; Parameter(s): $i_opt - An Integer, 0 or 1. 0 will create a 1D array with font names only. ; 1 will create a 2d array with font names in the first column, font file names in the second ; Requirement(s): None ; Return Value(s): 1D-2D Array = [0] or [0][0] Contains total number of fonts. ; Author(s): Simucal <simucal@gmail.com> ; Revision: 20060501A ; ;===============================================================================
Examples (Click for screenshot of array, using Blindwigs _Array1Box):
_FontGetList(0)
_FontGetList(1)
;=============================================================================== ; ; Function Name: _FontSearchList() ; Description: Returns an array with search results of font names/file names from a specified search string. (i.e. "Wingding" or "ding") ; Parameter(s): $s_SearchString - A string, the name of the font you are searching for. ; $i_opt - An Integer, 0 or 1. 0 will create a 1D array with font names that match $s_SearchString. ; 1 will create a 2d array with font names that match $s_SearchString the first column, and their corresponding font file names in the second ; Requirement(s): $s_SearchString, must be a string. ; Return Value(s): 1D-2D Array = Fonts Found, [0] or [0][0] Contains total number of fonts matched. ; 0 = no font matched the $s_SearchString ; Author(s): Simucal <simucal@gmail.com> ; Revision: 20060501A ; ;===============================================================================
Examples (Click for screenshot of array, using Blindwigs _Array1Box):
_FontSearchList("ding")
_FontSearchList("Arial",1)
If anyone has any other font functions they want written, let me know and I'll add them.
-Simucal
EDIT: Added in a RegExpReplace to get rid of words like "(TrueType)" in font names.
Attached Files
Edited by Simucal, 06 May 2006 - 05:47 AM.






