Update for pango API changes

pango::Language::from_string() can fail and also can accept None as
argument.
This commit is contained in:
Sebastian Dröge 2022-11-18 09:46:50 +02:00
parent 1981ffbea0
commit 6e54d3cea9
2 changed files with 2 additions and 2 deletions

View file

@ -295,7 +295,7 @@ impl OnvifMetadataOverlay {
if state.layout.is_none() {
let fontmap = pangocairo::FontMap::new();
let context = fontmap.create_context();
context.set_language(Some(&pango::Language::from_string("en_US")));
context.set_language(Some(&pango::Language::from_string(Some("en_US")).unwrap()));
context.set_base_dir(pango::Direction::Ltr);
let layout = pango::Layout::new(&context);
layout.set_alignment(pango::Alignment::Left);

View file

@ -100,7 +100,7 @@ impl Cea608Overlay {
let video_info = state.video_info.as_ref().unwrap();
let fontmap = pangocairo::FontMap::new();
let context = fontmap.create_context();
context.set_language(Some(&pango::Language::from_string("en_US")));
context.set_language(Some(&pango::Language::from_string(Some("en_US")).unwrap()));
context.set_base_dir(pango::Direction::Ltr);
let layout = pango::Layout::new(&context);
layout.set_alignment(pango::Alignment::Left);