Font Browser / GetFont 0.6

This script implements a font browser.  It provides a large preview with customizable sample text.  Script writers can also use the the GetFont routine in other scripts to prompt for and return an font name.  The font name can then be used with the PSP Text command.  The dialog also allows the user to enter their own sample text and allows you to find out what was entered.  That means that you can get both the font and the text at the same time.

Note: All currently installed fonts are present in the list.  Some fonts, such as System, can not be rendered by PSP.  If you select a font a press OK, the script will attempt to detect this and warn you, but there is currently no way to reliably detect non-renderable fonts in all cases.


Installation instructions:

Download the script.  Place the script in your Scripts-Trusted folder (required for the UI and registry lookups needed to find the font names).

To run:

Bring up PSP 8, select Font Browser in the list of scripts and press the play button.  Use the Up and Down arrow keys or the scroll bar to move around in the font list.

You can resize the dialog box to get multiple preview lines.  You can select all of the preview text with Ctrl+A.  Pressing Enter is equivalent to pressing OK.  If you really need a carriage return in the text, you can insert one with  Shift+Enter.

Using GetFont:

If you are a script writer and wish to use GetFont in a script, follow the directions in the comments of the Font Browser script and use it as an example of how to call GetFont. You can change the default starting font, the initial sample text and the prompt string in the call to GetFont.

Note: All currently installed fonts are present in the list.  Some fonts, such as System, can not be rendered by PSP.  The script will attempt to detect this and warn you, but there is currently no way to reliably detect non-renderable fonts in all cases  If you are using the GetFont routine as a font selector and the user selects a font that PSP can't render, it will probably not result in an error.  However, it is also unlikely to produce a useful result.

Change History:

V0.6: Fixed font family compatibility issue with PSP 8

V0.5: Fixed handling of special chars in font names (broken in 0.4).

V0.4: Updated for PSP 9 and Python 2.3.3.

V0.3: Now handles font names with the TM symbol in them. Special thanks to Suze, Samantha, and Kenzie for helping me find, test, and confirm the problem.
 


Last modified 08/19/2004 09:30:09 PM