# Coding Filter to generate Masters at export

**URL:** <https://forum.glyphsapp.com/t/coding-filter-to-generate-masters-at-export/33565>\
**Category:** Showcase\
**Created:** [May 15, 2025, 2:00pm UTC](https://forum.glyphsapp.com/t/coding-filter-to-generate-masters-at-export/33565 "2025-05-15T14:00:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![HugoJ](https://forum.glyphsapp.com/user_avatar/forum.glyphsapp.com/hugoj/32/30341_2.png) [@HugoJ](https://forum.glyphsapp.com/u/HugoJ)\
**Post date:** [May 15, 2025, 2:00pm UTC](https://forum.glyphsapp.com/t/coding-filter-to-generate-masters-at-export/33565/1 "2025-05-15T14:00:50Z")

</div>

Hey,

I’m working on a custom filter plugin to dynamically generate masters during variable font export — essentially to create VF subsets from instances that don’t have dedicated masters. Let me explain the use case:

I have a font with Compressed and Normal width masters. However, I also need to export a _Condensed_ VF, even though Condensed only exists as an instance, not a master.

To handle that, I want to:

- Generate Condensed masters on the fly at export time (based on the Condensed instances).
- Remove any masters not relevant for this export.
- Avoid using “Disable Masters” since it runs **before** the filter, and if all masters are disabled, the export fails due to having no masters left.

My current script does the following:

1. Defines a filter with the instances I want to turn into temporary masters (including setting the VF origin if needed).
2. Removes all other masters manually — without relying on the “Disable Masters” CP.
3. Proceeds with the VF export using only the relevant, dynamically generated masters.

* * *

But I’m still facing issues at the end about problem with the designspace.

 ![Screenshot 2025-05-15 at 15.57.31](https://forum.glyphsapp.com/uploads/default/original/3X/c/f/cf8d111739332a21829cd5617ddd4d5c18481811.jpeg)

Fun fact, is if I generate the font, open it and export it without my custom filter, export work.

Here is the repo with the Filter Plugin :

> **[GitHub - HugoJourdan/generate-masters-at-export](https://github.com/HugoJourdan/generate-masters-at-export)**
>
> Contribute to HugoJourdan/generate-masters-at-export development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![SCarewe](https://forum.glyphsapp.com/user_avatar/forum.glyphsapp.com/scarewe/32/18952_2.png) [@SCarewe](https://forum.glyphsapp.com/u/SCarewe)\
**Post date:** [May 15, 2025, 4:05pm UTC](https://forum.glyphsapp.com/t/coding-filter-to-generate-masters-at-export/33565/2 "2025-05-15T16:05:07Z")

</div>

Why not export the full variable font and then subset it with fontTools? That’s much more reliable.

---

<div class="post-metadata">

**Author:** ![HugoJ](https://forum.glyphsapp.com/user_avatar/forum.glyphsapp.com/hugoj/32/30341_2.png) [@HugoJ](https://forum.glyphsapp.com/u/HugoJ)\
**Post date:** [May 15, 2025, 4:06pm UTC](https://forum.glyphsapp.com/t/coding-filter-to-generate-masters-at-export/33565/3 "2025-05-15T16:06:42Z")

</div>

I know that’s possible Sebastian 😉  
But I’m looking for a solution that works without any extra libraries and can run directly from Glyphs

---

<div class="post-metadata">

**Author:** ![SCarewe](https://forum.glyphsapp.com/user_avatar/forum.glyphsapp.com/scarewe/32/18952_2.png) [@SCarewe](https://forum.glyphsapp.com/u/SCarewe)\
**Post date:** [May 15, 2025, 4:08pm UTC](https://forum.glyphsapp.com/t/coding-filter-to-generate-masters-at-export/33565/4 "2025-05-15T16:08:09Z")

</div>

…but why? That will only cause you headaches.

---

<div class="post-metadata">

**Author:** ![HugoJ](https://forum.glyphsapp.com/user_avatar/forum.glyphsapp.com/hugoj/32/30341_2.png) [@HugoJ](https://forum.glyphsapp.com/u/HugoJ)\
**Post date:** [May 15, 2025, 4:10pm UTC](https://forum.glyphsapp.com/t/coding-filter-to-generate-masters-at-export/33565/5 "2025-05-15T16:10:18Z")

</div>

I have my reasons 😇
