LoadGoogleFont

Family: Font · 2 forms

What it does

LoadGoogleFont writes to a Font object: it loads rather than reads. It takes family (a string), and answers an integer. That is the first of 2 forms.

Syntax

1
LoadGoogleFont(family string) → integer
2
LoadGoogleFont(fontID integer, family string)

Parameters

NameTypeIn forms
familystringall
fontIDinteger2

What each form returns

1googleFont = LoadGoogleFont("Inter")integer
2LoadGoogleFont(1, "Inter")nothing

Example · generated

Form 1, the command hands back the id

googleFont = LoadGoogleFont("Inter")DO  Sync()LOOP

Form 2, you choose the id yourself

LoadGoogleFont(1, "Inter")DO  Sync()LOOP

LoadGoogleFont is called and its answer is printed every frame. The DO … LOOP is not decoration: a classic BASIC program ends the moment it runs out of lines, and Sync() is what draws the frame.

Related commands

8 commands in Font