pub struct CharShape {Show 32 fields
pub text_paint: Option<TextPaint>,
pub raw_data: Option<Vec<u8>>,
pub font_ids: [u16; 7],
pub ratios: [u8; 7],
pub spacings: [i8; 7],
pub relative_sizes: [u8; 7],
pub char_offsets: [i8; 7],
pub base_size: i32,
pub attr: u32,
pub italic: bool,
pub bold: bool,
pub underline_type: UnderlineType,
pub outline_type: u8,
pub shadow_type: u8,
pub shadow_offset_x: i8,
pub shadow_offset_y: i8,
pub text_color: ColorRef,
pub underline_color: ColorRef,
pub shade_color: ColorRef,
pub shadow_color: ColorRef,
pub border_fill_id: u16,
pub strike_color: ColorRef,
pub strikethrough: bool,
pub subscript: bool,
pub superscript: bool,
pub emboss: bool,
pub engrave: bool,
pub emphasis_dot: u8,
pub underline_shape: u8,
pub strike_shape: u8,
pub kerning: bool,
pub use_font_space: bool,
}Expand description
글자 모양 (HWPTAG_CHAR_SHAPE)
Default 는 수동 구현이다 — 파생하면 relative_sizes 가
스펙 위반값 0 이 된다(#4141).
Fields§
§text_paint: Option<TextPaint>Explicit glyph paint; independent of font weight and advance metrics.
raw_data: Option<Vec<u8>>원본 레코드 바이트 (라운드트립 보존용, 있으면 직렬화 시 우선 사용)
font_ids: [u16; 7]언어별 글꼴 ID 참조값 (한글, 영어, 한자, 일어, 기타, 기호, 사용자)
ratios: [u8; 7]언어별 장평 (50%~200%)
spacings: [i8; 7]언어별 자간 (-50%~50%)
relative_sizes: [u8; 7]언어별 상대 크기 (10%~250%)
char_offsets: [i8; 7]언어별 글자 위치 (-100%~100%)
base_size: i32기준 크기 (HWPUNIT, 0pt~4096pt)
attr: u32속성 비트 플래그
italic: bool기울임 여부
bold: bool진하게 여부
underline_type: UnderlineType밑줄 종류
outline_type: u8외곽선 종류
shadow_type: u8그림자 종류
shadow_offset_x: i8그림자 X 방향 오프셋 (-100~100%)
shadow_offset_y: i8그림자 Y 방향 오프셋 (-100~100%)
text_color: ColorRef글자 색
underline_color: ColorRef밑줄 색
shade_color: ColorRef음영 색
shadow_color: ColorRef그림자 색
border_fill_id: u16글자 테두리/배경 ID (5.0.2.1 이상)
strike_color: ColorRef취소선 색
strikethrough: bool취소선 여부
subscript: bool위/아래 첨자
superscript: bool§emboss: bool양각 여부 (bit 13)
engrave: bool음각 여부 (bit 14)
emphasis_dot: u8강조점 종류 (bit 21-24, 0=없음, 1=● 2=○ 3=ˇ 4=˜ 5=・ 6=:)
underline_shape: u8밑줄 모양 (bit 4-7, 표 27 선 종류: 0=실선, 1=긴점선, …)
strike_shape: u8취소선 모양 (bit 26-29, 표 27 선 종류)
kerning: bool커닝 여부 (bit 30)
use_font_space: bool글꼴에 어울리는 빈칸 사용 여부 (bit 25)
Trait Implementations§
Source§impl Default for CharShape
relative_sizes 만 Rust 파생 기본값(0)이 아니라 스펙 기본값 100 이다. 나머지 필드는
파생값과 같다.
impl Default for CharShape
relative_sizes 만 Rust 파생 기본값(0)이 아니라 스펙 기본값 100 이다. 나머지 필드는
파생값과 같다.
§왜 파생 Default 로는 안 되는가 (#4141)
OWPML 은 relSz 를 xs:positiveInteger minInclusive=10 / maxInclusive=250,
default="100" 으로 정의한다(mydocs/manual/OWPML SCHEMA/Header XML schema.xml:716-728).
0 은 타입 수준에서 이미 불법이다. 한컴은 실효 크기를 기준 크기 × 상대크기% 로
해석하므로 0 이 저장되면 10pt 글자가 0.1pt 로 그려져 문서가 사실상 백지가 된다
(samples/SO-SUEOP.hwp 변환본 한컴 PDF 실측: 46쪽 10,604 span 전부 0.12pt).
이 값을 채우지 않는 생성 경로가 여럿이다 — HWP3 변환(parser/hwp3/mod.rs:526, HWP3
레코드에 상대크기 개념 자체가 없다), HWPX charPr 의 relSz 자식 부재와 id 갭
채움(parser/hwpx/header.rs:588, :848-858), HML RELSIZE 부재
(parser/hml/reader.rs:599-605), HTML import. 세 라이터(HWP5·HWPX·HML)는 모두 가드 없이
IR 값을 그대로 방출한다. 기본값을 스펙에 맞추면 그 전부가 한 곳에서 해소된다.
HWP5 바이너리 파서는 이미 100 을 폴백한다(parser/doc_info.rs:542-545) — 파생 Default 의
0 은 그 폴백과도 불일치였다.
§장평 ratios (#4161)
OWPML ratio 는 default=“100”, xs:positiveInteger [50,200] 이라 파생값 0 은 타입
수준에서 불법이고, HWP5 파서 폴백(parser/doc_info.rs:528-532)도 100 이다. 렌더러
폭 경로는 전부 ratio > 0.0 폴백이라 0→100 전환의 자체 렌더 산출은 동일하며,
저장 축(HWP5·HWPX·HML)의 스키마 불법값 방출만 사라진다.
§왜 base_size 는 그대로 두는가
OWPML height 는 xs:integer(제약 없음, default=1000)라 0 이 스키마 합법이고,
실표본에서 기본값 base_size 가 소비되는 사례가 없다(#4161 stage1 §5). 반면 1000 으로
바꾸면 doclang/adapter/inline.rs 의 “폰트 정보 없음” sentinel, hidden-text 은닉
판정(0pt→10pt), 무가드 레이아웃 소비(renderer/style_resolver.rs:341) 세 축의 계약이
움직인다. “기본값 유래” 프로버넌스 설계가 필요한 별도 이슈로 남긴다.
§음영색 sentinel (#4155)
shade_color 의 파생 기본값 0 은 검정이고, HWP5 라이터가 그대로 저장하면 한컴이
글자마다 순검정 사각형을 칠해 본문 전체가 검정 막대가 된다(samples/SO-SUEOP.hwp
변환본 한컴 PDF 실측: 3쪽에 줄 크기 검정 fill 65개, 원본은 글리프 크기 35개).
rhwp 자신은 이 결함을 볼 수 없다 — 렌더러가 검정을 “음영 없음” sentinel 로 읽는다.
한컴은 “음영 없음“을 0xFFFFFFFF 로 쓴다 — 코퍼스 380건에서 22,189회, 검정은 0회다.
HWPX shadeColor="none" 과 한/글 HML 4294967295 도 같은 값으로 수렴한다. 정의는
crate::model::color::NONE 하나이며, 세 라이터(HWP5·HWPX·HML)가 무수정으로 정합한다.
§왜 필드를 전부 나열하는가
CharShape 에 필드가 추가되면 이 impl 이 컴파일 에러를 낸다. 새 필드의 기본값을 스펙과
대조하도록 강제하는 장치다 — 조용한 표류를 막는다.
impl Eq for CharShape
Auto Trait Implementations§
impl Forget for CharShape
impl Freeze for CharShape
impl Move for CharShape
impl RefUnwindSafe for CharShape
impl Send for CharShape
impl Sync for CharShape
impl Unpin for CharShape
impl UnsafeUnpin for CharShape
impl UnwindSafe for CharShape
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
T, using the provided data to resolve any offsets.