Custom fonts
Android
Preparation
Import font files
The font file must be placed in the assets file
Native
Configure font file name
Configure the font file name in the
rewards_widget_config.json
file. If the file path exists in assets, please add the file path.
copy
"fonts": {
"native": {
"normal": "font/TypeType - TT Interphases Mono Italic.ttf", // normal font
"medium": "font/TypeType - TT Interphases Medium Italic.ttf", // medium font
"bold": "font/TypeType - TT Interphases Bold Italic.ttf" // bold font
}
}
Web/Mini Program
Configure font file name
Configure the font file name in the
rewards_widget_config.json
file. If the file path exists in assets, please add the file path.
copy
{
"fonts":{
"web": {
"normal": "font/TypeType - TT Interphases Mono Italic.ttf", // normal font
"medium": "font/TypeType - TT Interphases Medium Italic.ttf", // medium font
"bold": "font/TypeType - TT Interphases Bold Italic.ttf" // bold font
}
}
}
iOS
Preparation
Step 1:Import font files
The font file must be placed in the main project
Step 2:Configure the font file to the info file
Native
Step 1:Find font name
1.All font names can be printed through the following code
copy
let familyNames = UIFont.familyNames
for familyName in familyNames {
let fontNames = UIFont.fontNames(forFamilyName: familyName)
for fontName in fontNames {
print("Font: \(fontName)")
}
}
2.View the font information printed by the console
Step 2:Configure font name
Configure the found font name into the
rewards_widget_config.json
file
copy
{
"fonts":{
"native": {
"normal":"GraphikTH-Regular", // normal font
"medium":"GraphikTH-Medium", // medium font
"bold":"GraphikTH-Bold", // bold font
}
}
}
Web/Mini Program
Configure font file name
Configure the font file name to the
rewards_widget_config.json
file
copy
{
"fonts":{
"web": {
"normal":"GraphikTH-Regular.ttf", // normal font
"medium":"GraphikTH-Medium.ttf", // medium font
"bold":"GraphikTH-Bold.ttf", // bold font
}
}
}