Export (0) Print
Expand All

3.9.2 Character Formatting Example

Office

This example shows how character-level formatting is specified for the green circular shape on presentation slide 6 as shown in figure titled "Presentation slide 6" in section 3.1.

The text of the shape is specified in an OfficeArtClientTextbox record. The child-record hierarchy of the OfficeArtSpContainer ([MS-ODRAW] section 2.2.14) record D from the table titled "DrawingContainer child-record hierarchy" in section 3.8.1 is shown expanded in the following table.

OfficeArtSpContainer child-record hierarchy

Offset

Size

Structure

Value

00007E30

00FB

OfficeArtSpContainer - case of msofbtSpContainer

00007E30

0008

    OfficeArtRecordHeader - rh

00007E38

0010

    OfficeArtFSP - shapeProp

00007E48

0044

    OfficeArtFOPT - shapePrimaryOptions

00007E8C

000E

    OfficeArtTertiaryFOPT - shapeTertiaryOptions

00007E9A

0010

    OfficeArtClientAnchor- clientAnchor

00007EAA

0081

    OfficeArtClientTextbox - clientTextbox

00007EAA

0008

        OfficeArtRecordHeader - rh

00007EB2

000C

        TextHeaderAtom- case of RT_TextHeaderAtom

00007EBE

001D

        TextBytesAtom- case of RT_TextBytesAtom

00007EBE

0008

            RecordHeader- rh

00007EBE

4 bits

                unsigned integer - recVer

0x0

00007EBE

12 bits

                unsigned integer - recInstance

0x000

00007EC0

0002

                RecordType- recType

0x0FA8

00007EC2

0004

                unsigned integer - recLen

0x00000015

00007EC6

0015

            array of bytes - textBytes

an \runderlined\rcircle

00007EDB

0050

        StyleTextPropAtom- case of RT_StyleTextPropAtom

00007EDB

0008

            RecordHeader - rh

00007EE3

000C

            TextPFRun- textPFRun

00007EEF

000E

            A: TextCFRun- TextCFRun A

00007EFD

0010

            B: TextCFRun - TextCFRun B

00007F0D

000E

            C: TextCFRun - TextCFRun C

00007F1B

0010

            D: TextCFRun - TextCFRun D

clientTextbox.case of RT_TextBytesAtom.rh.recLen: 0x00000015 specifies that the length of the corresponding text body is 22 because of the terminating line break character.

clientTextbox.case of RT_TextBytesAtom.textBytes: "an \runderlined\rcircle" specifies the content of the text.

The basic character-level formatting is specified by four TextCFRun structures contained in the StyleTextPropAtom record that follows the TextBytesAtom record.

The child-record hierarchy of the TextCFRun record A from the previous table is shown expanded in the following table. The offset of the first TextCFRun depends on the paragraph-level formatting. When all TextPFRun records are read, the character-level formatting begins.

TextCFRun record A child-record hierarchy

Offset

Size

Structure

Value

00007EEF

000E

A: TextCFRun - textCFRun

00007EEF

0004

    unsigned integer - count

0x00000002

00007EF3

000A

    TextCFException- cf

00007EF3

0004

        CFMasks- masks

00007EF3

1 bit

            unsigned integer - bold

0x0

00007EF3

1 bit

            unsigned integer - italic

0x0

00007EF3

1 bit

            unsigned integer - underline

0x0

00007EF3

1 bit

            unsigned integer - unused1

0x0

00007EF3

1 bit

            unsigned integer - shadow

0x0

00007EF3

1 bit

            unsigned integer - fehint

0x0

00007EF3

1 bit

            unsigned integer - unused2

0x0

00007EF3

1 bit

            unsigned integer - kumi

0x0

00007EF3

1 bit

            unsigned integer - unused3

0x0

00007EF3

1 bit

            unsigned integer - emboss

0x0

00007EF3

4 bits

            unsigned integer - fHasStyle

0x0

00007EF3

2 bits

            unsigned integer - unused4

0x0

00007EF3

1 bit

            unsigned integer - typeface

0x0

00007EF3

1 bit

            unsigned integer - size

0x0

00007EF3

1 bit

            unsigned integer - color

0x1

00007EF3

1 bit

            unsigned integer - position

0x0

00007EF3

1 bit

            unsigned integer - pp10ext

0x0

00007EF3

1 bit

            unsigned integer - oldEATypeface

0x0

00007EF3

1 bit

            unsigned integer - ansiTypeface

0x1

00007EF3

1 bit

            unsigned integer - symbolTypeface

0x0

00007EF3

1 bit

            unsigned integer - newEATypeface

0x0

00007EF3

1 bit

            unsigned integer - csTypeface

0x0

00007EF3

1 bit

            unsigned integer - pp11ext

0x0

00007EF3

5 bits

            unsigned integer - reserved

0x00

00007EF7

0002

        unsigned integer - ansiFontRef

0x0000

00007EF9

0004

        ColorIndexStruct- color

This TextCFRun specifies only the font and font color for the first two characters, "an". The fontStyle field does not exist, because none of the bits of the CFMasks record that determine the existence of fontStyle are set.

count: 0x00000002 specifies that these character-level formatting options apply to two characters. The corresponding characters are "an".

cf.masks.color: 0x0001 specifies that cf.color exists.

cf.masks.ansiTypeface: 0x0001 specifies that cf.ansiFontRef exists.

cf.ansiFontRef: 0x0000 specifies the font. This field exists because cf.masks.ansiTypeface is set.

cf.color: Specifies the color of the font. This field exists because cf.masks.color is set.

So far, the sum of the count field of the TextCFRun records is 2.

The child-record hierarchy of the TextCFRun record B from the table titled "OfficeArtSpContainer child-record hierarchy" in this section is shown expanded in the following table.

TextCFRun B child-record hierarchy

Offset

Size

Structure

Value

00007EFD

0010

B: TextCFRun - textCFRun

00007EFD

0004

    unsigned integer - count

0x00000002

00007F01

000C

    TextCFException - cf

00007F01

0004

        CFMasks - masks

00007F01

1 bit

            unsigned integer - bold

0x0

00007F01

1 bit

            unsigned integer - italic

0x0

00007F01

1 bit

            unsigned integer - underline

0x1

00007F01

1 bit

            unsigned integer - unused1

0x0

00007F01

1 bit

            unsigned integer - shadow

0x0

00007F01

1 bit

            unsigned integer - fehint

0x0

00007F01

1 bit

            unsigned integer - unused2

0x0

00007F01

1 bit

            unsigned integer - kumi

0x0

00007F01

1 bit

            unsigned integer - unused3

0x0

00007F01

1 bit

            unsigned integer - emboss

0x0

00007F01

4 bits

            unsigned integer - fHasStyle

0x0

00007F01

2 bits

            unsigned integer - unused4

0x0

00007F01

1 bit

            unsigned integer - typeface

0x0

00007F01

1 bit

            unsigned integer - size

0x0

00007F01

1 bit

            unsigned integer - color

0x1

00007F01

1 bit

            unsigned integer - position

0x0

00007F01

1 bit

            unsigned integer - pp10ext

0x0

00007F01

1 bit

            unsigned integer - oldEATypeface

0x0

00007F01

1 bit

            unsigned integer - ansiTypeface

0x1

00007F01

1 bit

            unsigned integer - symbolTypeface

0x0

00007F01

1 bit

            unsigned integer - newEATypeface

0x0

00007F01

1 bit

            unsigned integer - csTypeface

0x0

00007F01

1 bit

            unsigned integer - pp11ext

0x0

00007F01

5 bits

            unsigned integer - reserved

0x00

00007F05

0002

        CFStyle- fontStyle

00007F05

1 bit

            unsigned integer - bold

0x0

00007F05

1 bit

            unsigned integer - italic

0x0

00007F05

1 bit

            unsigned integer - underline

0x1

00007F05

1 bit

            unsigned integer - unused1

0x0

00007F05

1 bit

            unsigned integer - shadow

0x0

00007F05

1 bit

            unsigned integer - fehint

0x0

00007F05

1 bit

            unsigned integer - unused2

0x0

00007F05

1 bit

            unsigned integer - kumi

0x0

00007F05

1 bit

            unsigned integer - unused3

0x0

00007F05

1 bit

            unsigned integer - emboss

0x0

00007F05

4 bits

            unsigned integer - pp9rt

0x0

00007F05

2 bits

            unsigned integer - unused4

0x0

00007F07

0002

        unsigned integer - ansiFontRef

0x0000

00007F09

0004

        ColorIndexStruct - color

count: 0x00000002 specifies that these character-level formatting options apply to the next 2 characters, " \r".

cf.masks.underline: 0x0001 specifies that cf.fontStyle exists and that cf.fontStyle.underline is valid.

cf.fontStyle: Specifies styling options. This field exists because cf.masks.underline is set.

cf.fontStyle.underline: 0x0001 specifies that the text is underlined.

So far, the sum of the count field of the TextCFRun records is 4.

The child-record hierarchy of the TextCFRun record C from the table titled "OfficeArtSpContainer child-record hierarchy" in this section is shown expanded in the following table.

TextCFRun C child-record hierarchy

Offset

Size

Structure

Value

00007F0D

000E

C: TextCFRun - textCFRun

00007F0D

0004

    unsigned integer - count

0x0000000B

00007F11

000A

    TextCFException - cf

00007F11

0004

        CFMasks - masks

00007F11

1 bit

            unsigned integer - bold

0x0

00007F11

1 bit

            unsigned integer - italic

0x0

00007F11

1 bit

            unsigned integer - underline

0x0

00007F11

1 bit

            unsigned integer - unused1

0x0

00007F11

1 bit

            unsigned integer - shadow

0x0

00007F11

1 bit

            unsigned integer - fehint

0x0

00007F11

1 bit

            unsigned integer - unused2

0x0

00007F11

1 bit

            unsigned integer - kumi

0x0

00007F11

1 bit

            unsigned integer - unused3

0x0

00007F11

1 bit

            unsigned integer - emboss

0x0

00007F11

4 bits

            unsigned integer - fHasStyle

0x0

00007F11

2 bits

            unsigned integer - unused4

0x0

00007F11

1 bit

            unsigned integer - typeface

0x0

00007F11

1 bit

            unsigned integer - size

0x0

00007F11

1 bit

            unsigned integer - color

0x1

00007F11

1 bit

            unsigned integer - position

0x0

00007F11

1 bit

            unsigned integer - pp10ext

0x0

00007F11

1 bit

            unsigned integer - oldEATypeface

0x0

00007F11

1 bit

            unsigned integer - ansiTypeface

0x1

00007F11

1 bit

            unsigned integer - symbolTypeface

0x0

00007F11

1 bit

            unsigned integer - newEATypeface

0x0

00007F11

1 bit

            unsigned integer - csTypeface

0x0

00007F11

1 bit

            unsigned integer - pp11ext

0x0

00007F11

5 bits

            unsigned integer - reserved

0x00

00007F15

0002

        unsigned integer - ansiFontRef

0x0000

00007F17

0004

        ColorIndexStruct - color

The fontStyle field does not exist because none of the first 16 bits of the CFMasks record is set.

count: 0x0000000B specifies that these character-level properties apply to the next 11 characters, "underlined\r".

cf.masks.underline: 0x0000 specifies that the underline field of fontStyle, which does not exist in this TextCFRun, would not be valid.

So far, the sum of the count field of the TextCFRun records is 15.

The child-record hierarchy of the TextCFRun record D from the table titled "OfficeArtSpContainer child-record hierarchy" in this section is shown expanded in the following table.

TextCFRun D child-record hierarchy

Offset

Size

Structure

Value

00007F1B

0010

D: TextCFRun - textCFRun

00007F1B

0004

    unsigned integer - count

0x00000007

00007F1F

000C

    TextCFException - cf

00007F1F

0004

        CFMasks - masks

00007F1F

1 bit

            unsigned integer - bold

0x0

00007F1F

1 bit

            unsigned integer - italic

0x0

00007F1F

1 bit

            unsigned integer - underline

0x1

00007F1F

1 bit

            unsigned integer - unused1

0x0

00007F1F

1 bit

            unsigned integer - shadow

0x0

00007F1F

1 bit

            unsigned integer - fehint

0x0

00007F1F

1 bit

            unsigned integer - unused2

0x0

00007F1F

1 bit

            unsigned integer - kumi

0x0

00007F1F

1 bit

            unsigned integer - unused3

0x0

00007F1F

1 bit

            unsigned integer - emboss

0x0

00007F1F

4 bits

            unsigned integer - fHasStyle

0x0

00007F1F

2 bits

            unsigned integer - unused4

0x0

00007F1F

1 bit

            unsigned integer - typeface

0x0

00007F1F

1 bit

            unsigned integer - size

0x0

00007F1F

1 bit

            unsigned integer - color

0x1

00007F1F

1 bit

            unsigned integer - position

0x0

00007F1F

1 bit

            unsigned integer - pp10ext

0x0

00007F1F

1 bit

            unsigned integer - oldEATypeface

0x0

00007F1F

1 bit

            unsigned integer - ansiTypeface

0x1

00007F1F

1 bit

            unsigned integer - symbolTypeface

0x0

00007F1F

1 bit

            unsigned integer - newEATypeface

0x0

00007F1F

1 bit

            unsigned integer - csTypeface

0x0

00007F1F

1 bit

            unsigned integer - pp11ext

0x0

00007F1F

5 bits

            unsigned integer - reserved

0x00

00007F23

0002

        CFStyle - fontStyle

00007F23

1 bit

            unsigned integer - bold

0x0

00007F23

1 bit

            unsigned integer - italic

0x0

00007F23

1 bit

            unsigned integer - underline

0x1

00007F23

1 bit

            unsigned integer - unused1

0x0

00007F23

1 bit

            unsigned integer - shadow

0x0

00007F23

1 bit

            unsigned integer - fehint

0x0

00007F23

1 bit

            unsigned integer - unused2

0x0

00007F23

1 bit

            unsigned integer - kumi

0x0

00007F23

1 bit

            unsigned integer - unused3

0x0

00007F23

1 bit

            unsigned integer - emboss

0x0

00007F23

4 bits

            unsigned integer - pp9rt

0x0

00007F23

2 bits

            unsigned integer - unused4

0x0

00007F25

0002

        unsigned integer - ansiFontRef

0x0000

00007F27

0004

        ColorIndexStruct - color

count: 0x00000007 specifies that these character-level properties apply to the next 7 characters, "circle" and the terminating ‘\n’. Note that the terminating ‘\n’ is not included in the preceding TextBytesAtom shown in the table titled "OfficeArtSpContainer child-record hierarchy" in this section.

cf.masks.underline: 0x0001 specifies that cf.fontStyle exists and that cf.fontStyle.underline is valid.

cf.fontStyle: Specifies character-level styling.

cf.fontStyle.underline: 0x0001 specifies that the text is underlined.

So far, the sum of the count field of the TextCFRun text structures is 22. Because the sum of the count field is the length of the text, this TextCFRun record is the final TextCFRun record.

Show:
© 2014 Microsoft