aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Schwender <55576758+jschwe@users.noreply.github.com>2024-06-10 09:34:31 +0200
committerGitHub <noreply@github.com>2024-06-10 07:34:31 +0000
commit712f751d48ee7ec49f61484f5682a575ec49c402 (patch)
tree56e73eb0108fd13c5593a40be0a5457f5319a195
parenta91faa7207b203033c7cb6ea62e6541cec07cf58 (diff)
downloadservo-712f751d48ee7ec49f61484f5682a575ec49c402.tar.gz
servo-712f751d48ee7ec49f61484f5682a575ec49c402.zip
gfx: font_list: Fix OpenHarmony build (#32466)
Adapt changes from 1c9120c293cc16c11637feb6003117d4093642b5 to the OpenHarmony font_list.rs.
-rw-r--r--components/gfx/platform/freetype/ohos/font_list.rs12
1 files changed, 4 insertions, 8 deletions
diff --git a/components/gfx/platform/freetype/ohos/font_list.rs b/components/gfx/platform/freetype/ohos/font_list.rs
index 119646285f6..a1717629ad5 100644
--- a/components/gfx/platform/freetype/ohos/font_list.rs
+++ b/components/gfx/platform/freetype/ohos/font_list.rs
@@ -4,16 +4,16 @@
use std::fs::File;
use std::io::Read;
-use std::path::{Path, PathBuf};
+use std::path::Path;
use base::text::{is_cjk, UnicodeBlock, UnicodeBlockMethod};
use log::warn;
+use malloc_size_of_derive::MallocSizeOf;
use serde::{Deserialize, Serialize};
use style::values::computed::{
FontStretch as StyleFontStretch, FontStyle as StyleFontStyle, FontWeight as StyleFontWeight,
};
use style::Atom;
-use webrender_api::NativeFontHandle;
use crate::font_template::{FontTemplate, FontTemplateDescriptor};
use crate::text::FallbackFontSelectionOptions;
@@ -23,7 +23,7 @@ lazy_static::lazy_static! {
}
/// An identifier for a local font on OpenHarmony systems.
-#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
+#[derive(Clone, Debug, Deserialize, Eq, Hash, MallocSizeOf, PartialEq, Serialize)]
pub struct LocalFontIdentifier {
/// The path to the font.
pub path: Atom,
@@ -153,11 +153,7 @@ where
},
None => StyleFontStyle::NORMAL,
};
- let descriptor = FontTemplateDescriptor {
- weight,
- stretch,
- style,
- };
+ let descriptor = FontTemplateDescriptor::new(weight, stretch, style);
callback(FontTemplate::new_for_local_font(
local_font_identifier,
descriptor,