Merge pull request #6242 from penpot/ladybenko-10666-builtin-fonts

🎉 Load built-in font and its variants (wasm)
This commit is contained in:
Elena Torró 2025-04-11 08:48:31 +02:00 committed by GitHub
commit de8e27feb8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 97 additions and 54 deletions

View file

@ -39,6 +39,10 @@ impl FontFamily {
pub fn new(id: Uuid, weight: u32, style: FontStyle) -> Self {
Self { id, style, weight }
}
pub fn alias(&self) -> String {
format!("{}", self)
}
}
impl fmt::Display for FontFamily {

View file

@ -1,6 +1,6 @@
use crate::{
math::Rect,
render::{DEFAULT_EMOJI_FONT, DEFAULT_FONT},
render::{default_font, DEFAULT_EMOJI_FONT},
};
use skia_safe::{
self as skia,
@ -133,7 +133,7 @@ impl TextLeaf {
style.set_font_size(self.font_size);
style.set_font_families(&[
self.serialized_font_family(),
DEFAULT_FONT.to_string(),
default_font(),
DEFAULT_EMOJI_FONT.to_string(),
]);
style