Skip to main content

PageLayoutInfo

Struct PageLayoutInfo 

Source
pub struct PageLayoutInfo {
Show 14 fields pub page_width: f64, pub page_height: f64, pub header_area: LayoutRect, pub body_area: LayoutRect, pub unmirrored_body_x: f64, pub column_areas: Vec<LayoutRect>, pub column_direction: ColumnDirection, pub footnote_area: LayoutRect, pub footer_area: LayoutRect, pub dpi: f64, pub separator_type: u8, pub separator_width: u8, pub separator_color: u32, pub pagination_tolerance_px: f64,
}
Expand description

페이지 레이아웃 정보 (픽셀 단위로 변환된 영역)

Fields§

§page_width: f64

페이지 전체 크기 (px)

§page_height: f64§header_area: LayoutRect

머리말 영역 (px)

§body_area: LayoutRect

본문 영역 (px)

§unmirrored_body_x: f64

같은 구역의 홀수 쪽 본문 원점. 양쪽 바탕쪽의 용지 프레임 기준이다.

§column_areas: Vec<LayoutRect>

단별 본문 영역 (px)

§column_direction: ColumnDirection

원본 단 진행 방향. 단 영역 배열도 내용이 흐르는 순서로 유지한다.

§footnote_area: LayoutRect

각주 영역 (px)

§footer_area: LayoutRect

꼬리말 영역 (px)

§dpi: f64

DPI

§separator_type: u8

단 구분선 종류 (0=없음, 1=실선, 2=점선, 3=파선…)

§separator_width: u8

단 구분선 굵기 (border_width 코드)

§separator_color: u32

단 구분선 색상

§pagination_tolerance_px: f64

페이지네이션 하단 허용치 (px). body_area 를 변경하지 않고 paginator 에게만 추가 공간 제공.

Implementations§

Source§

impl PageLayoutInfo

Source

pub fn from_page_def( page_def: &PageDef, column_def: &ColumnDef, dpi: f64, ) -> Self

PageDef와 ColumnDef로부터 페이지 레이아웃을 계산한다.

Source

pub fn from_page_def_for_page( page_def: &PageDef, column_def: &ColumnDef, dpi: f64, page_number: u32, ) -> Self

PageDef, ColumnDef, 최종 쪽번호로부터 페이지 레이아웃을 계산한다.

Source

pub fn from_page_def_default(page_def: &PageDef, column_def: &ColumnDef) -> Self

기본 DPI(96)로 계산

Source

pub fn apply_page_number_margins( &mut self, page_def: &PageDef, page_number: u32, )

기존 레이아웃을 최종 쪽번호 기준 좌우 여백으로 이동한다.

ColumnDef가 다른 zone layout일 수 있으므로 단 너비/간격은 보존하고, page body의 기준 x 이동량만 각 영역에 적용한다.

Source

pub fn physical_body_height(&self) -> f64

각주 영역을 제외한 물리 본문 높이. 저장 형식의 허용치로 용지를 늘리지 않는다.

Source

pub fn available_body_height(&self) -> f64

레거시 미주 흐름에서 사용하는 추가 페이지네이션 예산. 일반 본문의 줄·표 점유는 physical_body_height를 사용한다.

Source

pub fn column_width_hu(&self) -> i32

단 너비 (HWPUNIT) — vpos 보정에서 segment_width 비교에 사용

Source

pub fn update_footnote_area(&mut self, footnote_height: f64)

각주 영역을 동적으로 계산하여 레이아웃을 갱신한다.

각주 높이만큼 본문 영역 하단에 각주 영역을 설정한다.

Trait Implementations§

Source§

impl Clone for PageLayoutInfo

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PageLayoutInfo

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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