Merge pull request #8295 from electron/more-default-font-families

Support cursive/fantasy default font families
This commit is contained in:
Kevin Sawicki 2016-12-28 13:42:35 -08:00 committed by GitHub
commit 219693d91f
2 changed files with 6 additions and 0 deletions

View file

@ -251,6 +251,10 @@ void WebContentsPreferences::OverrideWebkitPrefs(
prefs->sans_serif_font_family_map[content::kCommonScript] = font;
if (fonts->GetString("monospace", &font))
prefs->fixed_font_family_map[content::kCommonScript] = font;
if (fonts->GetString("cursive", &font))
prefs->cursive_font_family_map[content::kCommonScript] = font;
if (fonts->GetString("fantasy", &font))
prefs->fantasy_font_family_map[content::kCommonScript] = font;
}
int size;
if (self->web_preferences_.GetInteger("defaultFontSize", &size))

View file

@ -269,6 +269,8 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
* `serif` String (optional) - Defaults to `Times New Roman`.
* `sansSerif` String (optional) - Defaults to `Arial`.
* `monospace` String (optional) - Defaults to `Courier New`.
* `cursive` String (optional) - Defaults to `Script`.
* `fantasy` String (optional) - Defaults to `Impact`.
* `defaultFontSize` Integer (optional) - Defaults to `16`.
* `defaultMonospaceFontSize` Integer (optional) - Defaults to `13`.
* `minimumFontSize` Integer (optional) - Defaults to `0`.