Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
5.3.0 - English

Change language to:
Français - 日本語 - Português

Please note that the recommended version of Scilab is 2025.0.0. This page might be outdated.
See the recommended documentation of this function

Scilab manual >> Graphics Library > text > graphics_fonts

graphics_fonts

description of fonts used in graphic figures

Description

Some Graphic entities such as Text, Axes, Label or Legend entities display one or more character strings in graphic figures. The appearance of the displayed strings can be modified by specifying different fonts and character sizes.

Changing font

Fonts used in graphic figures are selected from a set of fonts called loaded fonts. In other words, the loaded fonts are the ones currenlty available in graphic figures. The list of these fonts can be obtained using the xlfont function without argument. By default, Scilab contains a set of 11 loaded fonts. This set can be modified and extended using the xlfont function with a font name as argument. The added font can either be loaded from a file or be one of the system. To know the list of fonts available on the system use the xlfont('AVAILABLE_FONTS') command. For more information on how to manipulate fonts see xlfont.

Here is the list of the 11 default fonts.

Font numberFont FamilyBoldItalic
0MonospacedNoNo
1ScilabSymbolsNoNo
2SerifNoNo
3SerifNoYes
4SerifYesNo
5SerifYesYes
6SansSerifNoNo
7SansSerifNoYes
8SansSerifYesNo
9SansSerifYesYes
10SansSerifYesYes

The font used by a graphic entities can be modified with its font_style property. This is a positive integer referecing one of the loaded fonts. Its value must be between 0, referecing the first font, and the number of loaded fonts minus one, referencing the last font.

The fractional_font controls the font anti-aliasing. Its value can be either 'on' or 'off'. If its value is 'on' the font is smoothed, otherwise it's not.

Changing character size

The text size of a graphic entity is modified using the font_size property. It is a scalar specifying the displayed character size.

The Scilab character size is different from the Java size. Here is the equivalence between the two scales.

Scilab SizeJava Size
08
110
212
314
418
524
630
736
842
948
1054

The character size might not be an integer. In this case, the result depends on the entities fractional_font property. If fractional_font property is 'on' then the displayed font size is interpolated between the two closest integer. For example, a font size of 2.5 displays characters with a Java size of 13. If fractional_font property is 'off' then the displayed font size is truncated to its integer part. For example, a font size of 2.5 displays characters using a Java size of 12.

<< getfont text Math rendering in Scilab graphics >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Wed Jan 26 16:23:46 CET 2011