# Generate() API support for UFO(2|3) and WOFF(2)?

**URL:** <https://forum.glyphsapp.com/t/generate-api-support-for-ufo-2-3-and-woff-2/5832>\
**Category:** Scripting\
**Tags:** feature\
**Created:** [January 23, 2017, 10:08am UTC](https://forum.glyphsapp.com/t/generate-api-support-for-ufo-2-3-and-woff-2/5832 "2017-01-23T10:08:16Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![n7s](https://forum.glyphsapp.com/letter_avatar_proxy/v4/letter/n/5e9695/32.png) [@n7s](https://forum.glyphsapp.com/u/n7s)\
**Post date:** [January 23, 2017, 10:08am UTC](https://forum.glyphsapp.com/t/generate-api-support-for-ufo-2-3-and-woff-2/5832/1 "2017-01-23T10:08:16Z")

</div>

Hi, any future plans for the generate() API ([http://www.docu.glyphsapp.com/#generate](http://www.docu.glyphsapp.com/#generate)) to also support UFO2/UFO3 and WOFF/WOFF2 formats alongside OTF and TTF? In various workflows, it would be quite useful to be able to script exports of all supported formats from python directly (instead of manually through the menu entries). Thanks!

---

<div class="post-metadata">

**Author:** ![GeorgSeifert](https://forum.glyphsapp.com/user_avatar/forum.glyphsapp.com/georgseifert/32/259_2.png) [@GeorgSeifert](https://forum.glyphsapp.com/u/GeorgSeifert)\
**Post date:** [January 23, 2017, 2:51pm UTC](https://forum.glyphsapp.com/t/generate-api-support-for-ufo-2-3-and-woff-2/5832/2 "2017-01-23T14:51:47Z")

</div>

I’ll add the support for WOFF.

---

<div class="post-metadata">

**Author:** ![n7s](https://forum.glyphsapp.com/letter_avatar_proxy/v4/letter/n/5e9695/32.png) [@n7s](https://forum.glyphsapp.com/u/n7s)\
**Post date:** [January 23, 2017, 6:16pm UTC](https://forum.glyphsapp.com/t/generate-api-support-for-ufo-2-3-and-woff-2/5832/3 "2017-01-23T18:16:35Z")

</div>

Thanks! I suspect UFO is trickier to do, but it would still be amazingly useful to have it scriptable.

---

<div class="post-metadata">

**Author:** ![GeorgSeifert](https://forum.glyphsapp.com/user_avatar/forum.glyphsapp.com/georgseifert/32/259_2.png) [@GeorgSeifert](https://forum.glyphsapp.com/u/GeorgSeifert)\
**Post date:** [January 23, 2017, 10:50pm UTC](https://forum.glyphsapp.com/t/generate-api-support-for-ufo-2-3-and-woff-2/5832/4 "2017-01-23T22:50:44Z")

</div>

It is already scriptable. Just not with one line.

```auto
font = currentDocument.font()
ufoExporter = Glyphs.objectWithClassName_("GlyphsFileFormatUFO")
ufoExporter.setConvertNames_(True)
ufoExporter.setFontMaster_(font.masters[0])
url = NSURL.fileURLWithPath_("Path/where/to/save/test.ufo")
ufoExporter.writeUfo_toURL_error_(font, url, None)

```

---

<div class="post-metadata">

**Author:** ![n7s](https://forum.glyphsapp.com/letter_avatar_proxy/v4/letter/n/5e9695/32.png) [@n7s](https://forum.glyphsapp.com/u/n7s)\
**Post date:** [January 24, 2017, 11:57am UTC](https://forum.glyphsapp.com/t/generate-api-support-for-ufo-2-3-and-woff-2/5832/5 "2017-01-24T11:57:20Z")

</div>

Brilliant! Thanks a lot for shedding more light on this.

I can’t seem to find how to select all the available masters for the UFO export though. What am I missing?

---

<div class="post-metadata">

**Author:** ![GeorgSeifert](https://forum.glyphsapp.com/user_avatar/forum.glyphsapp.com/georgseifert/32/259_2.png) [@GeorgSeifert](https://forum.glyphsapp.com/u/GeorgSeifert)\
**Post date:** [January 24, 2017, 2:27pm UTC](https://forum.glyphsapp.com/t/generate-api-support-for-ufo-2-3-and-woff-2/5832/6 "2017-01-24T14:27:31Z")

</div>

```auto
font = currentDocument.font()
ufoExporter = Glyphs.objectWithClassName_("GlyphsFileFormatUFO")
ufoExporter.setConvertNames_(True)
for master in font.masters:
    ufoExporter.setFontMaster_(master)
    url = NSURL.fileURLWithPath_("Path/where/to/save/test.ufo") # assign a unique file name.
    ufoExporter.writeUfo_toURL_error_(font, url, None)

```

---

<div class="post-metadata">

**Author:** ![n7s](https://forum.glyphsapp.com/letter_avatar_proxy/v4/letter/n/5e9695/32.png) [@n7s](https://forum.glyphsapp.com/u/n7s)\
**Post date:** [February 9, 2017, 5:56pm UTC](https://forum.glyphsapp.com/t/generate-api-support-for-ufo-2-3-and-woff-2/5832/7 "2017-02-09T17:56:07Z")

</div>

I really like being able to set parameters for the UFO export like ufoExporter.setConvertNames. Can I get more details about the ufoExporter options? Is that already documented somewhere? Thanks !

---

<div class="post-metadata">

**Author:** ![n7s](https://forum.glyphsapp.com/letter_avatar_proxy/v4/letter/n/5e9695/32.png) [@n7s](https://forum.glyphsapp.com/u/n7s)\
**Post date:** [February 17, 2017, 12:41pm UTC](https://forum.glyphsapp.com/t/generate-api-support-for-ufo-2-3-and-woff-2/5832/8 "2017-02-17T12:41:20Z")

</div>

Where can I find more information about ufoExporter? Any news on the WOFF front? thanks!

---

<div class="post-metadata">

**Author:** ![tribby](https://forum.glyphsapp.com/letter_avatar_proxy/v4/letter/t/e47774/32.png) [@tribby](https://forum.glyphsapp.com/u/tribby)\
**Post date:** [January 6, 2018, 10:21am UTC](https://forum.glyphsapp.com/t/generate-api-support-for-ufo-2-3-and-woff-2/5832/9 "2018-01-06T10:21:51Z")

</div>

@GeorgSeifert Is WOFF actually supported? I can’t seem to get it to work with instance.generate. Would be good for WOFF2 and EOT as well, with an option to choose between TTF and OpenType/CEF
