Add font-fallback on OpenHarmony and fix several compilation issues (#32141)

* Add OpenHarmony support for allocator / profile

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

* gfx: Build harfbuzz from source on OHOS

Updates `freetype-sys` to v0.20.1, which includes a build
fix for OpenHarmony.

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

* gfx: Don't depend on fontconfig on OpenHarmony

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

* gfx: Add ohos font fallback

Hardcode HarmonyOS_Sans_SC_Regular for Chinese

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

* libservo: OHOS useragent, and explicitly opt out of sandboxing

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

* libservo: Disable get_native_media_display_and_gl_context on ohos

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

---------

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
This commit is contained in:
Jonathan Schwender 2024-05-02 20:32:51 +02:00 committed by GitHub
parent 9acf2182cd
commit ca064eaa51
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 307 additions and 27 deletions

View file

@ -9,7 +9,12 @@ static ALLOC: Allocator = Allocator;
pub use crate::platform::*;
#[cfg(not(any(windows, target_os = "android", feature = "use-system-allocator")))]
#[cfg(not(any(
windows,
target_os = "android",
feature = "use-system-allocator",
target_env = "ohos"
)))]
mod platform {
use std::os::raw::c_void;
@ -32,7 +37,11 @@ mod platform {
#[cfg(all(
not(windows),
any(target_os = "android", feature = "use-system-allocator")
any(
target_os = "android",
feature = "use-system-allocator",
target_env = "ohos"
)
))]
mod platform {
pub use std::alloc::System as Allocator;