Skip to main content

HtmlRenderer

Struct HtmlRenderer 

Source
pub struct HtmlRenderer {
    pub show_paragraph_marks: bool,
    pub show_control_codes: bool,
    /* private fields */
}
Expand description

HTML 렌더러

Fields§

§show_paragraph_marks: bool

문단부호(¶) 표시 여부

§show_control_codes: bool

조판부호 표시 여부

Implementations§

Source§

impl HtmlRenderer

Source

pub fn new() -> Self

Source

pub fn output(&self) -> &str

생성된 HTML 문자열 반환

Source

pub fn render_tree(&mut self, tree: &PageRenderTree)

렌더 트리를 HTML로 렌더링

Trait Implementations§

Source§

impl Renderer for HtmlRenderer

Source§

fn begin_page(&mut self, width: f64, height: f64)

페이지 렌더링 시작
Source§

fn end_page(&mut self)

페이지 렌더링 종료
Source§

fn draw_text(&mut self, text: &str, x: f64, y: f64, style: &TextStyle)

텍스트 그리기
Source§

fn draw_text_positioned( &mut self, text: &str, x: f64, y: f64, style: &TextStyle, layout_positions: Option<&[f64]>, )

Layout owner가 확정한 run-relative 문자 경계값으로 텍스트를 그린다. Read more
Source§

fn draw_rect( &mut self, x: f64, y: f64, w: f64, h: f64, corner_radius: f64, style: &ShapeStyle, )

사각형 그리기 (corner_radius > 0이면 둥근 모서리)
Source§

fn draw_line(&mut self, x1: f64, y1: f64, x2: f64, y2: f64, _style: &LineStyle)

선 그리기
Source§

fn draw_ellipse( &mut self, cx: f64, cy: f64, rx: f64, ry: f64, style: &ShapeStyle, )

타원 그리기
Source§

fn draw_image(&mut self, data: &[u8], x: f64, y: f64, w: f64, h: f64)

이미지 그리기
Source§

fn draw_path(&mut self, commands: &[PathCommand], style: &ShapeStyle)

패스 그리기 (벡터 도형)

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> Finish for T

Source§

fn finish(self)

Does nothing but move self, equivalent to drop.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<U, T> ToOwnedObj<U> for T
where U: FromObjRef<T>,

Source§

fn to_owned_obj(&self, data: FontData<'_>) -> U

Convert this type into T, using the provided data to resolve any offsets.
Source§

impl<U, T> ToOwnedTable<U> for T
where U: FromTableRef<T>,

Source§

fn to_owned_table(&self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more