Convert otf font files to ttf

396 阅读1分钟

The instruction of converting otf to ttf on Mac

Reason

Microsoft has trouble with .otf files, opting to emit a bitmap rather than text when generating PDFs that reference these fonts. We should convert all our existing .otf files to .ttf and redploy them.

Steps

  • Install fontforge
    brew install fontforge
  • Use fontforge script to convert otf file
    1. create a fontforge script convert.ff file like following, first line is the path of your fontforge, default one is #!/usr/local/bin/fontforge
      #!/opt/homebrew/bin/fontforge
      i=1
      while ( i<$argc )
        Open($argv[i])
        Generate($argv[i]:r + ".ttf")
        i = i+1
      endloop
    
    1. chmod +x convert.ff
    2. convert all otf files to ttf.
      ./convert.ff *.otf

Reference

answers.microsoft.com/en-us/msoff… fontforge.org/docs/tutori…