diff --git a/conf/default.conf.php b/conf/default.conf.php
index c0a80ce958..e09b4dfc37 100644
--- a/conf/default.conf.php
+++ b/conf/default.conf.php
@@ -1154,4 +1154,9 @@ return array(
'@\.arcconfig$@' => 'js',
),
+ // Set the default monospaced font style for users who haven't set a custom
+ // style.
+ 'style.monospace' => '10px "Menlo", "Consolas", "Monaco", monospace',
+
+
);
diff --git a/src/applications/people/controller/settings/panels/PhabricatorUserPreferenceSettingsPanelController.php b/src/applications/people/controller/settings/panels/PhabricatorUserPreferenceSettingsPanelController.php
index 1edd725ae1..f650a76008 100644
--- a/src/applications/people/controller/settings/panels/PhabricatorUserPreferenceSettingsPanelController.php
+++ b/src/applications/people/controller/settings/panels/PhabricatorUserPreferenceSettingsPanelController.php
@@ -59,6 +59,9 @@ EXAMPLE;
),
'User Guide: Configuring an External Editor');
+ $font_default = PhabricatorEnv::getEnvConfig('style.monospace');
+ $font_default = phutil_escape_html($font_default);
+
$form = id(new AphrontFormView())
->setUser($user)
->setAction('/settings/page/preferences/')
@@ -90,8 +93,7 @@ EXAMPLE;
->setName($pref_monospaced)
->setCaption(
'Overrides default fonts in tools like Differential. '.
- '(Default: 10px "Menlo", "Consolas", "Monaco", '.
- 'monospace)')
+ '(Default: '.$font_default.')')
->setValue($preferences->getPreference($pref_monospaced)))
->appendChild(
id(new AphrontFormMarkupControl())
diff --git a/src/view/page/PhabricatorStandardPageView.php b/src/view/page/PhabricatorStandardPageView.php
index cdc21e0dcb..ba4ef9fb33 100644
--- a/src/view/page/PhabricatorStandardPageView.php
+++ b/src/view/page/PhabricatorStandardPageView.php
@@ -209,33 +209,31 @@ final class PhabricatorStandardPageView extends AphrontPageView {
}
$response = CelerityAPI::getStaticResourceResponse();
+
+ $monospaced = PhabricatorEnv::getEnvConfig('style.monospace');
+
+ $request = $this->getRequest();
+ if ($request) {
+ $user = $request->getUser();
+ if ($user) {
+ $monospaced = nonempty(
+ $user->loadPreferences()->getPreference(
+ PhabricatorUserPreferences::PREFERENCE_MONOSPACED),
+ $monospaced);
+ }
+ }
+
$head =
''.
$response->renderResourcesOfType('css').
+ ''.
$response->renderSingleResource('javelin-magical-init');
- $request = $this->getRequest();
- if ($request) {
- $user = $request->getUser();
- if ($user) {
- $monospaced = $user->loadPreferences()->getPreference(
- PhabricatorUserPreferences::PREFERENCE_MONOSPACED
- );
-
- if (strlen($monospaced)) {
- $head .=
- '';
- }
- }
- }
-
return $head;
}
diff --git a/webroot/rsrc/css/application/base/standard-page-view.css b/webroot/rsrc/css/application/base/standard-page-view.css
index 5793d5bac2..2861d69357 100644
--- a/webroot/rsrc/css/application/base/standard-page-view.css
+++ b/webroot/rsrc/css/application/base/standard-page-view.css
@@ -207,11 +207,6 @@ a.handle-disabled {
background-image: url(/rsrc/image/icon/fatcow/bullet_black.png);
}
-.PhabricatorMonospaced {
- font-family: "Menlo", "Consolas", "Monaco", monospace;
- font-size: 10px;
-}
-
.aphront-developer-error-callout {
padding: 2em;
background: #aa0000;