mirror of
https://github.com/penpot/penpot.git
synced 2025-07-18 22:57:19 +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
|
@ -2,6 +2,7 @@ use crate::skia::Image;
|
|||
use crate::uuid::Uuid;
|
||||
use crate::with_state;
|
||||
use crate::STATE;
|
||||
use std::collections::HashSet;
|
||||
|
||||
pub fn uuid_from_u32_quartet(a: u32, b: u32, c: u32, d: u32) -> Uuid {
|
||||
let hi: u64 = ((a as u64) << 32) | b as u64;
|
||||
|
@ -25,3 +26,8 @@ pub fn uuid_from_u32(id: [u32; 4]) -> Uuid {
|
|||
pub fn get_image(image_id: &Uuid) -> Option<&Image> {
|
||||
with_state!(state, { state.render_state().images.get(image_id) })
|
||||
}
|
||||
|
||||
// FIXME: move to a different place ?
|
||||
pub fn get_fallback_fonts() -> &'static HashSet<String> {
|
||||
with_state!(state, { state.render_state().fonts().get_fallback() })
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue