#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>
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()) {
create_layout()
{
PangoFontMap* c_font_map = pango_cairo_font_map_new ();
+ DCPOMATIC_ASSERT (c_font_map);
Glib::RefPtr<Pango::FontMap> font_map = Glib::wrap (c_font_map);
PangoContext* c_context = pango_font_map_create_context (c_font_map);
+ DCPOMATIC_ASSERT (c_context);
Glib::RefPtr<Pango::Context> context = Glib::wrap (c_context);
return Pango::Layout::create (context);
}
}
}
- float const border_width = dcp::BORDER ? (first.outline_width * target.width / 2048.0) : 0;
+ float const border_width = first.effect() == dcp::BORDER ? (first.outline_width * target.width / 2048.0) : 0;
size.width += 2 * ceil (border_width);
size.height += 2 * ceil (border_width);