diff --git a/cosmic_text/struct.BorrowedWithFontSystem.html b/cosmic_text/struct.BorrowedWithFontSystem.html index 0142690245..76579d11b8 100644 --- a/cosmic_text/struct.BorrowedWithFontSystem.html +++ b/cosmic_text/struct.BorrowedWithFontSystem.html @@ -1,5 +1,5 @@ BorrowedWithFontSystem in cosmic_text - Rust -
pub struct BorrowedWithFontSystem<'a, T> { /* private fields */ }
Expand description

A value borrowed together with an FontSystem

+
pub struct BorrowedWithFontSystem<'a, T> { /* private fields */ }
Expand description

A value borrowed together with an FontSystem

Implementations§

source§

impl<'a> BorrowedWithFontSystem<'a, Buffer>

source

pub fn shape_until_cursor(&mut self, cursor: Cursor, prune: bool)

Shape lines until cursor, also scrolling to include cursor in view

source

pub fn shape_until_scroll(&mut self, prune: bool)

Shape lines until scroll

source

pub fn line_shape(&mut self, line_i: usize) -> Option<&ShapeLine>

Shape the provided line index and return the result

@@ -59,7 +59,7 @@
§Panics
) -> T

Get the internal Buffer, mutably

source

pub fn shape_as_needed(&mut self, prune: bool)

Shape lines until scroll, after adjusting scroll if the cursor moved

source

pub fn action(&mut self, action: Action)

Perform an Action on the editor

-

Trait Implementations§

source§

impl<'a, T: Debug> Debug for BorrowedWithFontSystem<'a, T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a, T> Deref for BorrowedWithFontSystem<'a, T>

§

type Target = T

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl<'a, T> DerefMut for BorrowedWithFontSystem<'a, T>

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.

Auto Trait Implementations§

§

impl<'a, T> Freeze for BorrowedWithFontSystem<'a, T>

§

impl<'a, T> !RefUnwindSafe for BorrowedWithFontSystem<'a, T>

§

impl<'a, T> Send for BorrowedWithFontSystem<'a, T>
where +

Trait Implementations§

source§

impl<'a, T: Debug> Debug for BorrowedWithFontSystem<'a, T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a, T> Deref for BorrowedWithFontSystem<'a, T>

§

type Target = T

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl<'a, T> DerefMut for BorrowedWithFontSystem<'a, T>

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.

Auto Trait Implementations§

§

impl<'a, T> Freeze for BorrowedWithFontSystem<'a, T>

§

impl<'a, T> !RefUnwindSafe for BorrowedWithFontSystem<'a, T>

§

impl<'a, T> Send for BorrowedWithFontSystem<'a, T>
where T: Send,

§

impl<'a, T> Sync for BorrowedWithFontSystem<'a, T>
where T: Sync,

§

impl<'a, T> Unpin for BorrowedWithFontSystem<'a, T>

§

impl<'a, T> !UnwindSafe for BorrowedWithFontSystem<'a, T>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where diff --git a/cosmic_text/struct.FontSystem.html b/cosmic_text/struct.FontSystem.html index c8dbfc0c83..324e847849 100644 --- a/cosmic_text/struct.FontSystem.html +++ b/cosmic_text/struct.FontSystem.html @@ -1,6 +1,6 @@ FontSystem in cosmic_text - Rust

Struct cosmic_text::FontSystem

source ·
pub struct FontSystem { /* private fields */ }
Expand description

Access to the system fonts.

-

Implementations§

source§

impl FontSystem

source

pub fn new() -> Self

Create a new FontSystem, that allows access to any installed system fonts

+

Implementations§

source§

impl FontSystem

source

pub fn new() -> Self

Create a new FontSystem, that allows access to any installed system fonts

§Timing

This function takes some time to run. On the release build, it can take up to a second, while debug builds can take up to ten times longer. For this reason, it should only be @@ -11,16 +11,16 @@

§Timing
source

pub fn db(&self) -> &Database

Get the database.

source

pub fn db_mut(&mut self) -> &mut Database

Get a mutable reference to the database.

source

pub fn into_locale_and_db(self) -> (String, Database)

Consume this FontSystem and return the locale and database.

-
source

pub fn cache_fonts(&mut self, ids: Vec<ID>)

Concurrently cache fonts by id list

-
source

pub fn get_font(&mut self, id: ID) -> Option<Arc<Font>>

Get a font by its ID.

-
source

pub fn is_monospace(&self, id: ID) -> bool

source

pub fn get_monospace_ids_for_scripts( +

source

pub fn cache_fonts(&mut self, ids: Vec<ID>)

Concurrently cache fonts by id list

+
source

pub fn get_font(&mut self, id: ID) -> Option<Arc<Font>>

Get a font by its ID.

+
source

pub fn is_monospace(&self, id: ID) -> bool

source

pub fn get_monospace_ids_for_scripts( &self, scripts: impl Iterator<Item = [u8; 4]> -) -> Vec<ID>

source

pub fn get_font_supported_codepoints_in_word( +) -> Vec<ID>

source

pub fn get_font_supported_codepoints_in_word( &mut self, id: ID, word: &str -) -> Option<usize>

source

pub fn get_font_matches(&mut self, attrs: Attrs<'_>) -> Arc<Vec<FontMatchKey>>

Trait Implementations§

source§

impl Debug for FontSystem

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +) -> Option<usize>

source

pub fn get_font_matches(&mut self, attrs: Attrs<'_>) -> Arc<Vec<FontMatchKey>>

Trait Implementations§

source§

impl Debug for FontSystem

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for FontSystem

§

impl !RefUnwindSafe for FontSystem

§

impl Send for FontSystem

§

impl Sync for FontSystem

§

impl Unpin for FontSystem

§

impl !UnwindSafe for FontSystem

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

diff --git a/src/cosmic_text/font/system.rs.html b/src/cosmic_text/font/system.rs.html index 9348041c0f..83b456b43d 100644 --- a/src/cosmic_text/font/system.rs.html +++ b/src/cosmic_text/font/system.rs.html @@ -412,6 +412,9 @@

Files

410 411 412 +413 +414 +415
use crate::{Attrs, Font, FontMatchAttrs, HashMap, ShapePlanCache};
 use alloc::string::String;
 use alloc::sync::Arc;
@@ -630,18 +633,21 @@ 

Files

pub fn cache_fonts(&mut self, mut ids: Vec<fontdb::ID>) { #[cfg(feature = "std")] use rayon::iter::{IntoParallelRefIterator, ParallelIterator}; - ids = ids - .into_iter() - .filter(|id| { - let contains = self.font_cache.contains_key(id); - if !contains { - unsafe { - self.db.make_shared_face_data(*id); + #[cfg(feature = "std")] + { + ids = ids + .into_iter() + .filter(|id| { + let contains = self.font_cache.contains_key(id); + if !contains { + unsafe { + self.db.make_shared_face_data(*id); + } } - } - !contains - }) - .collect::<_>(); + !contains + }) + .collect::<_>(); + } #[cfg(feature = "std")] let fonts = ids.par_iter();