We solve such corner cases by assigning the character-pixel to the box that has the closest box center.
the chargrid representation is constructed as follows: for each character c k at location b k , the area covered by that character is filled with some constant index value E(c k ).