Skip to content

Commit 83d4b5e

Browse files
committed
Fix compile errors from changes, require newer mac_core
1 parent a88fd91 commit 83d4b5e

3 files changed

Lines changed: 9 additions & 7 deletions

File tree

crates/xetex_layout/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ tectonic_mac_core = { path = "../mac_core", version = "0.0.0-dev.0" }
4444
external-harfbuzz = ["tectonic_bridge_harfbuzz/external-harfbuzz"]
4545

4646
[package.metadata.internal_dep_versions]
47-
tectonic_mac_core = "6932d5f15fec0fb5c219b887bdd11b72641af07a"
47+
tectonic_mac_core = "thiscommit:2026-04-27:052BNSA"
4848
tectonic_bridge_core = "thiscommit:2021-01-16:wie2Ejoh"
4949
tectonic_bridge_fontconfig = "89268e8317eee0e23f9c0d572aa764d4504d85b5"
5050
tectonic_bridge_graphite2 = "2722731f9e32c6963fe8c8566a201b33672c5c5a"

crates/xetex_layout/src/font.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,9 @@ pub(crate) fn get_file_name_from_ct_font(ct_font: &CTFont, index: &mut u32) -> O
581581
*index = i as u32;
582582
break;
583583
}
584-
(Some(name1), Some(name2)) if &*name1.as_cstr() == name2 => {
584+
(Some(name1), Some(name2))
585+
if name1.as_cstr().is_some_and(|name1| name1 == name2) =>
586+
{
585587
*index = i as u32;
586588
break;
587589
}

crates/xetex_layout/src/manager/mac.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ fn find_font_with_name(name: CFString, key: FontAttribute) -> Option<CTFontDescr
3030

3131
fn append_name_to_list(font: &CTFont, name_list: &mut Vec<CString>, name_key: FontNameKey) {
3232
let name = font.name(name_key);
33-
if let Some(name) = name {
34-
FontManager::append_to_list(name_list, name.as_cstr());
33+
if let Some(name) = name.as_ref().and_then(|n| n.as_cstr()) {
34+
FontManager::append_to_list(name_list, name);
3535
}
3636
let name = font.localized_name(name_key);
37-
if let Some(name) = name {
38-
FontManager::append_to_list(name_list, name.as_cstr());
37+
if let Some(name) = name.as_ref().and_then(|n| n.as_cstr()) {
38+
FontManager::append_to_list(name_list, name);
3939
}
4040
}
4141

@@ -152,7 +152,7 @@ impl FontManagerBackend for MacBackend {
152152
// SAFETY: CFString has no generic parameters
153153
let ps_name = unsafe { ps_name.downcast::<CFString>() }.unwrap();
154154

155-
names.ps_name = Some(ps_name.get_cstring());
155+
names.ps_name = ps_name.get_cstring();
156156

157157
let font = CTFont::new_descriptor(&font, 0.0);
158158
append_name_to_list(&font, &mut names.full_names, FontNameKey::Full);

0 commit comments

Comments
 (0)