pub struct TextObject {
pub x: f64,
pub y: f64,
pub font: String,
pub size: f64,
pub weight: u32,
pub italic: bool,
pub color: u32,
pub text: String,
pub width: Option<f64>,
pub height: Option<f64>,
}Expand description
带位置、字体和内容的文本对象。
Fields§
§x: f64距左边缘的 X 位置(mm)。
y: f64距顶部的 Y 位置(mm)。
font: String字体族名称(如 “SimSun”、“SimHei”)。
size: f64字号(pt)。
weight: u32字重: 400 = 正常, 700 = 粗体。
italic: bool是否斜体。
color: u32文本颜色(RGB 十六进制,如 0x000000 为黑色)。
text: String实际文本内容。
width: Option<f64>可选的文本宽度覆盖(mm)。 如果为 None,写入器将根据字符数估算。
height: Option<f64>可选的文本高度覆盖(mm)。 如果为 None,写入器将使用字号。
Implementations§
Source§impl TextObject
impl TextObject
Trait Implementations§
Source§impl Clone for TextObject
impl Clone for TextObject
Source§fn clone(&self) -> TextObject
fn clone(&self) -> TextObject
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TextObject
impl RefUnwindSafe for TextObject
impl Send for TextObject
impl Sync for TextObject
impl Unpin for TextObject
impl UnsafeUnpin for TextObject
impl UnwindSafe for TextObject
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