From App Bundle VideoEditor SDK supports adding custom fonts from the app bundle. In this example, we add the font Raleway as well as a system font.
VideoEditor SDK supports custom TTF
and OTF
fonts. Each custom font takes an identifier
, a name
, a fontName
as well as a fontUri
that points to the local font file. Remote resources are also supported, however, they need to be downloaded in advance. For further reference, please have a look at the dedicated section on this.
Furthermore, the SDK also supports adding system fonts. To add these, simply add the matching fontName
, as well as your identifier
and the name
.
video_text_local_example.dart
video_text_local_example.dart import 'package:catalog/models/code_example.dart' ;
import 'package:imgly_sdk/imgly_sdk.dart' ;
import 'package:video_editor_sdk/video_editor_sdk.dart' ;
class VideoTextLocalExample extends CodeExample {
@override
void invoke ( ) async {
final video = Video ( "assets/Skater.mp4" ) ;
final textOptions = TextOptions ( fonts : [
Font ( "custom_font_raleway_regular" , "custom_font_raleway_regular" ,
"Raleway" ,
fontUri : "assets/custom_font_raleway_regular.ttf" ) ,
Font ( "system_font_helvetica" , "Helvetica" , "Helvetica" )
] ) ;
final configuration = Configuration ( text : textOptions ) ;
try {
final result =
await VESDK . openEditor ( video , configuration : configuration ) ;
if ( result != null ) {
print ( result . video ) ;
} else {
return ;
}
} catch ( error ) {
print ( error ) ;
}
}
}