changed the font loading code to avoid seg fault