mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
ohos: Detect installed fonts (#32731)
* ohos: Add `ohos_mock` cfg. This allows using the Linux build together with the `ohos` font code, using the fonts ship in the `previewer` directory of the OH SDK. Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> * ohos: Detect installed fonts Scan the systems font folder to detect installed fonts, derive their associated font names and generate the font list based on that. Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> * Use hardcoded filepaths for HMOS Color emojis Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> * Also support parsing OH 4.x Noto fonts Currently we don't have an easy way to test the OH version from the fonts module, so the parsing code has to be extended. Once the OH 5.0 beta has a reliable fontconfig.json filemap, then we can probably get rid of most of the parsing code, and hardcode the OH 4.x Note fonts as a fallback. Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> --------- Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
This commit is contained in:
parent
b5482e34c0
commit
f040b821a3
2 changed files with 477 additions and 40 deletions
|
@ -33,7 +33,7 @@ mod freetype {
|
|||
|
||||
pub mod font;
|
||||
|
||||
#[cfg(all(target_os = "linux", not(target_env = "ohos")))]
|
||||
#[cfg(all(target_os = "linux", not(target_env = "ohos"), not(ohos_mock)))]
|
||||
pub mod font_list;
|
||||
#[cfg(target_os = "android")]
|
||||
mod android {
|
||||
|
@ -42,11 +42,11 @@ mod freetype {
|
|||
}
|
||||
#[cfg(target_os = "android")]
|
||||
pub use self::android::font_list;
|
||||
#[cfg(target_env = "ohos")]
|
||||
#[cfg(any(target_env = "ohos", ohos_mock))]
|
||||
mod ohos {
|
||||
pub mod font_list;
|
||||
}
|
||||
#[cfg(target_env = "ohos")]
|
||||
#[cfg(any(target_env = "ohos", ohos_mock))]
|
||||
pub use self::ohos::font_list;
|
||||
|
||||
pub mod library_handle;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue