pub struct FontAtlas(/* private fields */);
Implementations§
Source§impl FontAtlas
impl FontAtlas
Sourcepub fn get(&self) -> &ImFontAtlas
pub fn get(&self) -> &ImFontAtlas
Gets a reference to the native wrapper struct.
Source§impl FontAtlas
impl FontAtlas
Sourcepub fn cast(r: &ImFontAtlas) -> &FontAtlas
pub fn cast(r: &ImFontAtlas) -> &FontAtlas
Converts a native reference into a wrapper reference.
Sourcepub fn cast_mut(r: &mut ImFontAtlas) -> &mut FontAtlas
pub fn cast_mut(r: &mut ImFontAtlas) -> &mut FontAtlas
Converts a native reference into a wrapper reference.
It is safe because if you have a reference to the native reference, you already can change anything.
Source§impl FontAtlas
impl FontAtlas
pub unsafe fn texture_ref(&self) -> ImTextureRef
pub unsafe fn inner(&mut self) -> &mut ImFontAtlas
pub fn current_texture_unique_id(&self) -> TextureUniqueId
pub fn check_texture_unique_id(&self, uid: TextureUniqueId) -> bool
pub fn get_texture_by_unique_id( &self, uid: TextureUniqueId, ) -> Option<TextureId>
Sourcepub fn add_font(&mut self, font: FontInfo) -> FontId
pub fn add_font(&mut self, font: FontInfo) -> FontId
Adds the given font to the atlas.
It returns the id to use this font. FontId
implements Pushable
so you can use it with
Ui::with_push
.
pub fn remove_font(&mut self, font_id: FontId)
Sourcepub fn add_font_collection(
&mut self,
fonts: impl IntoIterator<Item = FontInfo>,
) -> FontId
pub fn add_font_collection( &mut self, fonts: impl IntoIterator<Item = FontInfo>, ) -> FontId
Adds several fonts with as a single ImGui font.
This is useful mainly if different TTF files have different charset coverage but you want to use them all as a unit.
Sourcepub fn add_custom_rect(
&mut self,
size: impl Into<Vector2<u32>>,
draw: impl FnOnce(&mut SubImage<&'_ mut ImageBuffer<Rgba<u8>, &'_ mut [u8]>>),
) -> CustomRectIndex
pub fn add_custom_rect( &mut self, size: impl Into<Vector2<u32>>, draw: impl FnOnce(&mut SubImage<&'_ mut ImageBuffer<Rgba<u8>, &'_ mut [u8]>>), ) -> CustomRectIndex
Adds an arbitrary image to the font atlas.
The returned CustomRectIndex
can be used later to draw the image.
pub fn remove_custom_rect(&mut self, idx: CustomRectIndex)
Methods from Deref<Target = ImFontAtlas>§
pub unsafe fn GetCustomRect(&self, id: i32, out_r: *mut ImFontAtlasRect) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FontAtlas
impl !RefUnwindSafe for FontAtlas
impl !Send for FontAtlas
impl !Sync for FontAtlas
impl Unpin for FontAtlas
impl !UnwindSafe for FontAtlas
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