mirror of
https://github.com/penpot/penpot.git
synced 2025-06-21 04:17:03 +02:00
🎉 Implement font fallback to support multiple languages
This commit is contained in:
parent
9733c41ae4
commit
c40de5fb87
7 changed files with 179 additions and 38 deletions
|
@ -14,19 +14,19 @@ pub extern "C" fn store_font(
|
|||
weight: u32,
|
||||
style: u8,
|
||||
is_emoji: bool,
|
||||
is_fallback: bool,
|
||||
) {
|
||||
with_state!(state, {
|
||||
let id = uuid_from_u32_quartet(a, b, c, d);
|
||||
let font_bytes = mem::bytes();
|
||||
|
||||
let family = FontFamily::new(id, weight, style.into());
|
||||
let res = state
|
||||
let _ = state
|
||||
.render_state()
|
||||
.fonts_mut()
|
||||
.add(family, &font_bytes, is_emoji);
|
||||
.add(family, &font_bytes, is_emoji, is_fallback);
|
||||
|
||||
if let Err(msg) = res {
|
||||
eprintln!("{}", msg);
|
||||
}
|
||||
mem::free_bytes();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue