Do you want to say you trace all the glyphs at the same time and then just split them?
It looks pretty easy to do it on the step of marking groups you need to check not if it is also filled but just check one more property of that cell if it is equal. It is the same algo but you will just need to add one additional check inside 4 side floodfill. But yeah maybe in this case you will need layers although I think that the simplest way to implement what I said in my two comments could be done with layers ¯\_(ツ)_/¯. By the way what do you think about the solutions?
(Deferred question) Do they work?