diff --git a/docs/api/structures/web-preferences.md b/docs/api/structures/web-preferences.md index 4325bcb29c95..047a13cefc2a 100644 --- a/docs/api/structures/web-preferences.md +++ b/docs/api/structures/web-preferences.md @@ -67,6 +67,7 @@ * `monospace` string (optional) - Defaults to `Courier New`. * `cursive` string (optional) - Defaults to `Script`. * `fantasy` string (optional) - Defaults to `Impact`. + * `math` string (optional) - Defaults to `Latin Modern Math`. * `defaultFontSize` Integer (optional) - Defaults to `16`. * `defaultMonospaceFontSize` Integer (optional) - Defaults to `13`. * `minimumFontSize` Integer (optional) - Defaults to `0`. diff --git a/shell/browser/web_contents_preferences.cc b/shell/browser/web_contents_preferences.cc index 1527c45be457..035ecad6439d 100644 --- a/shell/browser/web_contents_preferences.cc +++ b/shell/browser/web_contents_preferences.cc @@ -450,6 +450,10 @@ void WebContentsPreferences::OverrideWebkitPrefs( iter != default_font_family_.end()) prefs->fantasy_font_family_map[blink::web_pref::kCommonScript] = iter->second; + if (auto iter = default_font_family_.find("math"); + iter != default_font_family_.end()) + prefs->math_font_family_map[blink::web_pref::kCommonScript] = + iter->second; } if (default_font_size_)