pub struct TextLayer {
pub font_data: Vec<u8>,
pub font_size: f32,
pub color: Color,
pub x: i32,
pub y: i32,
}Expand description
Construction-time settings for one text layer, passed to
D3d11VideoCompositorHandle::add_text_layer — the
text sibling of super::video_layer::VideoLayer, which add_source
takes the same way. font_data (raw TTF/OTF bytes; this crate bundles
no font of its own) has no sane default, so — mirroring
super::video_layer::VideoLayer::new, which takes the one field a
caller must supply (rect) and defaults the rest — Self::new takes
only font_data and defaults font_size/color/x/y, all freely
reassignable before the call to add_text_layer.
Fields§
§font_data: Vec<u8>§font_size: f32Pixel height of rendered glyphs (not a point size).
color: Color§x: i32Initial top-left corner of the layer — like VideoLayer::rect’s
x/y, but with no width/height counterpart, since a text
layer’s size is only known once something has actually rasterized
its content (e.g. D3d11TextLayerHandle::set_text).
y: i32