docx_rust/formatting/
character_property.rs

1use hard_xml::{XmlRead, XmlWrite};
2use std::borrow::Cow;
3
4use crate::{
5    __setter, __string_enum, __xml_test_suites,
6    formatting::{Bold, Color, Dstrike, Fonts, Italics, Lang, Outline, Size, Strike, Underline},
7};
8
9use super::{BoldComplex, Caps, Highlight, ItalicsComplex, Position, SmallCaps, VertAlign};
10
11/// Character Property
12///
13/// ```rust
14/// use docx_rust::formatting::{CharacterProperty, UnderlineStyle, HighlightType};
15///
16/// let prop = CharacterProperty::default()
17///     .style_id("foo")
18///     .color("00ff00")
19///     .color(0xff0000)
20///     .color((0x00, 0x00, 0xff))
21///     .size(42isize)
22///     .bold(true)
23///     .italics(false)
24///     .strike(true)
25///     .dstrike(false)
26///     .outline(true)
27///     .highlight(HighlightType::Yellow)
28///     .underline("00ff00")
29///     .underline(("ff0000", UnderlineStyle::Dash));
30/// ```
31#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
32#[cfg_attr(test, derive(PartialEq))]
33#[xml(tag = "w:rPr")]
34pub struct CharacterProperty<'a> {
35    /// Specifies the style ID of the character style.
36    #[xml(child = "w:rStyle")]
37    pub style_id: Option<CharacterStyleId<'a>>,
38    /// Specifies the font.
39    #[xml(child = "w:rFonts")]
40    pub fonts: Option<Fonts>,
41    /// Specifies that the text of the text run is to be bold.
42    #[xml(child = "w:b")]
43    pub bold: Option<Bold>,
44    #[xml(child = "w:bCs")]
45    pub bold_complex: Option<BoldComplex>,
46    /// Specifies that the text of the text run is to be italics.
47    #[xml(child = "w:i")]
48    pub italics: Option<Italics>,
49    ///  Complex Script Italics
50    #[xml(child = "w:iCs")]
51    pub italics_complex: Option<ItalicsComplex>,
52    ///  Display All Characters As Capital Letters
53    #[xml(child = "w:caps")]
54    pub caps: Option<Caps>,
55    ///  Small Caps
56    #[xml(child = "w:smallCaps")]
57    pub small_caps: Option<SmallCaps>,
58    /// Specifies that the contents are to be displayed with a horizontal line through the center of the line.
59    #[xml(child = "w:strike")]
60    pub strike: Option<Strike>,
61    /// Specifies that the contents are to be displayed with two horizontal lines through each character.
62    #[xml(child = "w:dstrike")]
63    pub dstrike: Option<Dstrike>,
64    /// Specifies that the content should be displayed as if it had an outline.
65    #[xml(child = "w:outline")]
66    pub outline: Option<Outline>,
67    ///  Shadow
68    #[xml(child = "w:shadow")]
69    pub shadow: Option<Shadow>,
70    ///  Embossing
71    #[xml(child = "w:emboss")]
72    pub emboss: Option<Emboss>,
73    ///  Imprinting
74    #[xml(child = "w:imprint")]
75    pub imprint: Option<Imprint>,
76    ///  Do Not Check Spelling or Grammar
77    #[xml(child = "w:noProof")]
78    pub no_proof: Option<NoProof>,
79    /// Use Document Grid Settings For Inter-Character Spacing
80    #[xml(child = "w:snapToGrid")]
81    pub snap_to_grid: Option<super::SnapToGrid>,
82    ///  Hidden Text
83    #[xml(child = "w:vanish")]
84    pub vanish: Option<Vanish>,
85    ///  Web Hidden Text
86    #[xml(child = "w:webHidden")]
87    pub web_hidden: Option<WebHidden>,
88    /// Specifies the color to be used to display text.
89    #[xml(child = "w:color")]
90    pub color: Option<Color<'a>>,
91    ///  Character Spacing Adjustment
92    #[xml(child = "w:spacing")]
93    pub spacing: Option<TextSpacing>,
94    ///Expanded/Compressed Text
95    #[xml(child = "w:w")]
96    pub scale: Option<Scale>,
97    ///  Font Kerning
98    #[xml(child = "w:kern")]
99    pub kern: Option<Kern>,
100    /// Vertically Raised or Lowered Text
101    #[xml(child = "w:position")]
102    pub position: Option<Position>,
103    /// Specifies the font size in half points.
104    #[xml(child = "w:sz")]
105    pub size: Option<Size>,
106    ///  Complex Script Font Size
107    #[xml(child = "w:szCs")]
108    pub size_complex: Option<SizeComplex>,
109    ///  Text Highlighting
110    #[xml(child = "w:highlight")]
111    pub highlight: Option<Highlight>,
112    /// Specifies that the content should be displayed with an underline
113    #[xml(child = "w:u")]
114    pub underline: Option<Underline<'a>>,
115    ///  Animated Text Effect
116    #[xml(child = "w:effect")]
117    pub effect: Option<Effect>,
118    ///  Text Border
119    #[xml(child = "w:bdr")]
120    pub border: Option<TextBorder<'a>>,
121    ///  Run Shading
122    #[xml(child = "w:shd")]
123    pub shading: Option<Shading<'a>>,
124    ///  Manual Run Width
125    #[xml(child = "w:fitText")]
126    pub fit_text: Option<FitText>,
127    /// Subscript/Superscript Text
128    #[xml(child = "w:vertAlign")]
129    pub vertical_align: Option<VertAlign>,
130    ///  Right To Left Text
131    #[xml(child = "w:rtl")]
132    pub rtl: Option<RightToLeftText>,
133    ///  Use Complex Script Formatting on Run
134    #[xml(child = "w:cs")]
135    pub complex_script: Option<ComplexScript>,
136    ///  Emphasis Mark
137    #[xml(child = "w:em")]
138    pub emphasis: Option<Emphasis>,
139    /// Specifies the language to be used.
140    #[xml(child = "w:lang")]
141    pub lang: Option<Lang<'a>>,
142    ///  East Asian Typography Settings
143    #[xml(child = "w:eastAsianLayout")]
144    pub east_asian_layout: Option<EastAsianLayout>,
145    ///  Paragraph Mark Is Always Hidden
146    #[xml(child = "w:specVanish")]
147    pub spec_vanish: Option<SpecVanish>,
148    ///  Office Open XML Math
149    #[xml(child = "w:oMath")]
150    pub o_math: Option<OMath>,
151}
152
153impl<'a> CharacterProperty<'a> {
154    __setter!(style_id: Option<CharacterStyleId<'a>>);
155    __setter!(color: Option<Color<'a>>);
156    __setter!(highlight: Option<Highlight>);
157    __setter!(bold: Option<Bold>);
158    __setter!(dstrike: Option<Dstrike>);
159    __setter!(italics: Option<Italics>);
160    __setter!(outline: Option<Outline>);
161    __setter!(strike: Option<Strike>);
162    __setter!(size: Option<Size>);
163    __setter!(underline: Option<Underline<'a>>);
164    __setter!(fonts: Option<Fonts>);
165}
166
167#[derive(Debug, XmlRead, XmlWrite, Clone)]
168#[cfg_attr(test, derive(PartialEq))]
169#[xml(tag = "w:rStyle")]
170pub struct CharacterStyleId<'a> {
171    #[xml(attr = "w:val")]
172    pub value: Cow<'a, str>,
173}
174
175impl<'a, T: Into<Cow<'a, str>>> From<T> for CharacterStyleId<'a> {
176    fn from(val: T) -> Self {
177        CharacterStyleId { value: val.into() }
178    }
179}
180
181#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
182#[cfg_attr(test, derive(PartialEq))]
183#[xml(tag = "w:shadow")]
184pub struct Shadow {
185    #[xml(attr = "w:val")]
186    pub value: Option<bool>,
187}
188
189#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
190#[cfg_attr(test, derive(PartialEq))]
191#[xml(tag = "w:emboss")]
192pub struct Emboss {
193    #[xml(attr = "w:val")]
194    pub value: Option<bool>,
195}
196
197#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
198#[cfg_attr(test, derive(PartialEq))]
199#[xml(tag = "w:imprint")]
200pub struct Imprint {
201    #[xml(attr = "w:val")]
202    pub value: Option<bool>,
203}
204
205#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
206#[cfg_attr(test, derive(PartialEq))]
207#[xml(tag = "w:noProof")]
208pub struct NoProof {
209    #[xml(attr = "w:val")]
210    pub value: Option<bool>,
211}
212
213// #[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
214// #[cfg_attr(test, derive(PartialEq))]
215// #[xml(tag = "w:snapToGrid")]
216// pub struct SnapToGrid {
217//     #[xml(attr = "w:val")]
218//     pub value: Option<bool>,
219// }
220
221#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
222#[cfg_attr(test, derive(PartialEq))]
223#[xml(tag = "w:vanish")]
224pub struct Vanish {
225    #[xml(attr = "w:val")]
226    pub value: Option<bool>,
227}
228
229#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
230#[cfg_attr(test, derive(PartialEq))]
231#[xml(tag = "w:webHidden")]
232pub struct WebHidden {
233    #[xml(attr = "w:val")]
234    pub value: Option<bool>,
235}
236
237#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
238#[cfg_attr(test, derive(PartialEq))]
239#[xml(tag = "w:rtl")]
240pub struct RightToLeftText {
241    #[xml(attr = "w:val")]
242    pub value: Option<bool>,
243}
244
245#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
246#[cfg_attr(test, derive(PartialEq))]
247#[xml(tag = "w:cs")]
248pub struct ComplexScript {
249    #[xml(attr = "w:val")]
250    pub value: Option<bool>,
251}
252
253#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
254#[cfg_attr(test, derive(PartialEq))]
255#[xml(tag = "w:specVanish")]
256pub struct SpecVanish {
257    #[xml(attr = "w:val")]
258    pub value: Option<bool>,
259}
260
261#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
262#[cfg_attr(test, derive(PartialEq))]
263#[xml(tag = "w:oMath")]
264pub struct OMath {
265    #[xml(attr = "w:val")]
266    pub value: Option<bool>,
267}
268
269/// Positive or Negative Value in Twentieths of a Point
270#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
271#[cfg_attr(test, derive(PartialEq))]
272#[xml(tag = "w:spacing")]
273pub struct TextSpacing {
274    #[xml(attr = "w:val")]
275    pub value: Option<isize>,
276}
277
278/// Text Expansion/Compression Percentage, 0..=600.
279#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
280#[cfg_attr(test, derive(PartialEq))]
281#[xml(tag = "w:w")]
282pub struct Scale {
283    #[xml(attr = "w:val")]
284    pub value: Option<u16>,
285}
286
287/// Measurement in Half-Points
288#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
289#[cfg_attr(test, derive(PartialEq))]
290#[xml(tag = "w:szCs")]
291pub struct SizeComplex {
292    #[xml(attr = "w:val")]
293    pub value: Option<isize>,
294}
295
296/// Measurement in Half-Points
297#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
298#[cfg_attr(test, derive(PartialEq))]
299#[xml(tag = "w:kern")]
300pub struct Kern {
301    #[xml(attr = "w:val")]
302    pub value: Option<isize>,
303}
304
305#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
306#[cfg_attr(test, derive(PartialEq))]
307#[xml(tag = "w:effect")]
308pub struct Effect {
309    #[xml(attr = "w:val")]
310    pub value: Option<EffectType>,
311}
312
313#[derive(Debug, Clone, Default)]
314#[cfg_attr(test, derive(PartialEq))]
315pub enum EffectType {
316    BlinkBackground, //Blinking Background Animation
317    Lights,          //Colored Lights Animation
318    AntsBlack,       //Black Dashed Line Animation
319    AntsRed,         //Marching Red Ants
320    Shimmer,         //Shimmer Animation
321    Sparkle,         //Sparkling Lights Animation
322    #[default]
323    None, //No Animation
324}
325
326__string_enum! {
327    EffectType {
328        BlinkBackground = "blinkBackground",
329        Lights = "lights",
330        AntsBlack = "antsBlack",
331        AntsRed = "antsRed",
332        Shimmer = "shimmer",
333        Sparkle = "sparkle",
334        None = "none",
335    }
336}
337
338#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
339#[cfg_attr(test, derive(PartialEq))]
340#[xml(tag = "w:eastAsianLayout")]
341pub struct EastAsianLayout {
342    #[xml(attr = "w:id")]
343    pub id: Option<isize>,
344    #[xml(attr = "w:combine")]
345    pub combine: Option<bool>,
346    #[xml(attr = "w:combineBrackets")]
347    pub combine_brackets: Option<CombineBracketsType>,
348    #[xml(attr = "w:vert")]
349    pub vert: Option<bool>,
350    #[xml(attr = "w:vertCompress")]
351    pub vert_compress: Option<bool>,
352}
353
354#[derive(Debug, Clone, Default)]
355#[cfg_attr(test, derive(PartialEq))]
356pub enum CombineBracketsType {
357    #[default]
358    None, //	No Enclosing Brackets
359    Round,  //	Round Brackets
360    Square, //	Square Brackets
361    Angle,  //	Angle Brackets
362    Curly,  //	Curly Brackets
363}
364
365__string_enum! {
366    CombineBracketsType {
367        None = "none",
368        Round = "round",
369        Square = "square",
370        Angle = "angle",
371        Curly = "curly",
372    }
373}
374
375#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
376#[cfg_attr(test, derive(PartialEq))]
377#[xml(tag = "w:fitText")]
378pub struct FitText {
379    // Measurement in Twentieths of a Point
380    #[xml(attr = "w:val")]
381    pub value: Option<isize>,
382    #[xml(attr = "w:id")]
383    pub id: Option<isize>,
384}
385
386#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
387#[cfg_attr(test, derive(PartialEq))]
388#[xml(tag = "w:bdr")]
389pub struct TextBorder<'a> {
390    #[xml(attr = "w:val")]
391    pub style: super::BorderStyle,
392    #[xml(attr = "w:color")]
393    pub color: Option<Cow<'a, str>>,
394    #[xml(attr = "w:themeColor")]
395    pub theme_color: Option<ThemeColor>,
396    #[xml(attr = "w:themeTint")]
397    pub theme_tint: Option<Cow<'a, str>>,
398    #[xml(attr = "w:themeShade")]
399    pub theme_shade: Option<Cow<'a, str>>,
400    #[xml(attr = "w:sz")]
401    pub size: Option<isize>, // Measurement in Eighths of a Point
402    #[xml(attr = "w:space")]
403    pub space: Option<isize>,
404    #[xml(attr = "w:shadow")]
405    pub shadow: Option<bool>,
406    #[xml(attr = "w:frame")]
407    pub frame: Option<bool>,
408}
409
410#[derive(Debug, Clone, Default)]
411#[cfg_attr(test, derive(PartialEq))]
412pub enum ThemeColor {
413    #[default]
414    Dark1, //Dark 1 Theme Color.
415    Light1,            //Light 1 Theme Color.
416    Dark2,             //Dark 2 Theme Color.
417    Light2,            //Light 2 Theme Color.
418    Accent1,           //Accent 1 Theme Color.
419    Accent2,           //Accent 2 Theme Color.
420    Accent3,           //Accent 3 Theme Color.
421    Accent4,           //Accent 4 Theme Color.
422    Accent5,           //Accent 5 Theme Color.
423    Accent6,           //Accent 6 Theme Color.
424    Hyperlink,         //Hyperlink Theme Color.
425    FollowedHyperlink, //Followed Hyperlink Theme Color.
426    None,              //No Theme Color.
427    Background1,       //Background 1 Theme Color.
428    Text1,             //Text 1 Theme Color.
429    Background2,       //Background 2 Theme Color.
430    Text2,             //Text 2 Theme Color.
431}
432
433__string_enum! {
434    ThemeColor {
435        Dark1 = "dark1",
436        Light1 = "light1",
437        Dark2 = "dark2",
438        Light2 = "light2",
439        Accent1 = "accent1",
440        Accent2 = "accent2",
441        Accent3 = "accent3",
442        Accent4 = "accent4",
443        Accent5 = "accent5",
444        Accent6 = "accent6",
445        Hyperlink = "hyperlink",
446        FollowedHyperlink = "followedHyperlink",
447        None = "none",
448        Background1 = "background1",
449        Text1 = "text1",
450        Background2 = "background2",
451        Text2 = "text2",
452    }
453}
454
455#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
456#[cfg_attr(test, derive(PartialEq))]
457#[xml(tag = "w:shd")]
458pub struct Shading<'a> {
459    #[xml(attr = "w:val")]
460    pub style: Option<ShadingStyle>,
461    #[xml(attr = "w:color")]
462    pub color: Option<Cow<'a, str>>,
463    #[xml(attr = "w:themeColor")]
464    pub theme_color: Option<ThemeColor>,
465    #[xml(attr = "w:themeTint")]
466    pub theme_tint: Option<Cow<'a, str>>,
467    #[xml(attr = "w:themeShade")]
468    pub theme_shade: Option<Cow<'a, str>>,
469    #[xml(attr = "w:fill")]
470    pub fill: Option<Cow<'a, str>>,
471    #[xml(attr = "w:themeFill")]
472    pub theme_fill: Option<ThemeColor>,
473    #[xml(attr = "w:themeFillTint")]
474    pub theme_fill_tint: Option<Cow<'a, str>>,
475    #[xml(attr = "w:themeFillShade")]
476    pub theme_fill_shade: Option<Cow<'a, str>>,
477}
478
479#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
480#[cfg_attr(test, derive(PartialEq))]
481#[xml(tag = "w:em")]
482pub struct Emphasis {
483    #[xml(attr = "w:val")]
484    pub value: Option<EmphasisType>,
485}
486
487#[derive(Debug, Default, Clone)]
488#[cfg_attr(test, derive(PartialEq))]
489pub enum ShadingStyle {
490    #[default]
491    Nil, //No Pattern.
492    Clear,                 //No Pattern.
493    Solid,                 //100% Fill Pattern.
494    HorzStripe,            //Horizontal Stripe Pattern.
495    VertStripe,            //Vertical Stripe Pattern.
496    ReverseDiagStripe,     //Reverse Diagonal Stripe Pattern.
497    DiagStripe,            //Diagonal Stripe Pattern.
498    HorzCross,             //Horizontal Cross Pattern.
499    DiagCross,             //Diagonal Cross Pattern.
500    ThinHorzStripe,        //Thin Horizontal Stripe Pattern.
501    ThinVertStripe,        //Thin Vertical Stripe Pattern.
502    ThinReverseDiagStripe, //Thin Reverse Diagonal Stripe Pattern.
503    ThinDiagStripe,        //Thin Diagonal Stripe Pattern.
504    ThinHorzCross,         //Thin Horizontal Cross Pattern.
505    ThinDiagCross,         //Thin Diagonal Cross Pattern.
506    Pct5,                  //5% Fill Pattern.
507    Pct10,                 //10% Fill Pattern.
508    Pct12,                 //12.5% Fill Pattern.
509    Pct15,                 //15% Fill Pattern.
510    Pct20,                 //20% Fill Pattern.
511    Pct25,                 //25% Fill Pattern.
512    Pct30,                 //30% Fill Pattern.
513    Pct35,                 //35% Fill Pattern.
514    Pct37,                 //37.5% Fill Pattern.
515    Pct40,                 //40% Fill Pattern.
516    Pct45,                 //45% Fill Pattern.
517    Pct50,                 //50% Fill Pattern.
518    Pct55,                 //55% Fill Pattern.
519    Pct60,                 //60% Fill Pattern.
520    Pct62,                 //62.5% Fill Pattern.
521    Pct65,                 //65% Fill Pattern.
522    Pct70,                 //70% Fill Pattern.
523    Pct75,                 //75% Fill Pattern.
524    Pct80,                 //80% Fill Pattern.
525    Pct85,                 //85% Fill Pattern.
526    Pct87,                 //87.5% Fill Pattern.
527    Pct90,                 //90% Fill Pattern.
528    Pct95,                 //95% Fill Pattern.
529}
530
531__string_enum! {
532    ShadingStyle {
533        Nil = "nil",
534        Clear = "clear",
535        Solid = "solid",
536        HorzStripe = "horzStripe",
537        VertStripe = "vertStripe",
538        ReverseDiagStripe = "reverseDiagStripe",
539        DiagStripe = "diagStripe",
540        HorzCross = "horzCross",
541        DiagCross = "diagCross",
542        ThinHorzStripe = "thinHorzStripe",
543        ThinVertStripe = "thinVertStripe",
544        ThinReverseDiagStripe = "thinReverseDiagStripe",
545        ThinDiagStripe = "thinDiagStripe",
546        ThinHorzCross = "thinHorzCross",
547        ThinDiagCross = "thinDiagCross",
548        Pct5 = "pct5",
549        Pct10 = "pct10",
550        Pct12 = "pct12",
551        Pct15 = "pct15",
552        Pct20 = "pct20",
553        Pct25 = "pct25",
554        Pct30 = "pct30",
555        Pct35 = "pct35",
556        Pct37 = "pct37",
557        Pct40 = "pct40",
558        Pct45 = "pct45",
559        Pct50 = "pct50",
560        Pct55 = "pct55",
561        Pct60 = "pct60",
562        Pct62 = "pct62",
563        Pct65 = "pct65",
564        Pct70 = "pct70",
565        Pct75 = "pct75",
566        Pct80 = "pct80",
567        Pct85 = "pct85",
568        Pct87 = "pct87",
569        Pct90 = "pct90",
570        Pct95 = "pct95",
571    }
572}
573
574#[derive(Debug, Default, Clone)]
575#[cfg_attr(test, derive(PartialEq))]
576pub enum EmphasisType {
577    #[default]
578    None, //	No Emphasis Mark
579    Dot,      //	Dot Emphasis Mark Above Characters
580    Comma,    //	Comma Emphasis Mark Above Characters
581    Circle,   //	Circle Emphasis Mark Above Characters
582    UnderDot, //	Dot Emphasis Mark Below Characters
583}
584
585__string_enum! {
586    EmphasisType {
587        None = "none",
588        Dot = "dot",
589        Comma = "comma",
590        Circle = "circle",
591        UnderDot = "underdot",
592    }
593}
594
595__xml_test_suites!(
596    CharacterProperty,
597    CharacterProperty::default(),
598    r#"<w:rPr/>"#,
599    CharacterProperty::default().style_id("id"),
600    r#"<w:rPr><w:rStyle w:val="id"/></w:rPr>"#,
601    CharacterProperty::default().color("00ff00"),
602    r#"<w:rPr><w:color w:val="00ff00"/></w:rPr>"#,
603    CharacterProperty::default().size(42isize),
604    r#"<w:rPr><w:sz w:val="42"/></w:rPr>"#,
605    CharacterProperty::default().bold(true),
606    r#"<w:rPr><w:b w:val="true"/></w:rPr>"#,
607    CharacterProperty::default().italics(false),
608    r#"<w:rPr><w:i w:val="false"/></w:rPr>"#,
609    CharacterProperty::default().outline(true),
610    r#"<w:rPr><w:outline w:val="true"/></w:rPr>"#,
611    CharacterProperty::default().strike(false),
612    r#"<w:rPr><w:strike w:val="false"/></w:rPr>"#,
613    CharacterProperty::default().dstrike(true),
614    r#"<w:rPr><w:dstrike w:val="true"/></w:rPr>"#,
615    CharacterProperty::default().underline(Underline::default()),
616    r#"<w:rPr><w:u/></w:rPr>"#,
617    CharacterProperty::default().fonts(Fonts::default().east_asia("宋体")),
618    r#"<w:rPr><w:rFonts w:eastAsia="宋体"/></w:rPr>"#,
619);