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

Work around crash on macOS when rendering certain emojis #4712

Merged
merged 1 commit into from
Feb 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions internal/renderers/skia/textlayout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use i_slint_core::graphics::FontRequest;
use i_slint_core::items::{TextHorizontalAlignment, TextVerticalAlignment};
use i_slint_core::lengths::{LogicalLength, ScaleFactor};
use i_slint_core::{items, Color};
use skia_safe::FontMgr;

use super::itemrenderer::to_skia_color;
use super::{PhysicalLength, PhysicalPoint, PhysicalRect, PhysicalSize};
Expand All @@ -33,6 +34,7 @@ thread_local! {
let font_mgr = skia_safe::FontMgr::new();
let type_face_font_provider = skia_safe::textlayout::TypefaceFontProvider::new();
let mut font_collection = skia_safe::textlayout::FontCollection::new();
font_collection.set_default_font_manager(FontMgr::new(), None);
// FontCollection first looks up in the dynamic font manager and then the asset font manager. If the
// family is empty, the default font manager will match against the system default. We want that behavior,
// and only if the family is not present in the system, then we want to fall back to the assert font manager
Expand Down
Loading