designSpaceDocument icon indicating copy to clipboard operation
designSpaceDocument copied to clipboard

instance should have a 'lib' to store arbitrary data

Open anthrotype opened this issue 8 years ago • 13 comments

When glyphsLib converts a multiple-master glyphs file into a set of UFOs + a designspace file, we lack the ability to store Glyphs.app specific data such as instance custom parameters in the designspace. GlyphsLib currently resorts to passing this residual Glyphs-specific instance data to the caller (fontmake) which then has to apply this on the instance UFOs returned from mutatorMath.

Because of that, generating instances using fontmake from a glyphs source in a single pass (i.e. from glyphs to TTFs), or in two stages (first from glyphs to UFOs+designspace, and then from these to TTFs), will produce different results, as that residual authoring-tool specific data gets thrown away.

Having a lib element in the instance element of a designspace could be a solution for this.

anthrotype avatar Aug 11 '17 12:08 anthrotype

any comments on this?

anthrotype avatar Sep 16 '17 16:09 anthrotype

@anthrotype Maybe an example can help. Is this mostly for Filter and Prefilter?

moyogo avatar Oct 05 '17 14:10 moyogo

No, it's for any instance custom parameter actually. It would work the same as the UFO lib, i.e. a piece of property list embedded in an xml structure.

anthrotype avatar Oct 05 '17 14:10 anthrotype

@anthrotype PR?

moyogo avatar Oct 25 '17 07:10 moyogo

I hope to find some time later this week. I think we could reuse ufoLib.plistFromETree module and ufoLib.plistlib.PlistWriter.

anthrotype avatar Oct 25 '17 11:10 anthrotype

So this is a proposal <lib> element for instance. Do we need one for the top level as well? And would that be a way out for STAT data?

LettError avatar Nov 14 '17 09:11 LettError

So this is a proposal element for instance.

yes, that's what I'd need for storing instance-specific data from Glyphs.app (e.g. so-called "custom parameters") when I make a designspace document in glyphsLib, as I convert a *.glyphs source into a set of UFOs + designspace file.

Do we need one for the top level as well?

I don't immediately need one, but it won't hurt having one I guess.

And would that be a way out for STAT data?

Hm, I don't know. I usually view the lib stuff as custom, optional, private, editor-specific data, whereas STAT is supposedly required for variable fonts output.

anthrotype avatar Nov 14 '17 11:11 anthrotype

Could you give an example of these custom parameters?

LettError avatar Nov 16 '17 14:11 LettError

I could (later maybe), but basically i’d like a place where I could dump any extra data that doesn’t fit and that a property list can store

anthrotype avatar Nov 16 '17 14:11 anthrotype

And by the way, this is not just useful to support the two-step build (first build the UFOs and designspace from glyphs file then build OTFs from the former, getting the same result as building in one go), but also for round-tripping and going back from designspace to Glyphs file

anthrotype avatar Nov 16 '17 14:11 anthrotype

Right, so I thought if there are things in there that have proper names and functions it might be useful to call those out.

LettError avatar Nov 16 '17 14:11 LettError

/cc @belluzj

anthrotype avatar Nov 16 '17 14:11 anthrotype

I don't know yet which custom parameters won't fit in the existing fields (I'm just starting to use designspace documents), but I will discover them soon and report them here.

belluzj avatar Nov 16 '17 17:11 belluzj