[Home] [Downloads] [Search] [Help/forum]

MUSHclient scripting

Description of MUSHclient world function: world.AddFont

Name AddFont
Type Method
Summary Adds a custom font for use by MUSHclient
Prototype long AddFont(BSTR PathName);

View list of data type meanings


This adds a font (specified by pathname) into the MUSHclient application space. It can then be used by world windows for output or command window fonts.

Any number of extra fonts can be added per world. (This feature added in version 4.93 of MUSHclient. Prior to version 4.93 you could only add one extra font at a time).

The intention here is for specialized fonts (like mapping fonts) to be made available without having to add extra font files to the Windows directory.

This is only supported on Windows 2000 or later (eg. Windows XP, Vista). It is not supported under Windows 95/98/ME. Use GetInfo (265) through to GetInfo (268) to find which version of Windows you are running under. (Basically GetInfo (265) needs to return 5 or higher).

The file name can specify any of the following files.

.fon Font resource file.
.fnt Raw bitmap font file.
.ttf Raw TrueType file.
.ttc East Asian Windows: TrueType font collection.
.fot TrueType resource file.
.otf PostScript OpenType font.

.mmm multiple master Type1 font resource file.

It must be used with .pfm and .pfb files.

.pfb Type 1 font bits file.

It is used with a .pfm file.

.pfm Type 1 font metrics file.

It is used with a .pfb file.

To add a font whose information comes from several resource files, point lpszFileName to a string with the file names separated by a | --for example, abcxxxxx.pfm | abcxxxxx.pfb.

Note: Available in version 4.32 onwards.

VBscript example
AddFont "myextrafont.ttf"
Lua example
AddFont ("myextrafont.ttf")
Returns eBadParameter - empty file name given
eNoSuchCommand - not supported on your version of Windows
eFileNotFound - file not found, or Windows rejected it as a font file
eOK - added OK

View list of return code meanings

Introduced in version 4.32

Search for script function

Enter a word or phrase in the box below to narrow the list down to those that match.

The function name, prototype, summary, and description are searched.

Search for:   

Leave blank to show all functions.

Return codes

Many functions return a "code" which indicates the success or otherwise of the function.

You can view a list of the return codes

Function prototypes

The "prototype" part of each function description lists exactly how the function is called (what arguments, if any, to pass to it).

You can view a list of the data types used in function prototypes

View all functions


Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]