CurrentFont() 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 the Font style currently in use for Map and Layout windows. You can call this function from the MapBasic window in MapInfo Pro.

Syntax

CurrentFont()

Return Value

Font

Description

The CurrentFont() function returns the current Font style. This corresponds to the text style displayed in the Text Style dialog box when a Map or Layout window is the active window. MapInfo Pro will assign the current Font value to any text object drawn by the user. If a MapBasic program creates a text object through the Create Text statement, but the statement does not include a Font clause, the text object will be assigned the current Font value.

The return value of the CurrentFont() function 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 Set Legend statement).

To extract specific attributes of the Font style (such as the color), call the StyleAttr() function.

For more information about Font settings, see Font clause.

Example

Dim f_user_text As Font 
f_user_text = CurrentFont()

See Also:

Font clause, MakeFont() function, Set Style statement, StyleAttr() function