Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Face with multiple font sizes #43

Closed
mahkoh opened this issue Sep 30, 2021 · 2 comments
Closed

Using Face with multiple font sizes #43

mahkoh opened this issue Sep 30, 2021 · 2 comments

Comments

@mahkoh
Copy link

mahkoh commented Sep 30, 2021

I'm storing a Face in an Arc that is shared across multiple threads. When I need to perform shaping, I call Face::clone and set the font size on the cloned Face. This clone is not entirely free because Face contains a Vec.

I would like for shape to take an additional argument that contains all of the mutable properties of a Face so that Face can be treated as immutable after construction. E.g.

struct FaceConfig {
    pub pixels_per_em: Option<(u16, u16)>,
    pub points_per_em: Option<f32>,
}

pub fn shape(face: &Face, config: &FaceConfig, features: &[Feature], buffer: UnicodeBuffer) -> GlyphBuffer {
@RazrFalcon
Copy link
Owner

Yes, I guess it makes sense.

@behdad
Copy link

behdad commented Sep 30, 2021

struct FaceConfig {
    pub pixels_per_em: Option<(u16, u16)>,
    pub points_per_em: Option<f32>,
}

We call them Font in HarfBuzz.

@RazrFalcon RazrFalcon closed this as not planned Won't fix, can't repro, duplicate, stale Aug 17, 2023
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

No branches or pull requests

3 participants