Skip to content

Comments

Use objc2 crates#273

Draft
madsmtm wants to merge 1 commit intoservo:mainfrom
madsmtm:objc2
Draft

Use objc2 crates#273
madsmtm wants to merge 1 commit intoservo:mainfrom
madsmtm:objc2

Conversation

@madsmtm
Copy link

@madsmtm madsmtm commented Feb 20, 2026

Waiting on the next release for a bit nicer interface in objc2-core-text.

let glyph = font.glyph_for_char('a').expect("No glyph for char!");
assert_eq!(font.advance(glyph), Ok(Vector2F::new(1139.0, 0.0)));
assert_eq!(font.origin(glyph), Ok(Vector2F::default()));
assert_eq!(font.origin(glyph), Ok(Vector2F::new(-569.0, -1491.0)));
Copy link
Author

@madsmtm madsmtm Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Font::origin was UB before, see servo/core-foundation-rs#749, after this PR it actually returns valid values.

@nicoburns
Copy link
Contributor

I've rebased this on latest main with the Linux CI fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants