DLLChooseFont()

DLLChooseFont()
  • SYNOPSIS:
    succ = DLLChooseFont(iFontBank,[iFlags],[iMinSize],[iMaxSize])
  • DESCRIPTION:
    Opens a system font requester. The system font requester is quite a large beast, it has many options and setting that you can play around with to get just the right requester you need. I made a choice to allow full access to it at the cost of a little learning of how to use it.. So it might be a bit of a pain to setup and get used to, but ultimately, you will have pretty much complete and total access to it. (Minus some hook stoof that can't be utilised anyway).
  • PARAMETERS:
    iFontBank A bank created with DLLCreateFontBank(). This is a bank of information on how to setup the font requester if the CF_INITTOLOGFONTSTRUCT is specified in iFlags, and this bank will have all the information about the font that was selected when DLLChooseFont() returns.
    iFlags (optional)

    Defaults to CF_SCREENFONTS if not specifed.

    Possible flags are:
    CF_BOTH - Causes the dialog box to list the available printer and screen fonts.
    CF_TTONLY - Specifies that DLLChooseFont should only enumerate and allow the selection of TrueType fonts.
    CF_EFFECTS - Causes the dialog box to display the controls that allow the user to specify strikeout, underline, and text color options.
    CF_FIXEDPITCHONLY - Specifies that DLLChooseFont should select only fixed-pitch fonts.
    CF_FORCEFONTEXIST - Specifies that DLLChooseFont should indicate an error condition if the user attempts to select a font or style that does not exist.
    CF_INITTOLOGFONTSTRUCT - Specifies that DLLChooseFont should initialise the font requester with the values already in the bank that you specified. This allows you to set default face, weight, size and other attributes. This flag is not required to set the initial colour of the font.
    CF_LIMITSIZE - Required if you want the requester to limit the size a font can be set to by the user. If this flag is set, use the parameters iMinSize and iMaxSize to limit the font size.
    CF_NOOEMFONTS -Same as the CF_NOVECTORFONTS flag.
    CF_NOFACESEL - When using CF_INITTOLOGFONTSTRUCT to initialize the dialog box controls, use this flag to selectively prevent the dialog box from displaying an initial selection for the font name combo box. This is useful when there is no single font name that applies to the text selection.
    CF_NOSCRIPTSEL - Disables the Script combo box. When this flag is set, the FONT_ATTRIBUTES_CHARACTERSET attribute of the font bank is set to DEFAULT_CHARSET when DLLChooseFont returns. This flag is used only to initialize the dialog box.
    CF_NOSTYLESEL - When using CF_INITTOLOGFONTSTRUCT to initialize the dialog box controls, use this flag to selectively prevent the dialog box from displaying an initial selection for the font style combo box. This is useful when there is no single font style that applies to the text selection.
    CF_NOSIZESEL - When using CF_INITTOLOGFONTSTRUCT to initialize the dialog box controls, use this flag to selectively prevent the dialog box from displaying an initial selection for the font size combo box. This is useful when there is no single font size that applies to the text selection.
    CF_NOSIMULATIONS - Specifies that DLLChooseFont should not allow graphics device interface (GDI) font simulations.
    CF_NOVECTORFONTS - Specifies that DLLChooseFont should not allow vector font selections.
    CF_NOVERTFONTS - Causes the Font dialog box to list only horizontally oriented fonts.
    CF_PRINTERFONTS - Causes the dialog box to list only the fonts supported by the printer associated with the device context.
    CF_SCALABLEONLY - Specifies that DLLChooseFont should allow only the selection of scalable fonts. (Scalable fonts include vector fonts, scalable printer fonts, TrueType fonts, and fonts scaled by other technologies.)
    CF_SCREENFONTS - Causes the dialog box to list only the screen fonts supported by the system.
    CF_SCRIPTSONLY - Specifies that DLLChooseFont should allow selection of fonts for all non-OEM and Symbol character sets, as well as the ANSI character set.
    CF_SELECTSCRIPT - When specified on input, only fonts with the character set specified by the attribute FONT_ATTRIBUTES_CHARACTERSET in the font bank are displayed. The user will not be allowed to change the character set specified in the Scripts combo box.
    CF_WYSIWYG - Specifies that DLLChooseFont should allow only the selection of fonts available on both the printer and the display. If this flag is specified, the CF_BOTH and CF_SCALABLEONLY flags should also be specified.

    iMinSize (optional) Sets the minimum point size the user can select. For this to have any effect, you need to specify CF_LIMITSIZE. Defaults to 8.
    iMaxSize (optional) Sets the maximum point size the user can select. For this to have any effect, you need to specify CF_LIMITSIZE. Defaults to 16.
  • RETURNS:
    True or False, depending on whether or not the Font requester could be opened or not. All information about the choices the user made will be returned in the specified font bank and can be extracted with DLLGetFontFace, DLLGetFontAttribute
  • EXAMPLE:
    See examples: example018.bb, example019.bb and example020.bb.
  • BUGS:
    None Known.
  • SEE ALSO:
    DLLCreateFontBank(), DLLGetFontFace, DLLGetFontAttribute

Return To Index
Problems with this command or bugs? EMail me at: mailto:loki.sd@blueyonder.co.uk

Section Last Updated: Saturday, February 2, 2002 2:36 PM GMT

All materials used in this help, related sources and binaries are (C)opyright Rob Hutchinson, Joseph Cox and Tarropithium Software 2002. All rights reserved. All software is provided without warranty unless otherwise stated.
Tarropithium Software or the authors will not be held liable for any damage or data loss that may occur during the application of this software. Use it at your own risk!