slint-ui/slint · error

large glyph x coordinate

Error message

large glyph x coordinate

What it means

Error "large glyph x coordinate" thrown in slint-ui/slint.

Source

Thrown at internal/compiler/passes/embed_glyphs.rs:491

                    SCALE_CONTEXT.with(|ctx| {
                        let font_ref = swash_font_ref(font_to_use);
                        let mut ctx = ctx.borrow_mut();
                        let mut scaler = ctx
                            .builder(font_ref)
                            .size(*pixel_size as f32)
                            .normalized_coords(normalized_coords)
                            .build();
                        let image = swash::scale::Render::new(&[swash::scale::Source::Outline])
                            .format(swash::zeno::Format::Alpha)
                            .render(&mut scaler, glyph_id);

                        match image {
                            Some(image) => {
                                let p = image.placement;
                                BitmapGlyph {
                                    x: i16::try_from(p.left * 64)
                                        .expect("large glyph x coordinate"),
                                    y: i16::try_from((p.top - p.height as i32) * 64)
                                        .expect("large glyph y coordinate"),
                                    width: i16::try_from(p.width).expect("large width"),
                                    height: i16::try_from(p.height).expect("large height"),
                                    x_advance: i16::try_from((advance_width * 64.) as i64)
                                        .expect("large advance width"),
                                    data: image.data,
                                }
                            }
                            None => BitmapGlyph {
                                x: 0,
                                y: 0,
                                width: 0,
                                height: 0,
                                x_advance: i16::try_from((advance_width * 64.) as i64)
                                    .expect("large advance width"),
                                data: vec![],
                            },

View on GitHub (pinned to 3fd8f2ec03)

Solutions

  1. Reduce the glyph atlas size or subset the font so coordinates fit.
  2. Use a smaller font size or fewer glyphs.

When it happens

Trigger: Thrown at internal/compiler/passes/embed_glyphs.rs:491 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of slint-ui/slint@3fd8f2ec03 (2026-08-19). Data as JSON: /api/errors/74aa36c56aa6fa3f. Report an issue: GitHub.