alpha2-engine 0.5.0

Player and exporter facade for alpha2.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! Layout generators: box trees laid out by CSS flexbox and grid (`alpha2_layout`), drawn from
//! vector fills and text textures.
//!
//! Layouts resolve in [`crate::TextTextures`], which holds the fonts, so text is measured and
//! drawn by the same code.

pub(crate) mod draw;
pub use draw::PreparedLayout;
pub(crate) mod paint;

use alpha2_render::RenderSize;

/// The shorter side of `size` in pixels, the unit of layout lengths.
pub(crate) fn unit_of(size: RenderSize) -> f32 {
    crate::text::picture(size).unit()
}