font::font(const string & face, int size, const color & fg) : platform_object(), impl(0) { string cache_name = string::format(L"%s %d %f %f %f %f", face.w_string(), size, fg[color::COMPONENT_RED], fg[color::COMPONENT_GREEN], fg[color::COMPONENT_BLUE], fg[color::COMPONENT_ALPHA]); if (fonts.contains_index(cache_name)) { gsgl::log(string::format(L"font: loading font '%ls'", cache_name.w_string())); impl = fonts[cache_name]; } else { gsgl::log(string::format(L"font: creating font '%ls'", cache_name.w_string())); impl = new font_impl(face, size, fg); fonts[cache_name] = impl; } } // font::font()