DefaultStyleEntry

Struct DefaultStyleEntry 

Source
pub struct DefaultStyleEntry {
    pub name: &'static str,
    pub eng_name: &'static str,
    pub style_type: &'static str,
    pub char_pr_group: u8,
    pub para_pr_group: u8,
}
Expand description

A single entry in a 한글 default style list.

Each entry corresponds to one <hh:style> element that 한글 expects to find in header.xml at a specific positional ID.

§Shape index references

char_pr_group and para_pr_group are indices into the default charPr and paraPr arrays injected at the front of the store by from_registry_with(). Extracted from golden fixture tests/fixtures/textbox.hwpx Contents/header.xml.

Modern (22 styles) mapping:

charPr groups (7 total, id 0-6):
  0: 함초롬바탕 10pt #000000  (바탕글/본문/개요1-7/캡션)
  1: 함초롬돋움 10pt #000000  (쪽 번호)
  2: 함초롬돋움  9pt #000000  (머리말)
  3: 함초롬바탕  9pt #000000  (각주/미주)
  4: 함초롬돋움  9pt #000000  (메모)
  5: 함초롬돋움 16pt #2E74B5  (차례 제목)
  6: 함초롬돋움 11pt #000000  (차례 1-3)

paraPr groups (20 total, id 0-19):
  0:  JUSTIFY left=0      개요8-10 use non-sequential ids (see below)
  1:  JUSTIFY left=1500   본문
  2:  JUSTIFY left=1000 OUTLINE lv=1  개요 1
  3:  JUSTIFY left=2000 OUTLINE lv=2  개요 2
  4:  JUSTIFY left=3000 OUTLINE lv=3  개요 3
  5:  JUSTIFY left=4000 OUTLINE lv=4  개요 4
  6:  JUSTIFY left=5000 OUTLINE lv=5  개요 5
  7:  JUSTIFY left=6000 OUTLINE lv=6  개요 6
  8:  JUSTIFY left=7000 OUTLINE lv=7  개요 7
  9:  JUSTIFY left=0   150% spacing   머리말
 10:  JUSTIFY indent=-1310 130%       각주/미주
 11:  LEFT    left=0   130%           메모
 12:  LEFT    left=0   prev=1200 next=300  차례 제목
 13:  LEFT    left=0   next=700            차례 1
 14:  LEFT    left=1100 next=700           차례 2
 15:  LEFT    left=2200 next=700           차례 3
 16:  JUSTIFY left=9000 OUTLINE lv=9  개요 8  (style 9 → paraPr 16)
 17:  JUSTIFY left=10000 OUTLINE lv=10 개요 9  (style 10 → paraPr 17)  NOTE: lv=10 maps to OUTLINE lv=9 in XML but stored as id=17
 18:  JUSTIFY left=8000 OUTLINE lv=8  개요 10 (style 11 → paraPr 18)  NOTE: lv=8 in XML (level field 7→8)
 19:  JUSTIFY left=0   150% next=800  캡션

Fields§

§name: &'static str

Korean style name (e.g. "바탕글", "개요 1").

§eng_name: &'static str

English style name (e.g. "Normal", "Outline 1").

§style_type: &'static str

Style type: "PARA" for paragraph styles, "CHAR" for character styles.

§char_pr_group: u8

Index into the default charPr array (0–6 for Modern).

References the charPrIDRef attribute in <hh:style> elements.

§para_pr_group: u8

Index into the default paraPr array (0–19 for Modern).

References the paraPrIDRef attribute in <hh:style> elements.

Implementations§

Source§

impl DefaultStyleEntry

Source

pub fn is_char_style(&self) -> bool

Returns true if this is a character style ("CHAR").

Character styles use nextStyleIDRef=0 (바탕글) instead of self-referencing like paragraph styles.

Trait Implementations§

Source§

impl Clone for DefaultStyleEntry

Source§

fn clone(&self) -> DefaultStyleEntry

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for DefaultStyleEntry

Source§

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

Formats the value using the given formatter. Read more
Source§

impl PartialEq for DefaultStyleEntry

Source§

fn eq(&self, other: &DefaultStyleEntry) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for DefaultStyleEntry

Source§

impl Eq for DefaultStyleEntry

Source§

impl StructuralPartialEq for DefaultStyleEntry

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

Source§

fn __clone_box(&self, _: Private) -> *mut ()

§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> 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<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.