Skip to content

Segfault when reverting to a file with added glyphs #486

Closed
mskala opened this Issue Mar 29, 2013 · 8 comments

4 participants

@mskala
fontforge member
mskala commented Mar 29, 2013
  1. Open the file from https://github.com/fontforge/debugfonts/blob/master/revert-a.pfb
  2. Overwrite it with the file from https://github.com/fontforge/debugfonts/blob/master/revert-b.pfb (which is identical except for the addition of one glyph)
  3. Do "File -> Revert File." Segfault.

This situation arises when FontForge is being used to view the output of other software. I'd like to be able to keep a FontForge window open, run my other code that generates the file, and do revert to refresh what's shown in the FontForge window with what's currently on disk. It usually doesn't work when the file is updated in such a way as to add glyphs.

@mskala
fontforge member
mskala commented Mar 29, 2014

This commit seems like it fixes the problem. It will require some more testing, particularly for the case of "subfonts"; I don't have good examples of those to test against. Unfortunately, because of the history of my own repository, GitHub can't seem to make a clean patch request to the mainline out of this branch; but cherry-picking should be easy.

mskala@2a9de17

@mskala
fontforge member
mskala commented Apr 8, 2014

I'm not sure anyone actually plans to try to reproduce this, but if you do: the debugging that led to my patch suggests that the bug may only bite when "Encoding -> Compact" is turned on. Try that if the bug doesn't seem reproducible.

@blipvert

@mskala I tried for a while to reproduce it with e77c5b9 but I had no luck doing so. I commonly use FontForge to examine MetaFont-generated .pfb files, so my usage pattern is similar, but I haven't really run into this problem myself. I will try building your commit's parent and see if I get the crash.

@davelab6
fontforge member

@mskala is this really fixed for you?

@mskala
fontforge member
mskala commented Jun 30, 2014

I think so. I didn't close when the patch was merged because at the time I couldn't compile mainline FontForge and so couldn't vouch for it not breaking anything else, but you can close it now if you like.

@davelab6
fontforge member

okay great :)

@frank-trampe

@mskala, you can compile FontForge now, right?

@mskala
fontforge member
mskala commented Jul 1, 2014

Yes. I had to re-run bootstrap to get uthash, but it seemed to work okay after that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.