setTitleFontName

The setTitleFontName function is used to set the font name of the mini program page title. By setting a custom font name, you can change the font family of the text displayed in the title bar.

Method signature

copy
setTitleFontName(titleFontName: String):GRVStartupParams.Builder

Parameters

Parameter

Data Type

Default value

Required

Description

titleFontName

String

""

Yes

Set the font name of the mini program page title.

The value must be a non-empty string. If an empty string ("") is passed, the system default font is used

Sample

Set the font by using the xxx.otf file, where the font is configured.

copy
val startupParams = GRVStartupParams.createBuilderForApp(context, appId)
    .setTitleFontName("font/xxx.otf")
    .build()
Griver.openApp(startupParams,null)

User experience

Value

Screenshot

"xxx.otf"

image.png