New algorithm for assigning glyphs to text center lines