Q: Custom font not uploading in divi theme 
I am adding fonts in divi but this showing error, I've tried both file types i.e. ttf and otf but nothing works can anyone help?

A: It's not related to Divi.
By default WordPress block .ttf file upload.
Here is another topic about that: https://wordpress.stackexchange.com/a/396326/82323
You can use upload_mimes filter to allow ttf upload
To do this, add following code to functions.php
 add_filter('upload_mimes', 'prefix_add_ttf_upload_mimes');
 function prefix_add_ttf_upload_mimes($existing_mimes) {
      $existing_mimes['ttf'] = 'font/ttf';   
      return $existing_mimes;
 }

