pub struct FontConfig {
pub ui_families: Vec<SharedString>,
pub code_families: Vec<SharedString>,
pub ui_weight: Option<FontWeight>,
pub code_weight: Option<FontWeight>,
}Expand description
Ordered font fallback lists and optional default weights used by Liora-rendered UI and code surfaces.
The default value intentionally leaves the UI list and weights empty, so GPUI
keeps using its platform/system default (.SystemUIFont) and normal text
weight. The code list is also optional; when it is empty, Liora asks GPUI for
the generic Monospace family for code-oriented surfaces. Applications that
want branded typography can load font bytes with load_custom_fonts and
then provide ordered fallback lists and default weights through
FontConfig.
Fields§
§ui_families: Vec<SharedString>Ordered UI font candidates. The first currently available family wins; if none are visible to GPUI, the final candidate is used as the declared fallback.
code_families: Vec<SharedString>Ordered code font candidates. The first currently available family wins;
if none are visible to GPUI, the final candidate is used as the declared
fallback. Empty lists resolve to GPUI’s generic Monospace.
ui_weight: Option<FontWeight>Optional default UI text weight. None keeps GPUI’s normal/platform
default weight; explicit per-component weights such as bold headings
continue to override this value.
code_weight: Option<FontWeight>Optional default code text weight. None keeps GPUI’s normal/platform
default weight for code surfaces.
Implementations§
Source§impl FontConfig
impl FontConfig
Sourcepub fn with_ui_families(
self,
families: impl IntoIterator<Item = impl Into<SharedString>>,
) -> Self
pub fn with_ui_families( self, families: impl IntoIterator<Item = impl Into<SharedString>>, ) -> Self
Returns a config that uses families as the ordered UI fallback list.
Sourcepub fn with_code_families(
self,
families: impl IntoIterator<Item = impl Into<SharedString>>,
) -> Self
pub fn with_code_families( self, families: impl IntoIterator<Item = impl Into<SharedString>>, ) -> Self
Returns a config that uses families as the ordered code fallback list.
Sourcepub fn with_ui_weight(self, weight: FontWeight) -> Self
pub fn with_ui_weight(self, weight: FontWeight) -> Self
Returns a config that uses weight as the default UI text weight.
Sourcepub fn with_code_weight(self, weight: FontWeight) -> Self
pub fn with_code_weight(self, weight: FontWeight) -> Self
Returns a config that uses weight as the default code text weight.
Sourcepub fn ui_families(&self) -> &[SharedString]
pub fn ui_families(&self) -> &[SharedString]
Returns the ordered UI fallback list.
Sourcepub fn code_families(&self) -> &[SharedString]
pub fn code_families(&self) -> &[SharedString]
Returns the ordered code fallback list.
Sourcepub fn ui_weight(&self) -> Option<FontWeight>
pub fn ui_weight(&self) -> Option<FontWeight>
Returns the configured default UI text weight, if any.
Sourcepub fn code_weight(&self) -> Option<FontWeight>
pub fn code_weight(&self) -> Option<FontWeight>
Returns the configured default code text weight, if any.
Trait Implementations§
Source§impl Clone for FontConfig
impl Clone for FontConfig
Source§fn clone(&self) -> FontConfig
fn clone(&self) -> FontConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FontConfig
impl Debug for FontConfig
Source§impl Default for FontConfig
impl Default for FontConfig
Source§fn default() -> FontConfig
fn default() -> FontConfig
impl Eq for FontConfig
Source§impl PartialEq for FontConfig
impl PartialEq for FontConfig
Source§fn eq(&self, other: &FontConfig) -> bool
fn eq(&self, other: &FontConfig) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for FontConfig
Auto Trait Implementations§
impl Freeze for FontConfig
impl RefUnwindSafe for FontConfig
impl Send for FontConfig
impl Sync for FontConfig
impl Unpin for FontConfig
impl UnsafeUnpin for FontConfig
impl UnwindSafe for FontConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().