…lines 1–26 unchanged (26 lines)
27
28#define FONT_SETTINGS_COPY(type, name, jsonKey, ...) \
29 fontInfo->_##name = source->_##name;
30 MTSM_FONT_SETTINGS(FONT_SETTINGS_COPY)
31#undef FONT_SETTINGS_COPY
32
33 // We cannot simply copy the font axes and features with `fontInfo->_FontAxes = source->_FontAxes;`
34 // since that'll just create a reference; we have to manually copy the values.
35 if (source->_FontAxes)
36 {
37 std::map<winrt::hstring, float> fontAxes;
38 for (const auto keyValuePair : source->_FontAxes.value())
39 {
40 fontAxes.insert(std::pair<winrt::hstring, float>(keyValuePair.Key(), keyValuePair.Value()));
41 }
42 fontInfo->_FontAxes = winrt::single_threaded_map(std::move(fontAxes));
43 }
44
45 return fontInfo;
46}
47
48Json::Value FontConfig::ToJson() const
49{
…lines 50–97 unchanged (48 lines)