MakeFont() function - MapBasic - 2023

MapInfo MapBasic Reference

Product type
Software
Portfolio
Locate
Product family
MapInfo
Product
MapInfo > MapBasic
Version
2023
Language
English
Product name
MapBasic
Title
MapInfo MapBasic Reference
First publish date
1985
Last updated
2023-09-12
Published on
2023-09-12T16:32:32.686312

Purpose

Returns a Font value. You can call this function from the MapBasic window in MapInfo Pro.

Syntax

MakeFont( fontname, style, size, forecolor, backcolor ) 

fontname is a text string specifying a font (for example, "Arial"). This argument is case sensitive.

style is a positive integer expression; 0 = plain text, 1 = bold text, etc. See Font clause for details.

size is an integer point size, one or greater.

forecolor is the RGB color value for the text. See RGB() function.

backcolor is the RGB color value for the background (or the halo color, if the style setting specifies a halo). To make the background transparent, specify -1 as the background color.

Return Value

Font

Description

The MakeFont() function returns a Font value. The return value can be assigned to a Font variable, or may be used as a parameter within a statement that takes a Font setting as a parameter (such as Create Text statement or Set Style statement).

See Font clause for more information about Font settings.

Example

Include "mapbasic.def" 
Dim big_title As Font
big_title = MakeFont("Arial", 1, 20,BLACK,WHITE)

See Also:

CurrentFont() function, Font clause, StyleAttr() function