Hmmm all font file types indeed are 3 characters, maybe it would be better to do `file_name[0...file_name.rindex('.')]` ?