<?xml version="1.0"?>
<!--
    ====================================================================
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements. See the NOTICE file distributed with
    this work for additional information regarding copyright ownership.
    The ASF licenses this file to You under the Apache License, Version 2.0
    (the "License"); you may not use this file except in compliance with
    the License. You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
    ====================================================================
-->
<record id="0x101B" name="CHP" package="org.apache.poi.hwpf.model.types">
    <suffix>AbstractType</suffix>
    <extends>HDFType</extends>
    <description>Character Properties.</description>
    <author>S. Ryan Ackley</author>
    <fields>
        <!-- Microsoft Office Word 97-2007 Binary File Format (.doc) Specification -->
        <!-- Page 102 of 210 -->
        <field type="int" size="4" name="grpfChp" description="Collection of the 32 flags">
            <bit number="00" mask="0x00000001" name="fBold" description="Text is bold"/>
            <bit number="01" mask="0x00000002" name="fItalic" description="Italic"/>
            <bit number="02" mask="0x00000004" name="fRMarkDel"
                description="has been deleted and will be displayed with strikethrough when revision marked text is to be displayed"/>
            <bit number="03" mask="0x00000008" name="fOutline" description="Outlined"/>
            <bit number="04" mask="0x00000010" name="fFldVanish" description="Used internally by Word"/>
            <bit number="05" mask="0x00000020" name="fSmallCaps" description="Displayed with small caps"/>
            <bit number="06" mask="0x00000040" name="fCaps" description="Displayed with caps"/>
            <bit number="07" mask="0x00000080" name="fVanish"
                description="text has hidden format, and is not displayed unless fPagHidden is set in the DOP"/>
            <bit number="08" mask="0x00000100" name="fRMark"
                description="text is newly typed since the last time revision marks have been accepted and will be displayed with an underline when revision marked text is to be displayed"/>
            <bit number="09" mask="0x00000200" name="fSpec" description="Character is a Word special character"/>
            <bit number="10" mask="0x00000400" name="fStrike" description="Displayed with strikethrough"/>
            <bit number="11" mask="0x00000800" name="fObj" description="Embedded objec"/>
            <bit number="12" mask="0x00001000" name="fShadow" description="Character is drawn with a shadow"/>
            <bit number="13" mask="0x00002000" name="fLowerCase"
                description="Character is displayed in lower case. This field may be set to 1 only when chp.fSmallCaps is 1."/>
            <bit number="14" mask="0x00004000" name="fData"
                description="chp.fcPic points to an FFDATA, the data structure binary data used by Word to describe a form field. The bit chp.fData may only be 1 when chp.fSpec is also 1 and the special character in the document stream that has this property is a chPicture (0x01)"/>
            <bit number="15" mask="0x00008000" name="fOle2"
                description="chp.lTagObj specifies a particular object in the object stream that specifies the particular OLE object in the stream that should be displayed when the chPicture fSpec character that is tagged with the fOle2 is encountered. The bit chp.fOle2 may only be 1 when chp.fSpec is also 1 and the special character in the document stream that has this property is a chPicture (0x01)."/>
            <bit number="16" mask="0x00010000" name="fEmboss" description="Text is embossed"/>
            <bit number="17" mask="0x00020000" name="fImprint" description="Text is engraved"/>
            <bit number="18" mask="0x00040000" name="fDStrike" description="Displayed with double strikethrough"/>
            <bit number="19" mask="0x00080000" name="fUsePgsuSettings" description="Used internally by Word"/>
            <bit number="20" mask="0x00100000" name="fBoldBi" description="Complex Scripts text is bold"/>


            <!-- Microsoft Office Word 97-2007 Binary File Format (.doc) Specification -->
            <!-- Page 103 of 210 -->
            <bit number="21" mask="0x00100000" name="fComplexScripts"
                description="Complex Scripts text that requires special processing to display and process"/>
            <bit number="22" mask="0x00200000" name="fItalicBi" description="Complex Scripts text is italics"/>
            <bit number="23" mask="0x00400000" name="fBiDi"
                description="Complex Scripts right-to-left text that requires special processing to display and process (character reordering; contextual shaping; display of combining characters and diacritics; specialized justification rules; cursor positioning)"/>
            
            <bit number="24" mask="0x00800000" name="fIcoBi" description="Used internally by Word"/>
            <bit number="25" mask="0x01000000" name="fNonGlyph" description="Used internally by Word"/>
            <bit number="25" mask="0x02000000" name="fBoldOther" description="Used internally by Word 97 and earlier versions"/>
            <bit number="26" mask="0x04000000" name="fItalicOther" description="Used internally by Word 97 and earlier versions"/>

            <bit number="27" mask="0x08000000" name="fNoProof" description="When set to 1, do not check spelling or grammar"/>
            <bit number="28" mask="0x10000000" name="fWebHidden" description="Text should be hidden in Web View when set to 1"/>
            <bit number="29" mask="0x20000000" name="fFitText" description="Fit text when set to 1"/>

            <bit number="30" mask="0x40000000" name="fCalc" description="Used internally by Word"/>
            <bit number="31" mask="0x80000000" name="fFmtLineProp" description="Used internally by Word"/>
        </field>
        <field type="int" size="2" name="hps" default="20" description="Font size in half points"/>
        <field type="int" size="2" name="ftcAscii" description="Font for ASCII text"/>
        <field type="int" size="2" name="ftcFE" description="Font for East Asian text"/>
        <field type="int" size="2" name="ftcOther" description="Font for non-East Asian text"/>
        <field type="int" size="2" name="ftcBi" description="Font for Complex Scripts text"/>
        <!-- rgftc[iftcCompositeMax] -->
        <field type="int" size="4" name="dxaSpace"
            description="Space following each character in the run expressed in twip units."/>

        <field type="Colorref" size="4" name="cv" description="24-bit color"/>

        <!-- Microsoft Office Word 97-2007 Binary File Format (.doc) Specification -->
        <!-- Page 104 of 210 -->
        <field type="byte" size="1" name="ico" description="Color of text for Word 97"/>
        <field type="int" size="2" name="pctCharWidth" description="Character scale"/>
        <!-- Lid -->
        <!-- rglid[clidChpMax] -->
        <field type="int" size="2" name="lidDefault" default="0x0400"/>
        <field type="int" size="2" name="lidFE" default="0x0400"/>
        <!-- lidBi -->
        <field type="byte" size="1" name="kcd" description="Emphasis mark">
            <const type="byte" value="0" name="NON"/>
            <const type="byte" value="1" name="DOT"/>
            <const type="byte" value="2" name="COMMA"/>
            <const type="byte" value="3" name="CIRCLE"/>
            <const type="byte" value="4" name="UNDER_DOT"/>
        </field>
        <field type="boolean" size="1" name="fUndetermine" description="Character is undetermined"/>
        <field type="byte" size="1" name="iss" description="Superscript/subscript indices">
            <const type="byte" value="0" name="NONE"/>
            <const type="byte" value="1" name="SUPERSCRIPTED"/>
            <const type="byte" value="2" name="SUBSCRIPTED"/>
        </field>
        <field type="boolean" size="1" name="fSpecSymbol" description="Used by Word internally"/>
        <field type="byte" size="1" name="idct" description="Not stored in file"/>
        <field type="byte" size="1" name="idctHint" description="Identifier of Character type"/>

        <!-- Microsoft Office Word 97-2007 Binary File Format (.doc) Specification -->
        <!-- Page 105 of 210 -->
        <field type="byte" size="1" name="kul" description="Underline code">
            <const type="byte" value="0" name="NONE"/>
            <const type="byte" value="1" name="SINGLE"/>
            <const type="byte" value="2" name="BY_WORD"/>
            <const type="byte" value="3" name="DOUBLE"/>
            <const type="byte" value="4" name="DOTTED"/>
            <const type="byte" value="5" name="HIDDEN"/>
            <const type="byte" value="6" name="THICK"/>
            <const type="byte" value="7" name="DASH"/>
            <const type="byte" value="8" name="DOT"/>
            <const type="byte" value="9" name="DOT_DASH"/>
            <const type="byte" value="10" name="DOT_DOT_DASH"/>
            <const type="byte" value="11" name="WAVE"/>
            <const type="byte" value="20" name="DOTTED_HEAVY"/>
            <const type="byte" value="23" name="DASHED_HEAVY"/>
            <const type="byte" value="25" name="DOT_DASH_HEAVY"/>
            <const type="byte" value="26" name="DOT_DOT_DASH_HEAVY"/>
            <const type="byte" value="27" name="WAVE_HEAVY"/>
            <const type="byte" value="39" name="DASH_LONG"/>
            <const type="byte" value="43" name="WAVE_DOUBLE"/>
            <const type="byte" value="55" name="DASH_LONG_HEAVY"/>
        </field>

        <field type="Hyphenation" size="2" name="hresi" />

        <field type="int" size="2" name="hpsKern"
            description="Kerning distance for characters in run recorded in half points"/>
        <field type="short" size="2" name="hpsPos"
            description="Reserved (actually used as vertical offset(?) value)"/>

        <!-- cvUl -->

        <field type="ShadingDescriptor" size="2" name="shd" description="Shading"/>
        <field type="BorderCode" size="4" name="brc" description="Border"/>

        <field type="int" size="2" name="ibstRMark"
            description="Index to author IDs stored in hsttbfRMark. Used when text in run was newly typed when revision marking was enabled"/>

        <field type="byte" size="1" name="sfxtText" description="Text animation">
            <const type="byte" value="0" name="NO"/>
            <const type="byte" value="1" name="LAS_VEGAS_LIGHTS"/>
            <const type="byte" value="2" name="BACKGROUND_BLINK"/>
            <const type="byte" value="3" name="SPARKLE_TEXT"/>
            <const type="byte" value="4" name="MARCHING_ANTS"/>
            <const type="byte" value="5" name="MARCHING_RED_ANTS"/>
            <const type="byte" value="6" name="SHIMMER"/>
        </field>
        <field type="boolean" size="1" name="fDblBdr" description="Used internally by Word"/>
        <field type="boolean" size="1" name="fBorderWS" description="Used internally by Word"/>

        <!-- Microsoft Office Word 97-2007 Binary File Format (.doc) Specification -->
        <!-- Page 106 of 210 -->
        <field type="short" size="2" name="ufel"
            description="Collection properties represented by itypFELayout and copt (East Asian layout properties)">
            <bit number="0" mask="0x00ff" name="itypFELayout"/>
            <bit number="1" mask="0x0100" name="fTNY"
                description="Tatenakayoko: Horizontal-in-vertical (range of text in a direction perpendicular to the text flow) is used"/>
            <bit number="2" mask="0x0200" name="fWarichu"
                description="Two lines in one (text in the group is displayed as two half-height lines within a line)"/>
            <bit number="3" mask="0x0400" name="fKumimoji" description="combine characters"/>
            <bit number="4" mask="0x0800" name="fRuby" description="Phonetic guide"/>
            <bit number="5" mask="0x1000" name="fLSFitText" description="fit text"/>
            <bit number="5" mask="0xe000" name="spare" description="Unused"/>
        </field>

        <field type="byte" size="1" name="copt" description="Collection of the 5 flags">
            <bit number="0" mask="0x07" name="iWarichuBracket" description="Bracket character for two-lines-in-one"/>
            <bit number="1" mask="0x08" name="fWarichuNoOpenBracket" description="Two-lines-in-one uses no open"/>
            <bit number="2" mask="0x10" name="fTNYCompress" description="fit text in line"/>
            <bit number="4" mask="0x20" name="fTNYFetchTxm" description="fetch text metrics"/>
            <bit number="5" mask="0x40" name="fCellFitText" description="Fit text in cell"/>
            <bit number="6" mask="0x80" name="unused" description="Not used"/>
        </field>

        <field type="int" size="2" name="hpsAsci" description="Font size for ASCII font"/>
        <field type="int" size="2" name="hpsFE" description="Font size for East Asian text"/>
        <field type="int" size="2" name="hpsBi" description="Font size for Complex Scripts text"/>
        <!-- rghps[ihpsMax] -->

        <field type="int" size="2" name="ftcSym"
            description="an index into the rgffn structure. When chp.fSpec is 1 and the character recorded for the run in the document stream is chSymbol (0x28), chp.ftcSym identifies the font code of the symbol font that will be used to display the symbol character recorded in chp.xchSym."/>
        <field type="int" size="2" name="xchSym"
            description="When chp.fSpec==1 and the character recorded for the run in the document stream is chSymbol (0x28), the character stored chp.xchSym will be displayed using the font specified in chp.ftcSym."/>

        <!-- Microsoft Office Word 97-2007 Binary File Format (.doc) Specification -->
        <!-- Page 107 of 210 -->

        <!-- fNumRunBi -->
        <!-- fSysVanish -->
        <!-- fDiacRunBi -->
        <!-- fBoldPresent -->
        <!-- fItalicPresent -->

        <field type="int" size="4" name="fcPic" default="-1"
            description="Offset in data stream pointing to beginning of a picture when character is a picture character (character is 0x01 and chp.fSpec is 1)."/>
        <field type="int" size="4" name="fcObj"
            description="Offset in data stream pointing to beginning of a picture when character is an OLE1 object character (character is 0x20 and chp.fSpec is 1, chp.fOle2 is 0)."/>
        <field type="int" size="4" name="lTagObj"
            description="An object ID for an OLE object, only set if chp.fSpec and chp.fOle2 are both true, and chp.fObj."/>
        <field type="int" size="4" name="fcData"
            description="Points to location of picture data, only if chp.fSpec is true."/>

        <!-- hsp -->
        <!-- docPic -->
        <!-- dummy -->
        <!-- fDirty -->

        <field type="Hyphenation" size="2" name="hresiOld" />

        <!-- dummy3 -->

        <!-- dxpKashida -->
        <!-- dxpSpace -->

        <field type="int" size="2" name="ibstRMarkDel"
            description="Index to author IDs stored in hsttbfRMark. Used when text in run was deleted when revision marking was enabled."/>

        <!-- Microsoft Office Word 97-2007 Binary File Format (.doc) Specification -->
        <!-- Page 108 of 210 -->

        <field type="DateAndTime" size="4" name="dttmRMark"
            description="Date/time at which this run of text was entered/modified by the author (Only recorded when revision marking is on.)"/>
        <field type="DateAndTime" size="4" name="dttmRMarkDel"
            description="Date/time at which this run of text was deleted by the author (Only recorded when revision marking is on.)"/>

        <!-- cHpsInc -->

        <field type="int" size="2" name="istd" default="10"
            description="Index to character style descriptor in the stylesheet that tags this run of text. When istd is istdNormalChar (10 decimal), characters in run are not affected by a character style. If chp.istd contains any other value, chpx of the specified character style are applied to CHP for this run before any other exceptional properties are applied."/>

        <field type="int" size="2" name="idslRMReason"
            description="An index to strings displayed as reasons for actions taken by Word's AutoFormat code"/>
        <field type="int" size="2" name="idslReasonDel"
            description="An index to strings displayed as reasons for actions taken by Word's AutoFormat code"/>

        <field type="int" size="2" name="cpg" description="Code page of run in pre-Unicode files"/>

        <!-- iatrUndetType -->
        <!-- fUlGap -->

        <field type="short" size="2" name="Highlight">
            <bit number="0" mask="0x001f" name="icoHighlight" description="Highlight color (see chp.ico)"/>
            <bit number="1" mask="0x0020" name="fHighlight"
                description="When 1, characters are highlighted with color specified by chp.icoHighlight"/>
            <!-- fNavHighlight -->
        </field>

        <field type="short" size="2" name="CharsetFlags">
            <bit number="0" mask="0x0001" name="fChsDiff"
                description="Pre-Unicode files, char's char set different from FIB char set"/>
            <bit number="1" mask="0x0020" name="fMacChs" description="fTrue if char's are Macintosh char set"/>
            <!-- fFtcAsciSym -->
            <!-- fFtcReq -->
            <!-- fLangApplied -->
            <!-- fSpareLangApplied -->
            <!-- fForcedCvAuto -->
        </field>
        <!-- Undocumented, but referenced -->
        <field type="short" size="2" name="chse"/>

        <field type="boolean" size="2" name="fPropRMark"
            description="properties have been changed with revision marking on"/>
        <field type="int" size="2" name="ibstPropRMark"
            description="Index to author IDs stored in hsttbfRMark. Used when properties have been changed when revision marking was enabled."/>
        <field type="DateAndTime" size="4" name="dttmPropRMark"
            description="Date/time at which properties of this were changed for this run of text by the author. (Only recorded when revision marking is on.)"/>
        <!-- fAnmPropRMark -->

        <!-- Microsoft Office Word 97-2007 Binary File Format (.doc) Specification -->
        <!-- Page 109 of 210 -->

        <field type="boolean" size="1" name="fConflictOrig"
            description="When chp.wConflict!=0, this is TRUE when text is part of the original version of text. When FALSE, text is alternative introduced by reconciliation operation."/>
        <field type="boolean" size="1" name="fConflictOtherDel"
            description="When fConflictOtherDel==fTrue, the other side of a reconciliation conflict causes this text to be deleted"/>
        <field type="int" size="2" name="wConflict"
            description="When != 0, index number that identifies all text participating in a particular conflict incident"/>
        <field type="int" size="2" name="IbstConflict" description="Who made this change for this side of the conflict."/>
        <field type="DateAndTime" size="4" name="dttmConflict" description="When the change was made"/>
        <field type="boolean" size="1" name="fDispFldRMark"
            description="the number for a ListNum field is being tracked in xstDispFldRMark. If that number is different from the current value, the number has changed. Only valid for ListNum fields."/>
        <field type="int" size="2" name="ibstDispFldRMark"
            description="Index to author IDs stored in hsttbfRMark. Used when ListNum field numbering has been changed when revision marking was enabled."/>
        <field type="DateAndTime" size="4" name="dttmDispFldRMark" description="The date for the ListNum field number change"/>
        <field type="byte[]" size="32" name="xstDispFldRMark"
            description="The string value of the ListNum field when revision mark tracking began"/>

        <!-- dxtSpaceExtra -->

        <field type="int" size="4" name="fcObjp"
            description="Offset in the data stream indicating the location of OLE object data"/>

        <!-- dxaFitText -->
        <!-- lFitTextID -->
        <field type="byte" size="1" name="lbrCRJ" description="Line BReak code for xchCRJ">
            <const type="byte" value="0" name="NONE"/>
            <const type="byte" value="1" name="LEFT"/>
            <const type="byte" value="2" name="RIGHT"/>
            <const type="byte" value="3" name="BOTH"/>
        </field>

        <!-- iuhi -->
        <!-- bTransNoProof0 -->
        <!-- bTransNoProof1 -->
        <!-- rsidProp -->
        <!-- rsidText -->
        <!-- rsidRMDel -->

        <!-- Microsoft Office Word 97-2007 Binary File Format (.doc) Specification -->
        <!-- Page 110 of 210 -->

        <field type="boolean" size="1" name="fSpecVanish"
            description="Special hidden for leading emphasis (always hidden)"/>
        <field type="boolean" size="1" name="fHasOldProps"
            description="Used for character property revision marking. The chp at the time fHasOldProps is set to 1, the is the old chp."/>

        <!-- pbi -->
        <!-- hplcnf -->
        <!-- ffm -->

        <field type="boolean" size="1" name="fSdtVanish" description="Mark the character as hidden."/>

        <!-- Referenced by "The standard CHP is all zeros except" -->
        <field type="int" size="2" name="wCharScale" default="100"/>

        <!-- From old version of description -->

        <!-- <field type="short" size="2" name="InternalFlags"> -->
        <!-- <bit number="0" mask="0x000f" name="iatrUndetType" description="Used internally by Word"/> -->
        <!-- <bit number="1" mask="0x0010" name="fUlGap" description="Used internally by Word 8"/> -->
        <!-- <bit number="2" mask="0x0800" name="fScriptAnchor" description="Used internally by Word"/> -->
        <!-- <bit number="3" mask="0x1000" name="fFixedObj" description="Used internally by Word"/> -->
        <!-- <bit number="4" mask="0x2000" name="spare2" description="Not used"/> -->
        <!-- </field> -->
        <!-- Not documented, but referenced by sprmCChs -->
        <!-- description="used to record a character set id for text that was pasted into the Word
            document that used a character set different than Word's default character set"/> -->
        <!-- <field type="byte" size="1" name="idctHint"/> -->
        <!-- <field type="int" size="2" name="baseIstd"/> -->
        <!-- <field type="int" size="2" name="xchSym"/> -->
    </fields>
</record>
