Struct gpui2::TextSystem
source · pub struct TextSystem { /* private fields */ }
Implementations§
source§impl TextSystem
impl TextSystem
pub fn new(platform_text_system: Arc<dyn PlatformTextSystem>) -> Self
pub fn add_fonts(&self, fonts: &[Arc<Vec<u8>>]) -> Result<()>
pub fn font_id(&self, font: &Font) -> Result<FontId>
pub fn bounding_box( &self, font_id: FontId, font_size: Pixels ) -> Result<Bounds<Pixels>>
pub fn typographic_bounds( &self, font_id: FontId, font_size: Pixels, character: char ) -> Result<Bounds<Pixels>>
pub fn advance( &self, font_id: FontId, font_size: Pixels, ch: char ) -> Result<Size<Pixels>>
pub fn units_per_em(&self, font_id: FontId) -> Result<u32>
pub fn cap_height(&self, font_id: FontId, font_size: Pixels) -> Result<Pixels>
pub fn x_height(&self, font_id: FontId, font_size: Pixels) -> Result<Pixels>
pub fn ascent(&self, font_id: FontId, font_size: Pixels) -> Result<Pixels>
pub fn descent(&self, font_id: FontId, font_size: Pixels) -> Result<Pixels>
pub fn baseline_offset( &self, font_id: FontId, font_size: Pixels, line_height: Pixels ) -> Result<Pixels>
pub fn layout_line( &self, text: &str, font_size: Pixels, runs: &[TextRun] ) -> Result<Arc<LineLayout>>
pub fn shape_line( &self, text: SharedString, font_size: Pixels, runs: &[TextRun] ) -> Result<ShapedLine>
pub fn shape_text( &self, text: &str, font_size: Pixels, runs: &[TextRun], wrap_width: Option<Pixels> ) -> Result<SmallVec<[WrappedLine; 1]>>
pub fn start_frame(&self)
pub fn line_wrapper( self: &Arc<Self>, font: Font, font_size: Pixels ) -> Result<LineWrapperHandle>
pub fn raster_bounds( &self, params: &RenderGlyphParams ) -> Result<Bounds<DevicePixels>>
pub fn rasterize_glyph( &self, params: &RenderGlyphParams ) -> Result<(Size<DevicePixels>, Vec<u8>)>
Auto Trait Implementations§
impl !RefUnwindSafe for TextSystem
impl Send for TextSystem
impl Sync for TextSystem
impl Unpin for TextSystem
impl !UnwindSafe for TextSystem
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
Mutably borrows from an owned value. Read more