pub struct CT_Font {
pub id: u32,
pub font_name: String,
pub family_name: Option<String>,
pub charset: Option<String>,
pub italic: bool,
pub bold: bool,
pub serif: bool,
pub fixed_width: bool,
pub font_file: Option<String>,
}Expand description
对应 Java: org.ofdrw.core.text.font.CT_Font
字体描述,定义文档中使用的字体属性。 对应 GB/T 33190-2016 第 11.1 节图 58 表 44。
Fields§
§id: u32字体 ID。
font_name: String字体名称(如 “SimSun”)。
family_name: Option<String>字体族名称(可选)。
charset: Option<String>字符集(可选,如 “GB2312”、“Unicode”)。
italic: bool是否斜体。
bold: bool是否粗体。
serif: bool是否衬线字体。
fixed_width: bool是否等宽字体。
font_file: Option<String>字体文件路径(可选)。
Implementations§
Source§impl CT_Font
impl CT_Font
Sourcepub fn family_name(self, name: impl Into<String>) -> Self
pub fn family_name(self, name: impl Into<String>) -> Self
设置字体族名称。
Sourcepub fn fixed_width(self, fixed: bool) -> Self
pub fn fixed_width(self, fixed: bool) -> Self
设置等宽字体。
Sourcepub fn get_font_name(&self) -> &str
pub fn get_font_name(&self) -> &str
获取字体名称。
Sourcepub fn get_family_name(&self) -> Option<&str>
pub fn get_family_name(&self) -> Option<&str>
获取字体族名称。
Sourcepub fn get_charset(&self) -> Option<&str>
pub fn get_charset(&self) -> Option<&str>
获取字符集。
Sourcepub fn is_fixed_width(&self) -> bool
pub fn is_fixed_width(&self) -> bool
是否等宽字体。
Sourcepub fn to_xml_string(&self) -> String
pub fn to_xml_string(&self) -> String
序列化为 OFD XML 字符串。
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CT_Font
impl RefUnwindSafe for CT_Font
impl Send for CT_Font
impl Sync for CT_Font
impl Unpin for CT_Font
impl UnsafeUnpin for CT_Font
impl UnwindSafe for CT_Font
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