static void
dump_style(FILE *stream)
{
- match_byte(1);
- match_byte(0);
- match_byte(0);
- match_byte(0);
- match_byte_assert(1);
+ for (int i = 0; i < 4; i++)
+ printf (" %d", get_byte());
char *fg = get_string(); /* foreground */
char *bg = get_string(); /* background */
char *font = get_string(); /* font */
- int size = data[pos];
- if (!match_byte(14))
- match_byte_assert(12); /* size? */
- fprintf(stream, " fgcolor=\"%s\" bgcolor=\"%s\" font=\"%s\" size=\"%d\"",
+ int size = get_byte() * (72. / 96.);
+ fprintf(stream, " fgcolor=\"%s\" bgcolor=\"%s\" font=\"%s\" size=\"%dpt\"",
fg, bg, font, size);
}
match_byte_assert(0x58);
if (match_byte(0x31))
{
- /* Only two SPV files have anything like this, so it's hard to
- generalize. */
- match_u32_assert(0);
- match_u32_assert(0);
- match_u32_assert(0);
- match_u32_assert(0);
- match_byte_assert(1);
- match_byte_assert(0);
- if (!match_byte(8) && !match_byte(1))
- match_byte_assert(2);
- match_byte_assert(0);
- match_byte_assert(8);
- match_byte_assert(0);
- match_byte_assert(10);
- match_byte_assert(0);
+ uint32_t halign = get_u32();
+ printf (" halign=\"%s\"",
+ halign == 0 ? "center"
+ : halign == 2 ? "left"
+ : halign == 4 ? "right"
+ : halign == 6 ? "decimal"
+ : halign == 0xffffffad ? "mixed"
+ : "<error>");
+ int valign = get_u32();
+ printf (" valign=\"%s\"",
+ valign == 0 ? "center"
+ : valign == 1 ? "top"
+ : valign == 3 ? "bottom"
+ : "<error>");
+ printf (" %g", get_double());
+ int l = get_u16();
+ int r = get_u16();
+ int t = get_u16();
+ int b = get_u16();
+ printf (" margins=\"%d %d %d %d\"", l, r, t, b);
}
else
match_byte_assert(0x58);
v3(count(FormatString Style ValueModUnknown))
@math{|} 31 int[@t{n-refs}] int16*[@t{n-refs}] Format
@math{|} 58
-Style @result{} 58 @math{|} 31 01? 00? 00? 00? 01 string[@t{fgcolor}] string[@t{bgcolor}] string[@t{typeface}] byte[@t{size}]
+
+Style @result{}
+ 58
+ @math{|} 31
+ bool[@t{bold}] bool[@t{italic}] bool[@t{underline}] bool
+ string[@t{fgcolor}] string[@t{bgcolor}]
+ string[@t{typeface}] byte[@t{size}]
+
Format @result{} 00 00 count(FormatString Style 58)
+
FormatString @result{} count((i0 (58 @math{|} 31 string))?)
-ValueModUnknown @result{} 58 @math{|} 31 i0 i0 i0 i0 01 00 (01 @math{|} 02 @math{|} 08) 00 08 00 0a 00)
+
+ValueModUnknown @result{}
+ 58
+ @math{|} 31 int[@t{halign}] int[@t{valign}] double[@t{offset}]
+ int16[@t{left-margin}] int16[@t{right-margin}]
+ int16[@t{top-margin}] int16[@t{bottom-margin}]
@end format
@end cartouche
The Style, if present, changes the style for this individual Value.
The @code{size} is a font size in units of 1/96 inch.
+@code{halign} is 0 for center, 2 for left, 4 for right, 6 for decimal,
+0xffffffad for mixed. For decimal alignment, @code{offset} is the
+decimal point's offset from the right side of the cell, in units of
+1/72 inch.
+
+@code{valign} specifies vertical alignment: 0 for center, 1 for top, 3
+for bottom.
+
+@code{left-margin}, @code{right-margin}, @code{top-margin}, and
+@code{bottom-margin} are in units of 1/72 inch.
+
@node SPV Legacy Detail Member Binary Format
@section Legacy Detail Member Binary Format