X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Futil.cc;h=0a060e96084ccf55cd9e913cbf88adc5d6c5afac;hb=e64a1a9aae0200d14feed49a4c6cf537bf5708a4;hp=7ba9242fae5d795b6a9a1a0d7cf77cdd103bf531;hpb=7555175e605aab5567020ce48b00bfa6f4d2b726;p=dcpomatic.git diff --git a/src/lib/util.cc b/src/lib/util.cc index 7ba9242fa..0a060e960 100644 --- a/src/lib/util.cc +++ b/src/lib/util.cc @@ -379,16 +379,16 @@ DCPOMATIC_ENABLE_WARNINGS #ifdef DCPOMATIC_WINDOWS putenv ("PANGOCAIRO_BACKEND=fontconfig"); - putenv (String::compose("FONTCONFIG_PATH=%1", shared_path().string()).c_str()); + putenv (String::compose("FONTCONFIG_PATH=%1", resources_path().string()).c_str()); #endif #ifdef DCPOMATIC_OSX setenv ("PANGOCAIRO_BACKEND", "fontconfig", 1); - setenv ("FONTCONFIG_PATH", shared_path().string().c_str(), 1); + setenv ("FONTCONFIG_PATH", resources_path().string().c_str(), 1); #endif Pango::init (); - dcp::init (); + dcp::init (tags_path()); #if defined(DCPOMATIC_WINDOWS) || defined(DCPOMATIC_OSX) /* Render something to fontconfig to create its cache */ @@ -825,14 +825,16 @@ audio_channel_types (list mapped, int channels) case dcp::CENTRE: case dcp::LS: case dcp::RS: - case dcp::LC: - case dcp::RC: case dcp::BSL: case dcp::BSR: ++non_lfe; break; case dcp::HI: case dcp::VI: + case dcp::MOTION_DATA: + case dcp::SYNC_SIGNAL: + case dcp::SIGN_LANGUAGE: + case dcp::CHANNEL_COUNT: break; } } @@ -951,7 +953,7 @@ void emit_subtitle_image (ContentTimePeriod period, dcp::SubtitleImage sub, dcp::Size size, shared_ptr decoder) { /* XXX: this is rather inefficient; decoding the image just to get its size */ - FFmpegImageProxy proxy (sub.png_image()); + FFmpegImageProxy proxy (sub.png_image(), VIDEO_RANGE_FULL); shared_ptr image = proxy.image().image; /* set up rect with height and width */ dcpomatic::Rect rect(0, 0, image->size().width / double(size.width), image->size().height / double(size.height)); @@ -1253,3 +1255,24 @@ decrypt_kdm_with_helpful_error (dcp::EncryptedKDM kdm) } } + +boost::filesystem::path +default_font_file () +{ + boost::filesystem::path liberation_normal; + try { + liberation_normal = resources_path() / "LiberationSans-Regular.ttf"; + if (!boost::filesystem::exists (liberation_normal)) { + /* Hack for unit tests */ + liberation_normal = resources_path() / "fonts" / "LiberationSans-Regular.ttf"; + } + } catch (boost::filesystem::filesystem_error& e) { + + } + + if (!boost::filesystem::exists(liberation_normal)) { + liberation_normal = "/usr/share/fonts/truetype/liberation/LiberationSans-Regular.ttf"; + } + + return liberation_normal; +}