How can I convert OTF/TTF files to EOT format?

前端 未结 6 518
日久生厌
日久生厌 2021-01-29 23:57

I need to use @font-face feature and my fonts are in OTF/TTF format and Microsoft browsers support only EOT format. I tried to use Microsoft tool WEFT, but it didn\'t work or I

相关标签:
6条回答
  • 2021-01-30 00:06

    In Ubuntu, install mkeot:

    sudo apt-get install eot-utils
    

    Then:

    mkeot fontfilename.otf > fontfilename.eot
    
    0 讨论(0)
  • 2021-01-30 00:08

    Use http://www.font2web.com/ - this will produce not just EOT, but also SVG and WOFF formats, and converting multiple font files at once, and providing everything in a single archive along with the relevant CSS.

    0 讨论(0)
  • 2021-01-30 00:11

    Use the Font Squirrel Generator - this will produce not just EOT, but also SVG and WOFF formats, and converting multiple font files at once, and providing everything in a single archive along with the relevant CSS.

    0 讨论(0)
  • Here's a quick way to build ttf and eot versions from otf in one step. Of course you can pull out the relevant parts if you don't need all of it. Note that you to get eot from otf you have to go otf->ttf->eot.

    Install both fontforge and ttf2eot. They are available in MacPorts, not sure about other platforms.

    Save this as a script file named otf2ttf2eot.sh:

    (This script has been updated for new fontforge versions; original script at end of post):

    #!/bin/sh
    otfFont="$1.otf"
    ttfFont="$1.ttf"
    eotFont="$1.eot"
    fontforge -c '
    import fontforge
    font = fontforge.open("'$otfFont'")
    font.generate("'$ttfFont'")
    '
    ttf2eot "$ttfFont" >"$eotFont"
    

    Assuming you have a font named FontName.otf, run:

    sh otf2ttf2eot.sh FontName

    Original script for older versions of fontforge:

    #!/bin/sh
    # Convert an OTF font into TTF an EOT formats.
    otfFont="$1.otf"
    ttfFont="$1.ttf"
    eotFont="$1.eot"
    fontforge -c '
        Open("'$otfFont'");
        Generate("'$ttfFont'");
        Quit(0);'
    ttf2eot $ttfFont > $eotFont
    
    0 讨论(0)
  • 2021-01-30 00:16

    http://www.flaticon.com/font-face

    For me, it returned all the font type in a zipped file

    0 讨论(0)
  • 2021-01-30 00:22

    Also worth checking is everything fonts font-face converter. This has woff2 and EOT support as well.

    https://everythingfonts.com/font-face

    If you just want eot conversion they have that too.

    https://everythingfonts.com/otf-to-eot

    0 讨论(0)
提交回复
热议问题