mirror of
https://github.com/emilk/egui.git
synced 2026-09-01 06:10:06 -04:00
Fix docs
This commit is contained in:
@@ -141,7 +141,7 @@ impl Painter {
|
|||||||
self.pixels_per_point
|
self.pixels_per_point
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Read-only access to the shared [`Fonts`].
|
/// Read-only access to the shared [`FontsView`].
|
||||||
///
|
///
|
||||||
/// See [`Context`] documentation for how locks work.
|
/// See [`Context`] documentation for how locks work.
|
||||||
#[inline]
|
#[inline]
|
||||||
@@ -149,7 +149,7 @@ impl Painter {
|
|||||||
self.ctx.fonts(reader)
|
self.ctx.fonts(reader)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Read-write access to the shared [`Fonts`].
|
/// Read-write access to the shared [`FontsView`].
|
||||||
///
|
///
|
||||||
/// See [`Context`] documentation for how locks work.
|
/// See [`Context`] documentation for how locks work.
|
||||||
#[inline]
|
#[inline]
|
||||||
|
|||||||
@@ -846,13 +846,13 @@ impl Ui {
|
|||||||
self.ctx().output_mut(writer)
|
self.ctx().output_mut(writer)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Read-only access to [`Fonts`].
|
/// Read-only access to [`FontsView`].
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn fonts<R>(&self, reader: impl FnOnce(&FontsView<'_>) -> R) -> R {
|
pub fn fonts<R>(&self, reader: impl FnOnce(&FontsView<'_>) -> R) -> R {
|
||||||
self.ctx().fonts(reader)
|
self.ctx().fonts(reader)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Read-write access to [`Fonts`].
|
/// Read-write access to [`FontsView`].
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn fonts_mut<R>(&self, reader: impl FnOnce(&mut FontsView<'_>) -> R) -> R {
|
pub fn fonts_mut<R>(&self, reader: impl FnOnce(&mut FontsView<'_>) -> R) -> R {
|
||||||
self.ctx().fonts_mut(reader)
|
self.ctx().fonts_mut(reader)
|
||||||
|
|||||||
@@ -266,7 +266,7 @@ impl<'t> TextEdit<'t> {
|
|||||||
/// let mut layouter = |ui: &egui::Ui, buf: &dyn egui::TextBuffer, wrap_width: f32| {
|
/// let mut layouter = |ui: &egui::Ui, buf: &dyn egui::TextBuffer, wrap_width: f32| {
|
||||||
/// let mut layout_job: egui::text::LayoutJob = my_memoized_highlighter(buf.as_str());
|
/// let mut layout_job: egui::text::LayoutJob = my_memoized_highlighter(buf.as_str());
|
||||||
/// layout_job.wrap.max_width = wrap_width;
|
/// layout_job.wrap.max_width = wrap_width;
|
||||||
/// ui.fonts(|f| f.layout_job(layout_job))
|
/// ui.fonts_mut(|f| f.layout_job(layout_job))
|
||||||
/// };
|
/// };
|
||||||
/// ui.add(egui::TextEdit::multiline(&mut my_code).layouter(&mut layouter));
|
/// ui.add(egui::TextEdit::multiline(&mut my_code).layouter(&mut layouter));
|
||||||
/// # });
|
/// # });
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ pub struct TextShape {
|
|||||||
/// Usually the top left corner of the first character.
|
/// Usually the top left corner of the first character.
|
||||||
pub pos: Pos2,
|
pub pos: Pos2,
|
||||||
|
|
||||||
/// The laid out text, from [`Fonts::layout_job`].
|
/// The laid out text, from [`FontsView::layout_job`].
|
||||||
pub galley: Arc<Galley>,
|
pub galley: Arc<Galley>,
|
||||||
|
|
||||||
/// Add this underline to the whole text.
|
/// Add this underline to the whole text.
|
||||||
|
|||||||
@@ -700,7 +700,7 @@ impl FontsView<'_> {
|
|||||||
/// How full is the font atlas?
|
/// How full is the font atlas?
|
||||||
///
|
///
|
||||||
/// This increases as new fonts and/or glyphs are used,
|
/// This increases as new fonts and/or glyphs are used,
|
||||||
/// but can also decrease in a call to [`Self::begin_pass`].
|
/// but can also decrease in a call to [`Fonts::begin_pass`].
|
||||||
pub fn font_atlas_fill_ratio(&self) -> f32 {
|
pub fn font_atlas_fill_ratio(&self) -> f32 {
|
||||||
self.fonts.atlas.fill_ratio()
|
self.fonts.atlas.fill_ratio()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ impl Paragraph {
|
|||||||
|
|
||||||
/// Layout text into a [`Galley`].
|
/// Layout text into a [`Galley`].
|
||||||
///
|
///
|
||||||
/// In most cases you should use [`crate::Fonts::layout_job`] instead
|
/// In most cases you should use [`crate::FontsView::layout_job`] instead
|
||||||
/// since that memoizes the input, making subsequent layouting of the same text much faster.
|
/// since that memoizes the input, making subsequent layouting of the same text much faster.
|
||||||
pub fn layout(fonts: &mut FontsImpl, job: Arc<LayoutJob>, pixels_per_point: f32) -> Galley {
|
pub fn layout(fonts: &mut FontsImpl, job: Arc<LayoutJob>, pixels_per_point: f32) -> Galley {
|
||||||
profiling::function_scope!();
|
profiling::function_scope!();
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ use emath::{Align, GuiRounding as _, NumExt as _, OrderedFloat, Pos2, Rect, Vec2
|
|||||||
///
|
///
|
||||||
/// This supports mixing different fonts, color and formats (underline etc).
|
/// This supports mixing different fonts, color and formats (underline etc).
|
||||||
///
|
///
|
||||||
/// Pass this to [`crate::Fonts::layout_job`] or [`crate::text::layout`].
|
/// Pass this to [`crate::FontsView::layout_job`] or [`crate::text::layout`].
|
||||||
///
|
///
|
||||||
/// ## Example:
|
/// ## Example:
|
||||||
/// ```
|
/// ```
|
||||||
@@ -504,7 +504,7 @@ impl TextWrapping {
|
|||||||
|
|
||||||
/// Text that has been laid out, ready for painting.
|
/// Text that has been laid out, ready for painting.
|
||||||
///
|
///
|
||||||
/// You can create a [`Galley`] using [`crate::Fonts::layout_job`];
|
/// You can create a [`Galley`] using [`crate::FontsView::layout_job`];
|
||||||
///
|
///
|
||||||
/// Needs to be recreated if the underlying font atlas texture changes, which
|
/// Needs to be recreated if the underlying font atlas texture changes, which
|
||||||
/// happens under the following conditions:
|
/// happens under the following conditions:
|
||||||
|
|||||||
Reference in New Issue
Block a user