You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When serializing the .glifs, (which we serialize manually) write the header to the stream ourselves, using the specified character
When serializing plists, we don't control writing the header, so we'll have to rewrite. There are options here. All plist writing is now handled through a method in write.rs.
One option is to write to disk, and then use the unix/windows specific methods to go and overwrite the header in place, before closing the file handle: see std::os::unix::fs::FileExt and std::os::windows::fs::FileExt; you'll need slightly different impls on either platform.
the other option would be to have a custom Write type, that would wrap or replace the BufWriter; this would intercept the header and replace it, if needed, otherwise forwarding the bytes to the inner writer.
Thinking about this, I think the first option is totally reasonable. The second option is probably marginally more 'efficient', but I don't think it matters; the main thing we want to avoid is closing and reopening all the file handles.
quote_char
method toWriteOptions
.glif
s, (which we serialize manually) write the header to the stream ourselves, using the specified characterplist
writing is now handled through a method inwrite.rs
.std::os::unix::fs::FileExt
andstd::os::windows::fs::FileExt
; you'll need slightly different impls on either platform.Write
type, that would wrap or replace theBufWriter
; this would intercept the header and replace it, if needed, otherwise forwarding the bytes to the inner writer.Thinking about this, I think the first option is totally reasonable. The second option is probably marginally more 'efficient', but I don't think it matters; the main thing we want to avoid is closing and reopening all the file handles.
Originally posted by @cmyr in #148 (comment)
The text was updated successfully, but these errors were encountered: