1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-01 14:20:04 -04:00

Improve docs, especially of epaint, and add epaint/CHANGELOG.md

This commit is contained in:
Emil Ernerfeldt
2021-10-10 15:35:13 +02:00
parent 88d087b462
commit e547b149ca
15 changed files with 160 additions and 90 deletions

View File

@@ -201,6 +201,8 @@ impl Default for FontDefinitions {
}
/// The collection of fonts used by `epaint`.
///
/// Required in order to paint text.
pub struct Fonts {
pixels_per_point: f32,
definitions: FontDefinitions,
@@ -214,6 +216,8 @@ pub struct Fonts {
}
impl Fonts {
/// Create a new [`Fonts`] for text layout.
/// This call is expensive, so only create on [`Fonts`] and then reuse it.
pub fn new(pixels_per_point: f32, definitions: FontDefinitions) -> Self {
assert!(
0.0 < pixels_per_point && pixels_per_point < 100.0,