hBasic > hManual > Fonts

hBasic Manual

Fonts

Font Families Font families available for CONSOLE.SET
Scaled Text About scaled pixels

Font Families
 for CONSOLE.SET "FONT <number | family>"

e.g CONSOLE.SET "FONT sans-serif.BOLD"

Families found on most devices.

monospace
serif
sans-serif
sans-serif-light
sans-serif-thin
sans-serif-condensed
Families as of Lollipop

casual
cursive
monospace
sans-serif-black
sans-serif-condensed
sans-serif-condensed-light
sans-serif
sans-serif-light
sans-serif-medium
sans-serif-thin

SANS-SERIF-SMALLCAPS
serif
serif-monospace
Android Font Styles

Normal
Bold
Italic
Bold_Italic
or  N
or  B
or  I
or  BI

Scaled Text

Some commands such as CONSOLE.SET "TEXTSIZE <size>" can accept scaled pixel sizes.
These are diffferent to dip (device independent pixels), in that furthur scaling is applied according to the android device user preferences (e.g Display settings of device). These are refered to as scaled pixels (SP).

To honour SP sizes, you can set the console text size with a negative size,

e.g CONSOLE.SET "TEXTSIZE = -16"           % positive values are DP, negative values are SP

If the user has enlarged the fonts in the device systems settings, then the font will appear larger than the equivalent  size of 16dp.

To get the perceived scaled pixel density, you can use

SCREEN.SIZE  size[]_array[], realsize[]_array[], density_DP_nvar, density_SP_nvar
 
e.g density_SP returns 320 on a 160 dpi display with a user preference scale of 2X in settings.