Ported to C++: Fonts_Logic.