mirror of
https://github.com/penpot/penpot.git
synced 2025-07-22 02:48:07 +02:00
Merge pull request #6242 from penpot/ladybenko-10666-builtin-fonts
🎉 Load built-in font and its variants (wasm)
This commit is contained in:
commit
de8e27feb8
7 changed files with 97 additions and 54 deletions
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue