summaryrefslogtreecommitdiff
path: root/src/lib/render_text.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-09-29 22:06:36 +0200
committerCarl Hetherington <cth@carlh.net>2020-10-12 17:33:27 +0200
commita839df0d13e463d833f43ed420e8cfd9dda94dff (patch)
tree45cdea9e753b893eb152c73874aae881c1b541a8 /src/lib/render_text.cc
parentb29eb5107c5e77fe01e43010e1582e733f6ceea1 (diff)
Make use of default_font_file().
Diffstat (limited to 'src/lib/render_text.cc')
-rw-r--r--src/lib/render_text.cc15
1 files changed, 2 insertions, 13 deletions
diff --git a/src/lib/render_text.cc b/src/lib/render_text.cc
index f08662678..f9c04dc4d 100644
--- a/src/lib/render_text.cc
+++ b/src/lib/render_text.cc
@@ -25,6 +25,7 @@
#include "font.h"
#include "dcpomatic_assert.h"
#include "warnings.h"
+#include "util.h"
#include <dcp/raw_convert.h>
#include <fontconfig/fontconfig.h>
#include <cairomm/cairomm.h>
@@ -139,19 +140,7 @@ setup_font (StringText const& subtitle, list<shared_ptr<Font> > const& fonts)
fc_config = FcInitLoadConfig ();
}
- optional<boost::filesystem::path> font_file;
-
- try {
- font_file = resources_path() / "LiberationSans-Regular.ttf";
- } catch (boost::filesystem::filesystem_error& e) {
-
- }
-
- /* Hack: try the debian/ubuntu locations if getting the shared path failed */
-
- if (!font_file || !boost::filesystem::exists(*font_file)) {
- font_file = "/usr/share/fonts/truetype/liberation/LiberationSans-Regular.ttf";
- }
+ optional<boost::filesystem::path> font_file = default_font_file ();
BOOST_FOREACH (shared_ptr<Font> i, fonts) {
if (i->id() == subtitle.font() && i->file()) {