pub struct KeywordResource {
pub page: usize,
pub font_id: Option<String>,
pub font_size: Option<f64>,
}Expand description
文本资源,描述关键字搜索过程中的字体和文本上下文。
对应 Java: org.ofdrw.reader.keyword.KeywordResource
在关键字搜索时,需要字体信息来计算字符宽度,从而确定关键字的 精确矩形区域。
Fields§
§page: usize页码(从 1 开始)。
font_id: Option<String>字体引用 ID。
font_size: Option<f64>字体大小(毫米)。
Implementations§
Source§impl KeywordResource
impl KeywordResource
Sourcepub fn with_font_id(self, font_id: impl Into<String>) -> Self
pub fn with_font_id(self, font_id: impl Into<String>) -> Self
设置字体引用 ID。
Sourcepub fn with_font_size(self, size: f64) -> Self
pub fn with_font_size(self, size: f64) -> Self
设置字体大小。
Trait Implementations§
Source§impl Clone for KeywordResource
impl Clone for KeywordResource
Source§fn clone(&self) -> KeywordResource
fn clone(&self) -> KeywordResource
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 KeywordResource
impl RefUnwindSafe for KeywordResource
impl Send for KeywordResource
impl Sync for KeywordResource
impl Unpin for KeywordResource
impl UnsafeUnpin for KeywordResource
impl UnwindSafe for KeywordResource
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