diff options
author | Martin Robinson <mrobinson@igalia.com> | 2024-06-19 22:26:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-19 20:26:19 +0000 |
commit | cd2ab36759dc58acdeb2b8321c38b7345b524a63 (patch) | |
tree | 30b940ca93f61d937f719c214d66f22374c90b2f /components/shared/fonts/lib.rs | |
parent | 9f8118abc7fd9aba49e422cf13b5243e3b582fdc (diff) | |
download | servo-cd2ab36759dc58acdeb2b8321c38b7345b524a63.tar.gz servo-cd2ab36759dc58acdeb2b8321c38b7345b524a63.zip |
Rename `gfx` to `fonts` (#32556)
This crate only takes care of fonts now as graphics related things are
split into other crates. In addition, this exposes data structures at
the top of the crate, hiding the implementation details and making it
simpler to import them.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Diffstat (limited to 'components/shared/fonts/lib.rs')
-rw-r--r-- | components/shared/fonts/lib.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/components/shared/fonts/lib.rs b/components/shared/fonts/lib.rs new file mode 100644 index 00000000000..032dcfd19e0 --- /dev/null +++ b/components/shared/fonts/lib.rs @@ -0,0 +1,20 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ + +#![deny(unsafe_code)] + +use std::sync::Arc; + +use malloc_size_of_derive::MallocSizeOf; +use range::{int_range_index, RangeIndex}; +use serde::{Deserialize, Serialize}; + +int_range_index! { + #[derive(Deserialize, MallocSizeOf, Serialize)] + /// An index that refers to a byte offset in a text run. This could + /// the middle of a glyph. + struct ByteIndex(isize) +} + +pub type WebFontLoadFinishedCallback = Arc<dyn Fn(bool) + Send + Sync + 'static>; |