1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
// SPDX-FileCopyrightText: 2026 Minamiyama Kotaro
// SPDX-License-Identifier: AGPL-3.0-only
//! Resolved cell style information: `StyleId`, `ResolvedStyle`, `StyleSheet`.
//!
//! Pure data structures shared as vocabulary between `parse/styles.rs`
//! (builds a `StyleSheet` from `styles.xml`) and `resolve/style.rs` (applies
//! a `ResolvedStyle` to cells); this file contains no logic of its own.
use HashMap;
use Arc;
/// The `cellXfs` index (style ID). Kept type-consistent with
/// `Error::InvalidStyleId(u32)`.
pub type StyleId = u32;
/// A resolved `<font>` entry: just the two properties Issue #38 needs
/// (`size_pt`/`bold` feed the downstream grid-paper detector's overflow-
/// width estimate and heading-block heuristic), not a full transcription
/// of `CT_Font` (color, name, italic, underline, ... are out of scope
/// until a use case needs them).
/// `<xf><alignment horizontal=".."/></xf>`'s horizontal alignment (ECMA-376
/// `ST_HorizontalAlignmentValues`), Issue #42. An `enum` rather than a
/// string so it stays a cheap `Copy` value (Issue #42's stated performance
/// requirement) — vertical alignment and every other `CT_CellAlignment`
/// attribute besides `wrapText`/`horizontal` stay out of scope until a
/// concrete downstream use case needs them, the same "not a full
/// transcription" policy `Font` already follows.
/// Format information once a style ID has been resolved.
/// A table looking up `ResolvedStyle` by `cellXfs` index. Built by
/// `parse/styles.rs`, applied by `resolve/style.rs`.
pub type StyleSheet = ;