pub struct StyleBuilder { /* private fields */ }Expand description
文字样式构建器(给 ParaBuilder::styled)。
Implementations§
Source§impl StyleBuilder
impl StyleBuilder
Sourcepub fn size(&mut self, mult: f32) -> &mut Self
pub fn size(&mut self, mult: f32) -> &mut Self
字号倍率(相对基准)。非有限或 ≤ 0 忽略(保持默认),与标记前端一致—— 避免 0 字号把 cosmic-text 整形拖进死循环。
Sourcepub fn ring(&mut self) -> &mut Self
pub fn ring(&mut self) -> &mut Self
圈注:以这段文字为中心画一圈椭圆描边(缺省按文字宽窄自适应、颜色跟随墨色;
不占布局尺寸,圈溢出到行距)。尺寸经 ring_radius /
ring_radii 给定后与文字宽窄无关。
Sourcepub fn ring_color(&mut self, hex: &str) -> &mut Self
pub fn ring_color(&mut self, hex: &str) -> &mut Self
圈注描边色(十六进制;非法忽略,跟随墨色)。
Sourcepub fn ring_radius(&mut self, r: f32) -> &mut Self
pub fn ring_radius(&mut self, r: f32) -> &mut Self
圈注定径:正圆,半径 r(逻辑像素)——多字与单字圈出同样大的圈。
Sourcepub fn ring_radii(&mut self, rx: f32, ry: f32) -> &mut Self
pub fn ring_radii(&mut self, rx: f32, ry: f32) -> &mut Self
圈注定径:椭圆,横/纵半径(逻辑像素)。非有限或 ≤ 0 的分量忽略(保持自适应)。
Sourcepub fn ring_stroke(&mut self, w: f32) -> &mut Self
pub fn ring_stroke(&mut self, w: f32) -> &mut Self
圈注线宽(逻辑像素;非有限或 ≤ 0 忽略,保持 0.07 倍字号缺省)。
Sourcepub fn dot_radius(&mut self, r: f32) -> &mut Self
pub fn dot_radius(&mut self, r: f32) -> &mut Self
着重点半径(逻辑像素;非有限或 ≤ 0 忽略,保持 0.09 倍字号缺省)。
Sourcepub fn aside_right(&mut self) -> &mut Self
pub fn aside_right(&mut self) -> &mut Self
边注挂右:这段挂到本行内容的右外侧,参与绘制不参与布局——居中 / 对齐按其余 内容算,边注不挤不偏(「当前」「✓」这类行尾标记用)。
Sourcepub fn aside_left(&mut self) -> &mut Self
pub fn aside_left(&mut self) -> &mut Self
边注挂左:同 aside_right,停靠行首左外侧。
Auto Trait Implementations§
impl Freeze for StyleBuilder
impl RefUnwindSafe for StyleBuilder
impl Send for StyleBuilder
impl Sync for StyleBuilder
impl Unpin for StyleBuilder
impl UnsafeUnpin for StyleBuilder
impl UnwindSafe for StyleBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more