feat: Allow customizing the default math font (#38514)

This commit is contained in:
zeeker999 2023-06-07 05:26:32 +08:00 committed by GitHub
parent 5c1321b20a
commit 28332c94bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View file

@ -67,6 +67,7 @@
* `monospace` string (optional) - Defaults to `Courier New`. * `monospace` string (optional) - Defaults to `Courier New`.
* `cursive` string (optional) - Defaults to `Script`. * `cursive` string (optional) - Defaults to `Script`.
* `fantasy` string (optional) - Defaults to `Impact`. * `fantasy` string (optional) - Defaults to `Impact`.
* `math` string (optional) - Defaults to `Latin Modern Math`.
* `defaultFontSize` Integer (optional) - Defaults to `16`. * `defaultFontSize` Integer (optional) - Defaults to `16`.
* `defaultMonospaceFontSize` Integer (optional) - Defaults to `13`. * `defaultMonospaceFontSize` Integer (optional) - Defaults to `13`.
* `minimumFontSize` Integer (optional) - Defaults to `0`. * `minimumFontSize` Integer (optional) - Defaults to `0`.

View file

@ -450,6 +450,10 @@ void WebContentsPreferences::OverrideWebkitPrefs(
iter != default_font_family_.end()) iter != default_font_family_.end())
prefs->fantasy_font_family_map[blink::web_pref::kCommonScript] = prefs->fantasy_font_family_map[blink::web_pref::kCommonScript] =
iter->second; 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_) if (default_font_size_)