Skip to content

Fix loading designspace libs containing data or date values - #419

Merged
cmyr merged 1 commit into
mainfrom
plist-data-load
Sep 25, 2026
Merged

cmyr merged 1 commit into
mainfrom
plist-data-load

Conversation

@cmyr

@cmyr cmyr commented Sep 24, 2026

Copy link
Copy Markdown
Member

We were asking serde for a borrowed str, which the reader-backed deserializer used by load can never produce, so any designspace with a or in a lib failed to load. Also strip indentation inside , which plistlib emits.


I screwed up earlier: my #418 branch was actually PR'd onto this, but I'd never PR'd this itself, so doing that now and then i'll reopen the designspace bit.

We were asking serde for a borrowed str, which the reader-backed
deserializer used by load can never produce, so any designspace with
a <data> or <date> in a lib failed to load. Also strip indentation
inside <data>, which plistlib emits.
@cmyr cmyr mentioned this pull request Sep 24, 2026
Comment thread src/serde_xml_plist.rs
Comment on lines +315 to +317
// per line, and other writers (e.g. python's plistlib) also indent
// each line. If this is multiline, we need to strip all of that
// whitespace before decoding:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fontTools wraps the base64 at 76 columns with each line indented and the payload on its own lines, whereas norad emits it unwrapped on one line.

Also in fonttools empty data is <data></data> versus norad's self-closing <data/>. Both are valid, it would only matter for workflow that rely on exact string diffing. And it is pre-existing, so not blocking this.

@cmyr
cmyr merged commit 1a877b2 into main Sep 25, 2026
5 checks passed
@cmyr
cmyr deleted the plist-data-load branch September 25, 2026 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants