arcdps_imgui\fonts/
mod.rs

1use crate::fonts::font::Font;
2use crate::internal::RawCast;
3use crate::Ui;
4
5pub mod atlas;
6pub mod font;
7pub mod glyph;
8pub mod glyph_ranges;
9
10/// # Fonts
11impl<'ui> Ui<'ui> {
12    /// Returns the current font
13    #[doc(alias = "GetFont")]
14    pub fn current_font(&self) -> &Font {
15        unsafe { Font::from_raw(&*sys::igGetFont()) }
16    }
17    /// Returns the current font size (= height in pixels) with font scale applied
18    #[doc(alias = "GetFontSize")]
19    pub fn current_font_size(&self) -> f32 {
20        unsafe { sys::igGetFontSize() }
21    }
22    /// Returns the UV coordinate for a white pixel.
23    ///
24    /// Useful for drawing custom shapes with the draw list API.
25    #[doc(alias = "FontTexUvWhitePixel")]
26    pub fn font_tex_uv_white_pixel(&self) -> [f32; 2] {
27        let mut out = sys::ImVec2::zero();
28        unsafe { sys::igGetFontTexUvWhitePixel(&mut out) };
29        out.into()
30    }
31    /// Sets the font scale of the current window
32    #[doc(alias = "SetWindowFontScale")]
33    pub fn set_window_font_scale(&self, scale: f32) {
34        unsafe { sys::igSetWindowFontScale(scale) }
35    }
36}