pub struct TextBuilder {
pub codes: Vec<u8>,
pub font: ObjRef,
pub size: f32,
pub position: Point,
pub render_mode: TextRenderMode,
pub fill: Color,
}Expand description
A run of text, ready to PageEdit::push.
The font is named by an indirect /Font dictionary: a regenerated stream
writes /Name Tf and ResourceTable::realize allocates
that name for TextBuilder::font. Obtain the reference from
PageEdit::font_of (a font the page already has) or from
EditDoc::embed_font / EditDoc::standard_font (a font
this save is adding).
crate::ImageBuilder names an /XObject the same way.
Fields§
§codes: Vec<u8>The character codes, in the font’s own encoding.
font: ObjRefThe /Font resource this page reaches the font through.
size: f32The font size in page units.
position: PointWhere the baseline starts, in page space.
render_mode: TextRenderModeHow the glyphs are painted.
fill: ColorThe fill colour.
The alpha is honoured, as PathBuilder::fill’s is. There is no
None here, so alpha 0 paints invisible text rather than no text.
Implementations§
Trait Implementations§
Source§impl Clone for TextBuilder
impl Clone for TextBuilder
Source§fn clone(&self) -> TextBuilder
fn clone(&self) -> TextBuilder
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 moreSource§impl Debug for TextBuilder
impl Debug for TextBuilder
Source§impl PartialEq for TextBuilder
impl PartialEq for TextBuilder
impl StructuralPartialEq for TextBuilder
Auto Trait Implementations§
impl Freeze for TextBuilder
impl RefUnwindSafe for TextBuilder
impl Send for TextBuilder
impl Sync for TextBuilder
impl Unpin for TextBuilder
impl UnsafeUnpin for TextBuilder
impl UnwindSafe for TextBuilder
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