Skip to content

Make GlyphsBackend writable for glyph data #75

Closed

Description

@ollimeier

See also: https://github.com/googlefonts/fontra/issues/117

Notes from Just:
Regarding the writable glyphs backend:

  • it is in the fontra-glyphs repo (I assume you know that)
  • It currently implements the ReadableFontBackend protocol (defined in protocols.py)
  • It needs to implement all methods of WritableFontBackend (same module)
  • Start with stubs that do nothing
  • Then start sketching out putGlyph()
  • Have a look at _loadFiles, it reads the raw data. We mostly throw that away after parsing, but we should probably hold on to it so we can update it and write it back.

Compare with the fontra backend and the designspace backend, see how they implement writing glyphs.

So, loading .glyphs data goes in two steps:

  • parse file with openstep_plist.load() , this results in "raw" data structures
  • construct objects from the raw data structures into proper objects, lazily / on demand

For writing, we should keep the raw data around, and "patch" it up with our modified data, then write with openstep_plist.dump() (I think that's what it's called)

This strategy should give us minimal changes compared to the original data (this is an important goal).

Activity

  1. self-assigned this
    on Jan 8, 2025
  2. changed the title [-]Need to write a filesystem backend for .glyphs files[/-] [+]Make GlyphsBackend writable[/+] on Jan 8, 2025
  3. changed the title [-]Make GlyphsBackend writable[/-] [+]Make GlyphsBackend writable for glyph data[/+] on Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions