summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-08-18 23:59:19 +0100
committerCarl Hetherington <cth@carlh.net>2015-08-18 23:59:19 +0100
commitbe0899b93837bf8929282d85aa90f5390ba17755 (patch)
tree11b885f92de084a7f9f102847a42c951dd97c226 /src
parentfe6921ea758a84d3982180cb2a8e6d95be9cf732 (diff)
Better default font directories on Linux and OS X.
Diffstat (limited to 'src')
-rw-r--r--src/wx/fonts_dialog.cc14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/wx/fonts_dialog.cc b/src/wx/fonts_dialog.cc
index 9564f6b77..b880c5167 100644
--- a/src/wx/fonts_dialog.cc
+++ b/src/wx/fonts_dialog.cc
@@ -118,7 +118,19 @@ FontsDialog::set_from_file_clicked ()
/* The wxFD_CHANGE_DIR here prevents a `could not set working directory' error 123 on Windows when using
non-Latin filenames or paths.
*/
- wxFileDialog* d = new wxFileDialog (this, _("Choose a font file"), wxT (""), wxT (""), wxT ("*.ttf"), wxFD_CHANGE_DIR);
+ wxString default_dir = "";
+#ifdef DCPOMATIC_LINUX
+ if (boost::filesystem::exists ("/usr/share/fonts/truetype")) {
+ default_dir = "/usr/share/fonts/truetype";
+ } else {
+ default_dir = "/usr/share/fonts";
+ }
+#endif
+#ifdef DCPOMATIC_OSX
+ default_dir = "/System/Library/Fonts";
+#endif
+
+ wxFileDialog* d = new wxFileDialog (this, _("Choose a font file"), default_dir, wxT (""), wxT ("*.ttf"), wxFD_CHANGE_DIR);
int const r = d->ShowModal ();
if (r != wxID_OK) {