fonts: Reduce the public API surface (#39112)

This change marks all items that are not used by other crates as
`pub(crate)` instead of `pub`.

Additionally, I've removed all code that turned out to be unused. I
think most of it was used only by `layout-2013`.


Testing: The correctness of these changes is verified by the compiler,
so no tests are needed.

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This commit is contained in:
Simon Wülker 2025-09-03 22:15:51 +02:00 committed by GitHub
parent 8993235e8f
commit 73e39cf085
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 106 additions and 157 deletions

View file

@ -45,7 +45,7 @@ use crate::{FontData, LowercaseFontFamilyName, PlatformFontMethods, SystemFontSe
static SMALL_CAPS_SCALE_FACTOR: f32 = 0.8; // Matches FireFox (see gfxFont.h)
pub type FontParameters = (FontKey, Au, Vec<FontVariation>);
pub(crate) type FontParameters = (FontKey, Au, Vec<FontVariation>);
#[derive(MallocSizeOf)]
struct FontGroupRef(#[conditional_malloc_size_of] Arc<RwLock<FontGroup>>);
@ -749,7 +749,7 @@ impl FontContext {
}
}
pub type ScriptWebFontLoadFinishedCallback =
pub(crate) type ScriptWebFontLoadFinishedCallback =
Box<dyn FnOnce(LowercaseFontFamilyName, Option<FontTemplate>) + Send>;
pub(crate) enum WebFontLoadInitiator {