Sign in to follow this  
Followers 0
Simucal

Font Info Udf

5 posts in this topic

#1 ·  Posted (edited)

This is my first UDF and if my headers do not meet the standard that everyone uses then please let me know.

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.

FontUDF.au3

Edited by Simucal

AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)

Share this post


Link to post
Share on other sites



Nice job Simucal, I'll look a bit deeper later... but it worked well (the first UDF hadn't tried the 2nd yet).

How about a "_FontDefault()" With the option to return the default font, or change it?


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Nice UDF simucal. i like the way it lists fonts with a specific string in their name


My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.

Share this post


Link to post
Share on other sites

This is my first UDF and if my headers do not meet the standard that everyone uses then please let me know.

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.

Hello...

I know it has been a while since posted, get an error when trying to run. I compiled and same error. Am I running it wrong? Are there any prereqs to running it?

Error: "Func" Statement has no matching :EndFunc"

ThankS

JD

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Remove the last function in the file, it is incomplete for some reason. The font dialog one.

Edited by Simucal

AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0