Esempio n. 1
0
        public FontFamilyName(VirtualStreamReader reader, int length) : base(reader, length)
        {
            long startPos = this._reader.BaseStream.Position;

            //FFID
            int ffid = (int)this._reader.ReadByte();

            int req = ffid;

            req      = req << 6;
            req      = req >> 6;
            this.prq = (byte)req;

            this.fTrueType = Utils.BitmaskToBool(ffid, 0x04);

            int family = ffid;

            family  = family << 1;
            family  = family >> 4;
            this.ff = (byte)family;

            this.wWeight = this._reader.ReadInt16();

            this.chs = this._reader.ReadByte();

            //skip byte 5
            this._reader.ReadByte();

            //read the 10 bytes panose
            this.panose = this._reader.ReadBytes(10);

            //read the 24 bytes FontSignature
            this.fs = new FontSignature
            {
                UnicodeSubsetBitfield0 = this._reader.ReadUInt32(),
                UnicodeSubsetBitfield1 = this._reader.ReadUInt32(),
                UnicodeSubsetBitfield2 = this._reader.ReadUInt32(),
                UnicodeSubsetBitfield3 = this._reader.ReadUInt32(),
                CodePageBitfield0      = this._reader.ReadUInt32(),
                CodePageBitfield1      = this._reader.ReadUInt32()
            };

            //read the next \0 terminated string
            long strStart = reader.BaseStream.Position;
            long strEnd   = searchTerminationZero(this._reader);

            this.xszFtn = Encoding.Unicode.GetString(this._reader.ReadBytes((int)(strEnd - strStart)));
            this.xszFtn = this.xszFtn.Replace("\0", "");

            long readBytes = this._reader.BaseStream.Position - startPos;

            if (readBytes < this._length)
            {
                //read the next \0 terminated string
                strStart    = reader.BaseStream.Position;
                strEnd      = searchTerminationZero(this._reader);
                this.xszAlt = Encoding.Unicode.GetString(this._reader.ReadBytes((int)(strEnd - strStart)));
                this.xszAlt = this.xszAlt.Replace("\0", "");
            }
        }
Esempio n. 2
0
        // Generates content of fontTablePart2.
        private void GenerateFontTablePart2Content(FontTablePart fontTablePart2)
        {
            Fonts fonts2 = new Fonts(){ MCAttributes = new MarkupCompatibilityAttributes(){ Ignorable = "w14 w15" }  };
            fonts2.AddNamespaceDeclaration("mc", "http://schemas.openxmlformats.org/markup-compatibility/2006");
            fonts2.AddNamespaceDeclaration("r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships");
            fonts2.AddNamespaceDeclaration("w", "http://schemas.openxmlformats.org/wordprocessingml/2006/main");
            fonts2.AddNamespaceDeclaration("w14", "http://schemas.microsoft.com/office/word/2010/wordml");
            fonts2.AddNamespaceDeclaration("w15", "http://schemas.microsoft.com/office/word/2010/11/wordml");

            Font font6 = new Font(){ Name = "Century" };
            Panose1Number panose1Number6 = new Panose1Number(){ Val = "02040604050505020304" };
            FontCharSet fontCharSet6 = new FontCharSet(){ Val = "00" };
            FontFamily fontFamily6 = new FontFamily(){ Val = FontFamilyValues.Roman };
            Pitch pitch6 = new Pitch(){ Val = FontPitchValues.Variable };
            FontSignature fontSignature6 = new FontSignature(){ UnicodeSignature0 = "00000287", UnicodeSignature1 = "00000000", UnicodeSignature2 = "00000000", UnicodeSignature3 = "00000000", CodePageSignature0 = "0000009F", CodePageSignature1 = "00000000" };

            font6.Append(panose1Number6);
            font6.Append(fontCharSet6);
            font6.Append(fontFamily6);
            font6.Append(pitch6);
            font6.Append(fontSignature6);

            Font font7 = new Font(){ Name = "MS 明朝" };
            AltName altName3 = new AltName(){ Val = "MS Mincho" };
            Panose1Number panose1Number7 = new Panose1Number(){ Val = "02020609040205080304" };
            FontCharSet fontCharSet7 = new FontCharSet(){ Val = "80" };
            FontFamily fontFamily7 = new FontFamily(){ Val = FontFamilyValues.Roman };
            Pitch pitch7 = new Pitch(){ Val = FontPitchValues.Fixed };
            FontSignature fontSignature7 = new FontSignature(){ UnicodeSignature0 = "E00002FF", UnicodeSignature1 = "6AC7FDFB", UnicodeSignature2 = "00000012", UnicodeSignature3 = "00000000", CodePageSignature0 = "0002009F", CodePageSignature1 = "00000000" };

            font7.Append(altName3);
            font7.Append(panose1Number7);
            font7.Append(fontCharSet7);
            font7.Append(fontFamily7);
            font7.Append(pitch7);
            font7.Append(fontSignature7);

            Font font8 = new Font(){ Name = "Times New Roman" };
            Panose1Number panose1Number8 = new Panose1Number(){ Val = "02020603050405020304" };
            FontCharSet fontCharSet8 = new FontCharSet(){ Val = "00" };
            FontFamily fontFamily8 = new FontFamily(){ Val = FontFamilyValues.Roman };
            Pitch pitch8 = new Pitch(){ Val = FontPitchValues.Variable };
            FontSignature fontSignature8 = new FontSignature(){ UnicodeSignature0 = "E0002AFF", UnicodeSignature1 = "C0007841", UnicodeSignature2 = "00000009", UnicodeSignature3 = "00000000", CodePageSignature0 = "000001FF", CodePageSignature1 = "00000000" };

            font8.Append(panose1Number8);
            font8.Append(fontCharSet8);
            font8.Append(fontFamily8);
            font8.Append(pitch8);
            font8.Append(fontSignature8);

            Font font9 = new Font(){ Name = "MS ゴシック" };
            AltName altName4 = new AltName(){ Val = "MS Gothic" };
            Panose1Number panose1Number9 = new Panose1Number(){ Val = "020B0609070205080204" };
            FontCharSet fontCharSet9 = new FontCharSet(){ Val = "80" };
            FontFamily fontFamily9 = new FontFamily(){ Val = FontFamilyValues.Modern };
            Pitch pitch9 = new Pitch(){ Val = FontPitchValues.Fixed };
            FontSignature fontSignature9 = new FontSignature(){ UnicodeSignature0 = "E00002FF", UnicodeSignature1 = "6AC7FDFB", UnicodeSignature2 = "00000012", UnicodeSignature3 = "00000000", CodePageSignature0 = "0002009F", CodePageSignature1 = "00000000" };

            font9.Append(altName4);
            font9.Append(panose1Number9);
            font9.Append(fontCharSet9);
            font9.Append(fontFamily9);
            font9.Append(pitch9);
            font9.Append(fontSignature9);

            Font font10 = new Font(){ Name = "Arial" };
            Panose1Number panose1Number10 = new Panose1Number(){ Val = "020B0604020202020204" };
            FontCharSet fontCharSet10 = new FontCharSet(){ Val = "00" };
            FontFamily fontFamily10 = new FontFamily(){ Val = FontFamilyValues.Swiss };
            Pitch pitch10 = new Pitch(){ Val = FontPitchValues.Variable };
            FontSignature fontSignature10 = new FontSignature(){ UnicodeSignature0 = "E0002AFF", UnicodeSignature1 = "C0007843", UnicodeSignature2 = "00000009", UnicodeSignature3 = "00000000", CodePageSignature0 = "000001FF", CodePageSignature1 = "00000000" };

            font10.Append(panose1Number10);
            font10.Append(fontCharSet10);
            font10.Append(fontFamily10);
            font10.Append(pitch10);
            font10.Append(fontSignature10);

            fonts2.Append(font6);
            fonts2.Append(font7);
            fonts2.Append(font8);
            fonts2.Append(font9);
            fonts2.Append(font10);

            fontTablePart2.Fonts = fonts2;
        }
Esempio n. 3
0
        // Generates content of fontTablePart1.
        private void GenerateFontTablePart1Content(FontTablePart fontTablePart1)
        {
            Fonts fonts1 = new Fonts(){ MCAttributes = new MarkupCompatibilityAttributes(){ Ignorable = "w14 w15" }  };
            fonts1.AddNamespaceDeclaration("mc", "http://schemas.openxmlformats.org/markup-compatibility/2006");
            fonts1.AddNamespaceDeclaration("r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships");
            fonts1.AddNamespaceDeclaration("w", "http://schemas.openxmlformats.org/wordprocessingml/2006/main");
            fonts1.AddNamespaceDeclaration("w14", "http://schemas.microsoft.com/office/word/2010/wordml");
            fonts1.AddNamespaceDeclaration("w15", "http://schemas.microsoft.com/office/word/2010/11/wordml");

            Font font1 = new Font(){ Name = "Century" };
            Panose1Number panose1Number1 = new Panose1Number(){ Val = "02040604050505020304" };
            FontCharSet fontCharSet1 = new FontCharSet(){ Val = "00" };
            FontFamily fontFamily1 = new FontFamily(){ Val = FontFamilyValues.Roman };
            Pitch pitch1 = new Pitch(){ Val = FontPitchValues.Variable };
            FontSignature fontSignature1 = new FontSignature(){ UnicodeSignature0 = "00000287", UnicodeSignature1 = "00000000", UnicodeSignature2 = "00000000", UnicodeSignature3 = "00000000", CodePageSignature0 = "0000009F", CodePageSignature1 = "00000000" };

            font1.Append(panose1Number1);
            font1.Append(fontCharSet1);
            font1.Append(fontFamily1);
            font1.Append(pitch1);
            font1.Append(fontSignature1);

            Font font2 = new Font(){ Name = "MS 明朝" };
            AltName altName1 = new AltName(){ Val = "MS Mincho" };
            Panose1Number panose1Number2 = new Panose1Number(){ Val = "02020609040205080304" };
            FontCharSet fontCharSet2 = new FontCharSet(){ Val = "80" };
            FontFamily fontFamily2 = new FontFamily(){ Val = FontFamilyValues.Roman };
            Pitch pitch2 = new Pitch(){ Val = FontPitchValues.Fixed };
            FontSignature fontSignature2 = new FontSignature(){ UnicodeSignature0 = "E00002FF", UnicodeSignature1 = "6AC7FDFB", UnicodeSignature2 = "00000012", UnicodeSignature3 = "00000000", CodePageSignature0 = "0002009F", CodePageSignature1 = "00000000" };

            font2.Append(altName1);
            font2.Append(panose1Number2);
            font2.Append(fontCharSet2);
            font2.Append(fontFamily2);
            font2.Append(pitch2);
            font2.Append(fontSignature2);

            Font font3 = new Font(){ Name = "Times New Roman" };
            Panose1Number panose1Number3 = new Panose1Number(){ Val = "02020603050405020304" };
            FontCharSet fontCharSet3 = new FontCharSet(){ Val = "00" };
            FontFamily fontFamily3 = new FontFamily(){ Val = FontFamilyValues.Roman };
            Pitch pitch3 = new Pitch(){ Val = FontPitchValues.Variable };
            FontSignature fontSignature3 = new FontSignature(){ UnicodeSignature0 = "E0002AFF", UnicodeSignature1 = "C0007841", UnicodeSignature2 = "00000009", UnicodeSignature3 = "00000000", CodePageSignature0 = "000001FF", CodePageSignature1 = "00000000" };

            font3.Append(panose1Number3);
            font3.Append(fontCharSet3);
            font3.Append(fontFamily3);
            font3.Append(pitch3);
            font3.Append(fontSignature3);

            Font font4 = new Font(){ Name = "MS ゴシック" };
            AltName altName2 = new AltName(){ Val = "MS Gothic" };
            Panose1Number panose1Number4 = new Panose1Number(){ Val = "020B0609070205080204" };
            FontCharSet fontCharSet4 = new FontCharSet(){ Val = "80" };
            FontFamily fontFamily4 = new FontFamily(){ Val = FontFamilyValues.Modern };
            Pitch pitch4 = new Pitch(){ Val = FontPitchValues.Fixed };
            FontSignature fontSignature4 = new FontSignature(){ UnicodeSignature0 = "E00002FF", UnicodeSignature1 = "6AC7FDFB", UnicodeSignature2 = "00000012", UnicodeSignature3 = "00000000", CodePageSignature0 = "0002009F", CodePageSignature1 = "00000000" };

            font4.Append(altName2);
            font4.Append(panose1Number4);
            font4.Append(fontCharSet4);
            font4.Append(fontFamily4);
            font4.Append(pitch4);
            font4.Append(fontSignature4);

            Font font5 = new Font(){ Name = "Arial" };
            Panose1Number panose1Number5 = new Panose1Number(){ Val = "020B0604020202020204" };
            FontCharSet fontCharSet5 = new FontCharSet(){ Val = "00" };
            FontFamily fontFamily5 = new FontFamily(){ Val = FontFamilyValues.Swiss };
            Pitch pitch5 = new Pitch(){ Val = FontPitchValues.Variable };
            FontSignature fontSignature5 = new FontSignature(){ UnicodeSignature0 = "E0002AFF", UnicodeSignature1 = "C0007843", UnicodeSignature2 = "00000009", UnicodeSignature3 = "00000000", CodePageSignature0 = "000001FF", CodePageSignature1 = "00000000" };

            font5.Append(panose1Number5);
            font5.Append(fontCharSet5);
            font5.Append(fontFamily5);
            font5.Append(pitch5);
            font5.Append(fontSignature5);

            fonts1.Append(font1);
            fonts1.Append(font2);
            fonts1.Append(font3);
            fonts1.Append(font4);
            fonts1.Append(font5);

            fontTablePart1.Fonts = fonts1;
        }
Esempio n. 4
0
        // Generates content of fontTablePart1.
        private void GenerateFontTablePart1Content(FontTablePart fontTablePart1)
        {
            Fonts fonts1 = new Fonts() { MCAttributes = new MarkupCompatibilityAttributes() { Ignorable = "w14 w15" } };
            fonts1.AddNamespaceDeclaration("mc", "http://schemas.openxmlformats.org/markup-compatibility/2006");
            fonts1.AddNamespaceDeclaration("r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships");
            fonts1.AddNamespaceDeclaration("w", "http://schemas.openxmlformats.org/wordprocessingml/2006/main");
            fonts1.AddNamespaceDeclaration("w14", "http://schemas.microsoft.com/office/word/2010/wordml");
            fonts1.AddNamespaceDeclaration("w15", "http://schemas.microsoft.com/office/word/2012/wordml");

            Font font1 = new Font() { Name = "Calibri" };
            Panose1Number panose1Number1 = new Panose1Number() { Val = "020F0502020204030204" };
            FontCharSet fontCharSet1 = new FontCharSet() { Val = "00" };
            FontFamily fontFamily1 = new FontFamily() { Val = FontFamilyValues.Swiss };
            Pitch pitch1 = new Pitch() { Val = FontPitchValues.Variable };
            FontSignature fontSignature1 = new FontSignature() { UnicodeSignature0 = "E00002FF", UnicodeSignature1 = "4000ACFF", UnicodeSignature2 = "00000001", UnicodeSignature3 = "00000000", CodePageSignature0 = "0000019F", CodePageSignature1 = "00000000" };

            font1.Append(panose1Number1);
            font1.Append(fontCharSet1);
            font1.Append(fontFamily1);
            font1.Append(pitch1);
            font1.Append(fontSignature1);

            Font font2 = new Font() { Name = "Times New Roman" };
            Panose1Number panose1Number2 = new Panose1Number() { Val = "02020603050405020304" };
            FontCharSet fontCharSet2 = new FontCharSet() { Val = "00" };
            FontFamily fontFamily2 = new FontFamily() { Val = FontFamilyValues.Roman };
            Pitch pitch2 = new Pitch() { Val = FontPitchValues.Variable };
            FontSignature fontSignature2 = new FontSignature() { UnicodeSignature0 = "E0002EFF", UnicodeSignature1 = "C0007843", UnicodeSignature2 = "00000009", UnicodeSignature3 = "00000000", CodePageSignature0 = "000001FF", CodePageSignature1 = "00000000" };

            font2.Append(panose1Number2);
            font2.Append(fontCharSet2);
            font2.Append(fontFamily2);
            font2.Append(pitch2);
            font2.Append(fontSignature2);

            Font font3 = new Font() { Name = "Arial" };
            Panose1Number panose1Number3 = new Panose1Number() { Val = "020B0604020202020204" };
            FontCharSet fontCharSet3 = new FontCharSet() { Val = "00" };
            FontFamily fontFamily3 = new FontFamily() { Val = FontFamilyValues.Swiss };
            Pitch pitch3 = new Pitch() { Val = FontPitchValues.Variable };
            FontSignature fontSignature3 = new FontSignature() { UnicodeSignature0 = "E0002EFF", UnicodeSignature1 = "C0007843", UnicodeSignature2 = "00000009", UnicodeSignature3 = "00000000", CodePageSignature0 = "000001FF", CodePageSignature1 = "00000000" };

            font3.Append(panose1Number3);
            font3.Append(fontCharSet3);
            font3.Append(fontFamily3);
            font3.Append(pitch3);
            font3.Append(fontSignature3);

            Font font4 = new Font() { Name = "Calibri Light" };
            Panose1Number panose1Number4 = new Panose1Number() { Val = "020F0302020204030204" };
            FontCharSet fontCharSet4 = new FontCharSet() { Val = "00" };
            FontFamily fontFamily4 = new FontFamily() { Val = FontFamilyValues.Swiss };
            Pitch pitch4 = new Pitch() { Val = FontPitchValues.Variable };
            FontSignature fontSignature4 = new FontSignature() { UnicodeSignature0 = "A00002EF", UnicodeSignature1 = "4000207B", UnicodeSignature2 = "00000000", UnicodeSignature3 = "00000000", CodePageSignature0 = "0000019F", CodePageSignature1 = "00000000" };

            font4.Append(panose1Number4);
            font4.Append(fontCharSet4);
            font4.Append(fontFamily4);
            font4.Append(pitch4);
            font4.Append(fontSignature4);

            fonts1.Append(font1);
            fonts1.Append(font2);
            fonts1.Append(font3);
            fonts1.Append(font4);

            fontTablePart1.Fonts = fonts1;
        }
Esempio n. 5
0
        public static void GenerateFontTablePart1Content(FontTablePart fontTablePart1)
        {
            Fonts fonts1 = new Fonts()
            {
                MCAttributes = new MarkupCompatibilityAttributes()
                {
                    Ignorable = "w14 w15 w16se w16cid"
                }
            };

            fonts1.AddNamespaceDeclaration("mc", "http://schemas.openxmlformats.org/markup-compatibility/2006");
            fonts1.AddNamespaceDeclaration("r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships");
            fonts1.AddNamespaceDeclaration("w", "http://schemas.openxmlformats.org/wordprocessingml/2006/main");
            fonts1.AddNamespaceDeclaration("w14", "http://schemas.microsoft.com/office/word/2010/wordml");
            fonts1.AddNamespaceDeclaration("w15", "http://schemas.microsoft.com/office/word/2012/wordml");
            fonts1.AddNamespaceDeclaration("w16cid", "http://schemas.microsoft.com/office/word/2016/wordml/cid");
            fonts1.AddNamespaceDeclaration("w16se", "http://schemas.microsoft.com/office/word/2015/wordml/symex");

            Font font1 = new Font()
            {
                Name = "Arial"
            };
            Panose1Number panose1Number1 = new Panose1Number()
            {
                Val = "020B0604020202020204"
            };
            FontCharSet fontCharSet1 = new FontCharSet()
            {
                Val = "BA"
            };
            FontFamily fontFamily1 = new FontFamily()
            {
                Val = FontFamilyValues.Swiss
            };
            Pitch pitch1 = new Pitch()
            {
                Val = FontPitchValues.Variable
            };
            FontSignature fontSignature1 = new FontSignature()
            {
                UnicodeSignature0 = "E0002EFF", UnicodeSignature1 = "C000785B", UnicodeSignature2 = "00000009", UnicodeSignature3 = "00000000", CodePageSignature0 = "000001FF", CodePageSignature1 = "00000000"
            };

            font1.Append(panose1Number1);
            font1.Append(fontCharSet1);
            font1.Append(fontFamily1);
            font1.Append(pitch1);
            font1.Append(fontSignature1);

            Font font2 = new Font()
            {
                Name = "Times New Roman"
            };
            Panose1Number panose1Number2 = new Panose1Number()
            {
                Val = "02020603050405020304"
            };
            FontCharSet fontCharSet2 = new FontCharSet()
            {
                Val = "BA"
            };
            FontFamily fontFamily2 = new FontFamily()
            {
                Val = FontFamilyValues.Roman
            };
            Pitch pitch2 = new Pitch()
            {
                Val = FontPitchValues.Variable
            };
            FontSignature fontSignature2 = new FontSignature()
            {
                UnicodeSignature0 = "E0002EFF", UnicodeSignature1 = "C000785B", UnicodeSignature2 = "00000009", UnicodeSignature3 = "00000000", CodePageSignature0 = "000001FF", CodePageSignature1 = "00000000"
            };

            font2.Append(panose1Number2);
            font2.Append(fontCharSet2);
            font2.Append(fontFamily2);
            font2.Append(pitch2);
            font2.Append(fontSignature2);

            Font font3 = new Font()
            {
                Name = "Wingdings"
            };
            Panose1Number panose1Number3 = new Panose1Number()
            {
                Val = "05000000000000000000"
            };
            FontCharSet fontCharSet3 = new FontCharSet()
            {
                Val = "02"
            };
            FontFamily fontFamily3 = new FontFamily()
            {
                Val = FontFamilyValues.Auto
            };
            Pitch pitch3 = new Pitch()
            {
                Val = FontPitchValues.Variable
            };
            FontSignature fontSignature3 = new FontSignature()
            {
                UnicodeSignature0 = "00000000", UnicodeSignature1 = "10000000", UnicodeSignature2 = "00000000", UnicodeSignature3 = "00000000", CodePageSignature0 = "80000000", CodePageSignature1 = "00000000"
            };

            font3.Append(panose1Number3);
            font3.Append(fontCharSet3);
            font3.Append(fontFamily3);
            font3.Append(pitch3);
            font3.Append(fontSignature3);

            Font font4 = new Font()
            {
                Name = "Cambria"
            };
            Panose1Number panose1Number4 = new Panose1Number()
            {
                Val = "02040503050406030204"
            };
            FontCharSet fontCharSet4 = new FontCharSet()
            {
                Val = "BA"
            };
            FontFamily fontFamily4 = new FontFamily()
            {
                Val = FontFamilyValues.Roman
            };
            Pitch pitch4 = new Pitch()
            {
                Val = FontPitchValues.Variable
            };
            FontSignature fontSignature4 = new FontSignature()
            {
                UnicodeSignature0 = "E00006FF", UnicodeSignature1 = "420024FF", UnicodeSignature2 = "02000000", UnicodeSignature3 = "00000000", CodePageSignature0 = "0000019F", CodePageSignature1 = "00000000"
            };

            font4.Append(panose1Number4);
            font4.Append(fontCharSet4);
            font4.Append(fontFamily4);
            font4.Append(pitch4);
            font4.Append(fontSignature4);

            Font font5 = new Font()
            {
                Name = "Calibri"
            };
            Panose1Number panose1Number5 = new Panose1Number()
            {
                Val = "020F0502020204030204"
            };
            FontCharSet fontCharSet5 = new FontCharSet()
            {
                Val = "BA"
            };
            FontFamily fontFamily5 = new FontFamily()
            {
                Val = FontFamilyValues.Swiss
            };
            Pitch pitch5 = new Pitch()
            {
                Val = FontPitchValues.Variable
            };
            FontSignature fontSignature5 = new FontSignature()
            {
                UnicodeSignature0 = "E0002AFF", UnicodeSignature1 = "C000247B", UnicodeSignature2 = "00000009", UnicodeSignature3 = "00000000", CodePageSignature0 = "000001FF", CodePageSignature1 = "00000000"
            };

            font5.Append(panose1Number5);
            font5.Append(fontCharSet5);
            font5.Append(fontFamily5);
            font5.Append(pitch5);
            font5.Append(fontSignature5);

            fonts1.Append(font1);
            fonts1.Append(font2);
            fonts1.Append(font3);
            fonts1.Append(font4);
            fonts1.Append(font5);

            fontTablePart1.Fonts = fonts1;
        }
Esempio n. 6
0
        private void SetFontTablePart(FontTablePart fontTablePart1)
        {
            Fonts fonts1 = new Fonts()
            {
                MCAttributes = new MarkupCompatibilityAttributes()
                {
                    Ignorable = "w14 w15"
                }
            };

            fonts1.AddNamespaceDeclaration("mc", "http://schemas.openxmlformats.org/markup-compatibility/2006");
            fonts1.AddNamespaceDeclaration("r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships");
            fonts1.AddNamespaceDeclaration("w", "http://schemas.openxmlformats.org/wordprocessingml/2006/main");
            fonts1.AddNamespaceDeclaration("w14", "http://schemas.microsoft.com/office/word/2010/wordml");
            fonts1.AddNamespaceDeclaration("w15", "http://schemas.microsoft.com/office/word/2012/wordml");

            Font font1 = new Font()
            {
                Name = "Calibri"
            };
            Panose1Number panose1Number1 = new Panose1Number()
            {
                Val = "020F0502020204030204"
            };
            FontCharSet fontCharSet1 = new FontCharSet()
            {
                Val = "00"
            };
            FontFamily fontFamily1 = new FontFamily()
            {
                Val = FontFamilyValues.Swiss
            };
            Pitch pitch1 = new Pitch()
            {
                Val = FontPitchValues.Variable
            };
            FontSignature fontSignature1 = new FontSignature()
            {
                UnicodeSignature0 = "E0002AFF", UnicodeSignature1 = "C000247B", UnicodeSignature2 = "00000009", UnicodeSignature3 = "00000000", CodePageSignature0 = "000001FF", CodePageSignature1 = "00000000"
            };

            font1.Append(panose1Number1);
            font1.Append(fontCharSet1);
            font1.Append(fontFamily1);
            font1.Append(pitch1);
            font1.Append(fontSignature1);

            Font font2 = new Font()
            {
                Name = "Times New Roman"
            };
            Panose1Number panose1Number2 = new Panose1Number()
            {
                Val = "02020603050405020304"
            };
            FontCharSet fontCharSet2 = new FontCharSet()
            {
                Val = "00"
            };
            FontFamily fontFamily2 = new FontFamily()
            {
                Val = FontFamilyValues.Roman
            };
            Pitch pitch2 = new Pitch()
            {
                Val = FontPitchValues.Variable
            };
            FontSignature fontSignature2 = new FontSignature()
            {
                UnicodeSignature0 = "E0002EFF", UnicodeSignature1 = "C000785B", UnicodeSignature2 = "00000009", UnicodeSignature3 = "00000000", CodePageSignature0 = "000001FF", CodePageSignature1 = "00000000"
            };

            font2.Append(panose1Number2);
            font2.Append(fontCharSet2);
            font2.Append(fontFamily2);
            font2.Append(pitch2);
            font2.Append(fontSignature2);

            Font font3 = new Font()
            {
                Name = "Calibri Light"
            };
            Panose1Number panose1Number3 = new Panose1Number()
            {
                Val = "020F0302020204030204"
            };
            FontCharSet fontCharSet3 = new FontCharSet()
            {
                Val = "00"
            };
            FontFamily fontFamily3 = new FontFamily()
            {
                Val = FontFamilyValues.Swiss
            };
            Pitch pitch3 = new Pitch()
            {
                Val = FontPitchValues.Variable
            };
            FontSignature fontSignature3 = new FontSignature()
            {
                UnicodeSignature0 = "E0002AFF", UnicodeSignature1 = "C000247B", UnicodeSignature2 = "00000009", UnicodeSignature3 = "00000000", CodePageSignature0 = "000001FF", CodePageSignature1 = "00000000"
            };

            font3.Append(panose1Number3);
            font3.Append(fontCharSet3);
            font3.Append(fontFamily3);
            font3.Append(pitch3);
            font3.Append(fontSignature3);

            fonts1.Append(font1);
            fonts1.Append(font2);
            fonts1.Append(font3);

            fontTablePart1.Fonts = fonts1;
        }
Esempio n. 7
0
        // Generates content of fontTablePart1.
        private void GenerateFontTablePart1Content(FontTablePart fontTablePart1)
        {
            Fonts fonts1 = new Fonts() { MCAttributes = new MarkupCompatibilityAttributes() { Ignorable = "w14 w15 w16se" } };
            fonts1.AddNamespaceDeclaration("mc", "http://schemas.openxmlformats.org/markup-compatibility/2006");
            fonts1.AddNamespaceDeclaration("r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships");
            fonts1.AddNamespaceDeclaration("w", "http://schemas.openxmlformats.org/wordprocessingml/2006/main");
            fonts1.AddNamespaceDeclaration("w14", "http://schemas.microsoft.com/office/word/2010/wordml");
            fonts1.AddNamespaceDeclaration("w15", "http://schemas.microsoft.com/office/word/2012/wordml");
            fonts1.AddNamespaceDeclaration("w16se", "http://schemas.microsoft.com/office/word/2015/wordml/symex");

            Font font1 = new Font() { Name = "Symbol" };
            Panose1Number panose1Number1 = new Panose1Number() { Val = "05050102010706020507" };
            FontCharSet fontCharSet1 = new FontCharSet() { Val = "02" };
            FontFamily fontFamily1 = new FontFamily() { Val = FontFamilyValues.Roman };
            Pitch pitch1 = new Pitch() { Val = FontPitchValues.Variable };
            FontSignature fontSignature1 = new FontSignature() { UnicodeSignature0 = "00000000", UnicodeSignature1 = "10000000", UnicodeSignature2 = "00000000", UnicodeSignature3 = "00000000", CodePageSignature0 = "80000000", CodePageSignature1 = "00000000" };

            font1.Append(panose1Number1);
            font1.Append(fontCharSet1);
            font1.Append(fontFamily1);
            font1.Append(pitch1);
            font1.Append(fontSignature1);

            Font font2 = new Font() { Name = "Times New Roman" };
            Panose1Number panose1Number2 = new Panose1Number() { Val = "02020603050405020304" };
            FontCharSet fontCharSet2 = new FontCharSet() { Val = "00" };
            FontFamily fontFamily2 = new FontFamily() { Val = FontFamilyValues.Roman };
            Pitch pitch2 = new Pitch() { Val = FontPitchValues.Variable };
            FontSignature fontSignature2 = new FontSignature() { UnicodeSignature0 = "E0002EFF", UnicodeSignature1 = "C000784B", UnicodeSignature2 = "00000009", UnicodeSignature3 = "00000000", CodePageSignature0 = "000001FF", CodePageSignature1 = "00000000" };

            font2.Append(panose1Number2);
            font2.Append(fontCharSet2);
            font2.Append(fontFamily2);
            font2.Append(pitch2);
            font2.Append(fontSignature2);

            Font font3 = new Font() { Name = "Courier New" };
            Panose1Number panose1Number3 = new Panose1Number() { Val = "02070309020205020404" };
            FontCharSet fontCharSet3 = new FontCharSet() { Val = "00" };
            FontFamily fontFamily3 = new FontFamily() { Val = FontFamilyValues.Modern };
            Pitch pitch3 = new Pitch() { Val = FontPitchValues.Fixed };
            FontSignature fontSignature3 = new FontSignature() { UnicodeSignature0 = "E0002EFF", UnicodeSignature1 = "C0007843", UnicodeSignature2 = "00000009", UnicodeSignature3 = "00000000", CodePageSignature0 = "000001FF", CodePageSignature1 = "00000000" };

            font3.Append(panose1Number3);
            font3.Append(fontCharSet3);
            font3.Append(fontFamily3);
            font3.Append(pitch3);
            font3.Append(fontSignature3);

            Font font4 = new Font() { Name = "Wingdings" };
            Panose1Number panose1Number4 = new Panose1Number() { Val = "05000000000000000000" };
            FontCharSet fontCharSet4 = new FontCharSet() { Val = "02" };
            FontFamily fontFamily4 = new FontFamily() { Val = FontFamilyValues.Auto };
            Pitch pitch4 = new Pitch() { Val = FontPitchValues.Variable };
            FontSignature fontSignature4 = new FontSignature() { UnicodeSignature0 = "00000000", UnicodeSignature1 = "10000000", UnicodeSignature2 = "00000000", UnicodeSignature3 = "00000000", CodePageSignature0 = "80000000", CodePageSignature1 = "00000000" };

            font4.Append(panose1Number4);
            font4.Append(fontCharSet4);
            font4.Append(fontFamily4);
            font4.Append(pitch4);
            font4.Append(fontSignature4);

            Font font5 = new Font() { Name = "Calibri" };
            Panose1Number panose1Number5 = new Panose1Number() { Val = "020F0502020204030204" };
            FontCharSet fontCharSet5 = new FontCharSet() { Val = "00" };
            FontFamily fontFamily5 = new FontFamily() { Val = FontFamilyValues.Swiss };
            Pitch pitch5 = new Pitch() { Val = FontPitchValues.Variable };
            FontSignature fontSignature5 = new FontSignature() { UnicodeSignature0 = "E0002AFF", UnicodeSignature1 = "C000247B", UnicodeSignature2 = "00000009", UnicodeSignature3 = "00000000", CodePageSignature0 = "000001FF", CodePageSignature1 = "00000000" };

            font5.Append(panose1Number5);
            font5.Append(fontCharSet5);
            font5.Append(fontFamily5);
            font5.Append(pitch5);
            font5.Append(fontSignature5);

            Font font6 = new Font() { Name = "Arial" };
            Panose1Number panose1Number6 = new Panose1Number() { Val = "020B0604020202020204" };
            FontCharSet fontCharSet6 = new FontCharSet() { Val = "00" };
            FontFamily fontFamily6 = new FontFamily() { Val = FontFamilyValues.Swiss };
            Pitch pitch6 = new Pitch() { Val = FontPitchValues.Variable };
            FontSignature fontSignature6 = new FontSignature() { UnicodeSignature0 = "E0002EFF", UnicodeSignature1 = "C0007843", UnicodeSignature2 = "00000009", UnicodeSignature3 = "00000000", CodePageSignature0 = "000001FF", CodePageSignature1 = "00000000" };

            font6.Append(panose1Number6);
            font6.Append(fontCharSet6);
            font6.Append(fontFamily6);
            font6.Append(pitch6);
            font6.Append(fontSignature6);

            Font font7 = new Font() { Name = "Cambria" };
            Panose1Number panose1Number7 = new Panose1Number() { Val = "02040503050406030204" };
            FontCharSet fontCharSet7 = new FontCharSet() { Val = "00" };
            FontFamily fontFamily7 = new FontFamily() { Val = FontFamilyValues.Roman };
            Pitch pitch7 = new Pitch() { Val = FontPitchValues.Variable };
            FontSignature fontSignature7 = new FontSignature() { UnicodeSignature0 = "E00002FF", UnicodeSignature1 = "400004FF", UnicodeSignature2 = "00000000", UnicodeSignature3 = "00000000", CodePageSignature0 = "0000019F", CodePageSignature1 = "00000000" };

            font7.Append(panose1Number7);
            font7.Append(fontCharSet7);
            font7.Append(fontFamily7);
            font7.Append(pitch7);
            font7.Append(fontSignature7);

            Font font8 = new Font() { Name = "Verdana" };
            Panose1Number panose1Number8 = new Panose1Number() { Val = "020B0604030504040204" };
            FontCharSet fontCharSet8 = new FontCharSet() { Val = "00" };
            FontFamily fontFamily8 = new FontFamily() { Val = FontFamilyValues.Swiss };
            Pitch pitch8 = new Pitch() { Val = FontPitchValues.Variable };
            FontSignature fontSignature8 = new FontSignature() { UnicodeSignature0 = "A10006FF", UnicodeSignature1 = "4000205B", UnicodeSignature2 = "00000010", UnicodeSignature3 = "00000000", CodePageSignature0 = "0000019F", CodePageSignature1 = "00000000" };

            font8.Append(panose1Number8);
            font8.Append(fontCharSet8);
            font8.Append(fontFamily8);
            font8.Append(pitch8);
            font8.Append(fontSignature8);

            Font font9 = new Font() { Name = "Tahoma" };
            Panose1Number panose1Number9 = new Panose1Number() { Val = "020B0604030504040204" };
            FontCharSet fontCharSet9 = new FontCharSet() { Val = "00" };
            FontFamily fontFamily9 = new FontFamily() { Val = FontFamilyValues.Swiss };
            Pitch pitch9 = new Pitch() { Val = FontPitchValues.Variable };
            FontSignature fontSignature9 = new FontSignature() { UnicodeSignature0 = "E1002EFF", UnicodeSignature1 = "C000605B", UnicodeSignature2 = "00000029", UnicodeSignature3 = "00000000", CodePageSignature0 = "000101FF", CodePageSignature1 = "00000000" };

            font9.Append(panose1Number9);
            font9.Append(fontCharSet9);
            font9.Append(fontFamily9);
            font9.Append(pitch9);
            font9.Append(fontSignature9);

            Font font10 = new Font() { Name = "Arial Black" };
            Panose1Number panose1Number10 = new Panose1Number() { Val = "020B0A04020102020204" };
            FontCharSet fontCharSet10 = new FontCharSet() { Val = "00" };
            FontFamily fontFamily10 = new FontFamily() { Val = FontFamilyValues.Swiss };
            Pitch pitch10 = new Pitch() { Val = FontPitchValues.Variable };
            FontSignature fontSignature10 = new FontSignature() { UnicodeSignature0 = "A00002AF", UnicodeSignature1 = "400078FB", UnicodeSignature2 = "00000000", UnicodeSignature3 = "00000000", CodePageSignature0 = "0000009F", CodePageSignature1 = "00000000" };

            font10.Append(panose1Number10);
            font10.Append(fontCharSet10);
            font10.Append(fontFamily10);
            font10.Append(pitch10);
            font10.Append(fontSignature10);

            Font font11 = new Font() { Name = "MS Gothic" };
            AltName altName1 = new AltName() { Val = "MS ゴシック" };
            Panose1Number panose1Number11 = new Panose1Number() { Val = "020B0609070205080204" };
            FontCharSet fontCharSet11 = new FontCharSet() { Val = "80" };
            FontFamily fontFamily11 = new FontFamily() { Val = FontFamilyValues.Modern };
            Pitch pitch11 = new Pitch() { Val = FontPitchValues.Fixed };
            FontSignature fontSignature11 = new FontSignature() { UnicodeSignature0 = "E00002FF", UnicodeSignature1 = "6AC7FDFB", UnicodeSignature2 = "08000012", UnicodeSignature3 = "00000000", CodePageSignature0 = "0002009F", CodePageSignature1 = "00000000" };

            font11.Append(altName1);
            font11.Append(panose1Number11);
            font11.Append(fontCharSet11);
            font11.Append(fontFamily11);
            font11.Append(pitch11);
            font11.Append(fontSignature11);

            Font font12 = new Font() { Name = "MS Mincho" };
            AltName altName2 = new AltName() { Val = "Yu Gothic UI" };
            Panose1Number panose1Number12 = new Panose1Number() { Val = "02020609040205080304" };
            FontCharSet fontCharSet12 = new FontCharSet() { Val = "80" };
            FontFamily fontFamily12 = new FontFamily() { Val = FontFamilyValues.Modern };
            Pitch pitch12 = new Pitch() { Val = FontPitchValues.Fixed };
            FontSignature fontSignature12 = new FontSignature() { UnicodeSignature0 = "E00002FF", UnicodeSignature1 = "6AC7FDFB", UnicodeSignature2 = "00000012", UnicodeSignature3 = "00000000", CodePageSignature0 = "0002009F", CodePageSignature1 = "00000000" };

            font12.Append(altName2);
            font12.Append(panose1Number12);
            font12.Append(fontCharSet12);
            font12.Append(fontFamily12);
            font12.Append(pitch12);
            font12.Append(fontSignature12);

            Font font13 = new Font() { Name = "Segoe UI" };
            Panose1Number panose1Number13 = new Panose1Number() { Val = "020B0502040204020203" };
            FontCharSet fontCharSet13 = new FontCharSet() { Val = "00" };
            FontFamily fontFamily13 = new FontFamily() { Val = FontFamilyValues.Swiss };
            Pitch pitch13 = new Pitch() { Val = FontPitchValues.Variable };
            FontSignature fontSignature13 = new FontSignature() { UnicodeSignature0 = "E4002EFF", UnicodeSignature1 = "C000E47F", UnicodeSignature2 = "00000009", UnicodeSignature3 = "00000000", CodePageSignature0 = "000001FF", CodePageSignature1 = "00000000" };

            font13.Append(panose1Number13);
            font13.Append(fontCharSet13);
            font13.Append(fontFamily13);
            font13.Append(pitch13);
            font13.Append(fontSignature13);

            fonts1.Append(font1);
            fonts1.Append(font2);
            fonts1.Append(font3);
            fonts1.Append(font4);
            fonts1.Append(font5);
            fonts1.Append(font6);
            fonts1.Append(font7);
            fonts1.Append(font8);
            fonts1.Append(font9);
            fonts1.Append(font10);
            fonts1.Append(font11);
            fonts1.Append(font12);
            fonts1.Append(font13);

            fontTablePart1.Fonts = fonts1;
        }
        // Generates content of fontTablePart1.
        private void GenerateFontTablePart1Content(FontTablePart fontTablePart1)
        {
            Fonts fonts1 = new Fonts();

            Font font1 = new Font() { Name = "Times New Roman" };
            Panose1Number panose1Number1 = new Panose1Number() { Val = "02020603050405020304" };
            FontCharSet fontCharSet1 = new FontCharSet() { Val = "00" };
            FontFamily fontFamily1 = new FontFamily() { Val = FontFamilyValues.Roman };
            Pitch pitch1 = new Pitch() { Val = FontPitchValues.Variable };
            FontSignature fontSignature1 = new FontSignature() { UnicodeSignature0 = "20002A87", UnicodeSignature1 = "80000000", UnicodeSignature2 = "00000008", UnicodeSignature3 = "00000000", CodePageSignature0 = "000001FF", CodePageSignature1 = "00000000" };

            font1.Append(panose1Number1);
            font1.Append(fontCharSet1);
            font1.Append(fontFamily1);
            font1.Append(pitch1);
            font1.Append(fontSignature1);

            Font font2 = new Font() { Name = "Wingdings" };
            Panose1Number panose1Number2 = new Panose1Number() { Val = "05000000000000000000" };
            FontCharSet fontCharSet2 = new FontCharSet() { Val = "02" };
            FontFamily fontFamily2 = new FontFamily() { Val = FontFamilyValues.Auto };
            Pitch pitch2 = new Pitch() { Val = FontPitchValues.Variable };
            FontSignature fontSignature2 = new FontSignature() { UnicodeSignature0 = "00000000", UnicodeSignature1 = "10000000", UnicodeSignature2 = "00000000", UnicodeSignature3 = "00000000", CodePageSignature0 = "80000000", CodePageSignature1 = "00000000" };

            font2.Append(panose1Number2);
            font2.Append(fontCharSet2);
            font2.Append(fontFamily2);
            font2.Append(pitch2);
            font2.Append(fontSignature2);

            Font font3 = new Font() { Name = "MS Mincho" };
            AltName altName1 = new AltName() { Val = "MS 明朝" };
            Panose1Number panose1Number3 = new Panose1Number() { Val = "02020609040205080304" };
            FontCharSet fontCharSet3 = new FontCharSet() { Val = "80" };
            FontFamily fontFamily3 = new FontFamily() { Val = FontFamilyValues.Modern };
            Pitch pitch3 = new Pitch() { Val = FontPitchValues.Fixed };
            FontSignature fontSignature3 = new FontSignature() { UnicodeSignature0 = "A00002BF", UnicodeSignature1 = "68C7FCFB", UnicodeSignature2 = "00000010", UnicodeSignature3 = "00000000", CodePageSignature0 = "0002009F", CodePageSignature1 = "00000000" };

            font3.Append(altName1);
            font3.Append(panose1Number3);
            font3.Append(fontCharSet3);
            font3.Append(fontFamily3);
            font3.Append(pitch3);
            font3.Append(fontSignature3);

            Font font4 = new Font() { Name = "Arial" };
            Panose1Number panose1Number4 = new Panose1Number() { Val = "020B0604020202020204" };
            FontCharSet fontCharSet4 = new FontCharSet() { Val = "00" };
            FontFamily fontFamily4 = new FontFamily() { Val = FontFamilyValues.Swiss };
            Pitch pitch4 = new Pitch() { Val = FontPitchValues.Variable };
            FontSignature fontSignature4 = new FontSignature() { UnicodeSignature0 = "20002A87", UnicodeSignature1 = "80000000", UnicodeSignature2 = "00000008", UnicodeSignature3 = "00000000", CodePageSignature0 = "000001FF", CodePageSignature1 = "00000000" };

            font4.Append(panose1Number4);
            font4.Append(fontCharSet4);
            font4.Append(fontFamily4);
            font4.Append(pitch4);
            font4.Append(fontSignature4);

            Font font5 = new Font() { Name = "Tahoma" };
            Panose1Number panose1Number5 = new Panose1Number() { Val = "020B0604030504040204" };
            FontCharSet fontCharSet5 = new FontCharSet() { Val = "00" };
            FontFamily fontFamily5 = new FontFamily() { Val = FontFamilyValues.Swiss };
            NotTrueType notTrueType1 = new NotTrueType();
            Pitch pitch5 = new Pitch() { Val = FontPitchValues.Variable };
            FontSignature fontSignature5 = new FontSignature() { UnicodeSignature0 = "00000003", UnicodeSignature1 = "00000000", UnicodeSignature2 = "00000000", UnicodeSignature3 = "00000000", CodePageSignature0 = "00000001", CodePageSignature1 = "00000000" };

            font5.Append(panose1Number5);
            font5.Append(fontCharSet5);
            font5.Append(fontFamily5);
            font5.Append(notTrueType1);
            font5.Append(pitch5);
            font5.Append(fontSignature5);

            Font font6 = new Font() { Name = "Arial Unicode MS" };
            Panose1Number panose1Number6 = new Panose1Number() { Val = "020B0604020202020204" };
            FontCharSet fontCharSet6 = new FontCharSet() { Val = "00" };
            FontFamily fontFamily6 = new FontFamily() { Val = FontFamilyValues.Roman };
            NotTrueType notTrueType2 = new NotTrueType();
            Pitch pitch6 = new Pitch() { Val = FontPitchValues.Variable };
            FontSignature fontSignature6 = new FontSignature() { UnicodeSignature0 = "00000003", UnicodeSignature1 = "00000000", UnicodeSignature2 = "00000000", UnicodeSignature3 = "00000000", CodePageSignature0 = "00000001", CodePageSignature1 = "00000000" };

            font6.Append(panose1Number6);
            font6.Append(fontCharSet6);
            font6.Append(fontFamily6);
            font6.Append(notTrueType2);
            font6.Append(pitch6);
            font6.Append(fontSignature6);

            Font font7 = new Font() { Name = "Cambria" };
            Panose1Number panose1Number7 = new Panose1Number() { Val = "02040503050406030204" };
            FontCharSet fontCharSet7 = new FontCharSet() { Val = "00" };
            FontFamily fontFamily7 = new FontFamily() { Val = FontFamilyValues.Roman };
            Pitch pitch7 = new Pitch() { Val = FontPitchValues.Variable };
            FontSignature fontSignature7 = new FontSignature() { UnicodeSignature0 = "A00002EF", UnicodeSignature1 = "4000004B", UnicodeSignature2 = "00000000", UnicodeSignature3 = "00000000", CodePageSignature0 = "0000009F", CodePageSignature1 = "00000000" };

            font7.Append(panose1Number7);
            font7.Append(fontCharSet7);
            font7.Append(fontFamily7);
            font7.Append(pitch7);
            font7.Append(fontSignature7);

            Font font8 = new Font() { Name = "Calibri" };
            Panose1Number panose1Number8 = new Panose1Number() { Val = "020F0502020204030204" };
            FontCharSet fontCharSet8 = new FontCharSet() { Val = "00" };
            FontFamily fontFamily8 = new FontFamily() { Val = FontFamilyValues.Swiss };
            Pitch pitch8 = new Pitch() { Val = FontPitchValues.Variable };
            FontSignature fontSignature8 = new FontSignature() { UnicodeSignature0 = "A00002EF", UnicodeSignature1 = "4000207B", UnicodeSignature2 = "00000000", UnicodeSignature3 = "00000000", CodePageSignature0 = "0000009F", CodePageSignature1 = "00000000" };

            font8.Append(panose1Number8);
            font8.Append(fontCharSet8);
            font8.Append(fontFamily8);
            font8.Append(pitch8);
            font8.Append(fontSignature8);

            fonts1.Append(font1);
            fonts1.Append(font2);
            fonts1.Append(font3);
            fonts1.Append(font4);
            fonts1.Append(font5);
            fonts1.Append(font6);
            fonts1.Append(font7);
            fonts1.Append(font8);

            fontTablePart1.Fonts = fonts1;
        }
        // Generates content of fontTablePart2.
        private void GenerateFontTablePart2Content(FontTablePart fontTablePart2)
        {
            Fonts fonts2 = new Fonts();
            fonts2.AddNamespaceDeclaration("r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships");
            fonts2.AddNamespaceDeclaration("w", "http://schemas.openxmlformats.org/wordprocessingml/2006/main");

            Font font5 = new Font() { Name = "Calibri" };
            Panose1Number panose1Number5 = new Panose1Number() { Val = "020F0502020204030204" };
            FontCharSet fontCharSet5 = new FontCharSet() { Val = "00" };
            FontFamily fontFamily5 = new FontFamily() { Val = FontFamilyValues.Swiss };
            Pitch pitch5 = new Pitch() { Val = FontPitchValues.Variable };
            FontSignature fontSignature5 = new FontSignature() { UnicodeSignature0 = "A00002EF", UnicodeSignature1 = "4000207B", UnicodeSignature2 = "00000000", UnicodeSignature3 = "00000000", CodePageSignature0 = "0000009F", CodePageSignature1 = "00000000" };

            font5.Append(panose1Number5);
            font5.Append(fontCharSet5);
            font5.Append(fontFamily5);
            font5.Append(pitch5);
            font5.Append(fontSignature5);

            Font font6 = new Font() { Name = "Times New Roman" };
            Panose1Number panose1Number6 = new Panose1Number() { Val = "02020603050405020304" };
            FontCharSet fontCharSet6 = new FontCharSet() { Val = "00" };
            FontFamily fontFamily6 = new FontFamily() { Val = FontFamilyValues.Roman };
            Pitch pitch6 = new Pitch() { Val = FontPitchValues.Variable };
            FontSignature fontSignature6 = new FontSignature() { UnicodeSignature0 = "E0002AEF", UnicodeSignature1 = "C0007841", UnicodeSignature2 = "00000009", UnicodeSignature3 = "00000000", CodePageSignature0 = "000001FF", CodePageSignature1 = "00000000" };

            font6.Append(panose1Number6);
            font6.Append(fontCharSet6);
            font6.Append(fontFamily6);
            font6.Append(pitch6);
            font6.Append(fontSignature6);

            Font font7 = new Font() { Name = "Tahoma" };
            Panose1Number panose1Number7 = new Panose1Number() { Val = "020B0604030504040204" };
            FontCharSet fontCharSet7 = new FontCharSet() { Val = "00" };
            FontFamily fontFamily7 = new FontFamily() { Val = FontFamilyValues.Swiss };
            NotTrueType notTrueType2 = new NotTrueType();
            Pitch pitch7 = new Pitch() { Val = FontPitchValues.Variable };
            FontSignature fontSignature7 = new FontSignature() { UnicodeSignature0 = "00000003", UnicodeSignature1 = "00000000", UnicodeSignature2 = "00000000", UnicodeSignature3 = "00000000", CodePageSignature0 = "00000001", CodePageSignature1 = "00000000" };

            font7.Append(panose1Number7);
            font7.Append(fontCharSet7);
            font7.Append(fontFamily7);
            font7.Append(notTrueType2);
            font7.Append(pitch7);
            font7.Append(fontSignature7);

            Font font8 = new Font() { Name = "Cambria" };
            Panose1Number panose1Number8 = new Panose1Number() { Val = "02040503050406030204" };
            FontCharSet fontCharSet8 = new FontCharSet() { Val = "00" };
            FontFamily fontFamily8 = new FontFamily() { Val = FontFamilyValues.Roman };
            Pitch pitch8 = new Pitch() { Val = FontPitchValues.Variable };
            FontSignature fontSignature8 = new FontSignature() { UnicodeSignature0 = "A00002EF", UnicodeSignature1 = "4000004B", UnicodeSignature2 = "00000000", UnicodeSignature3 = "00000000", CodePageSignature0 = "0000009F", CodePageSignature1 = "00000000" };

            font8.Append(panose1Number8);
            font8.Append(fontCharSet8);
            font8.Append(fontFamily8);
            font8.Append(pitch8);
            font8.Append(fontSignature8);

            fonts2.Append(font5);
            fonts2.Append(font6);
            fonts2.Append(font7);
            fonts2.Append(font8);

            fontTablePart2.Fonts = fonts2;
        }
        // Generates content of fontTablePart1.
        private void GenerateFontTablePart1Content(FontTablePart fontTablePart1)
        {
            Fonts fonts1 = new Fonts();
            fonts1.AddNamespaceDeclaration("r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships");
            fonts1.AddNamespaceDeclaration("w", "http://schemas.openxmlformats.org/wordprocessingml/2006/main");

            Font font1 = new Font() { Name = "Calibri" };
            Panose1Number panose1Number1 = new Panose1Number() { Val = "020F0502020204030204" };
            FontCharSet fontCharSet1 = new FontCharSet() { Val = "00" };
            FontFamily fontFamily1 = new FontFamily() { Val = FontFamilyValues.Swiss };
            Pitch pitch1 = new Pitch() { Val = FontPitchValues.Variable };
            FontSignature fontSignature1 = new FontSignature() { UnicodeSignature0 = "A00002EF", UnicodeSignature1 = "4000207B", UnicodeSignature2 = "00000000", UnicodeSignature3 = "00000000", CodePageSignature0 = "0000009F", CodePageSignature1 = "00000000" };

            font1.Append(panose1Number1);
            font1.Append(fontCharSet1);
            font1.Append(fontFamily1);
            font1.Append(pitch1);
            font1.Append(fontSignature1);

            Font font2 = new Font() { Name = "Times New Roman" };
            Panose1Number panose1Number2 = new Panose1Number() { Val = "02020603050405020304" };
            FontCharSet fontCharSet2 = new FontCharSet() { Val = "00" };
            FontFamily fontFamily2 = new FontFamily() { Val = FontFamilyValues.Roman };
            Pitch pitch2 = new Pitch() { Val = FontPitchValues.Variable };
            FontSignature fontSignature2 = new FontSignature() { UnicodeSignature0 = "E0002AEF", UnicodeSignature1 = "C0007841", UnicodeSignature2 = "00000009", UnicodeSignature3 = "00000000", CodePageSignature0 = "000001FF", CodePageSignature1 = "00000000" };

            font2.Append(panose1Number2);
            font2.Append(fontCharSet2);
            font2.Append(fontFamily2);
            font2.Append(pitch2);
            font2.Append(fontSignature2);

            Font font3 = new Font() { Name = "Tahoma" };
            Panose1Number panose1Number3 = new Panose1Number() { Val = "020B0604030504040204" };
            FontCharSet fontCharSet3 = new FontCharSet() { Val = "00" };
            FontFamily fontFamily3 = new FontFamily() { Val = FontFamilyValues.Swiss };
            NotTrueType notTrueType1 = new NotTrueType();
            Pitch pitch3 = new Pitch() { Val = FontPitchValues.Variable };
            FontSignature fontSignature3 = new FontSignature() { UnicodeSignature0 = "00000003", UnicodeSignature1 = "00000000", UnicodeSignature2 = "00000000", UnicodeSignature3 = "00000000", CodePageSignature0 = "00000001", CodePageSignature1 = "00000000" };

            font3.Append(panose1Number3);
            font3.Append(fontCharSet3);
            font3.Append(fontFamily3);
            font3.Append(notTrueType1);
            font3.Append(pitch3);
            font3.Append(fontSignature3);

            Font font4 = new Font() { Name = "Cambria" };
            Panose1Number panose1Number4 = new Panose1Number() { Val = "02040503050406030204" };
            FontCharSet fontCharSet4 = new FontCharSet() { Val = "00" };
            FontFamily fontFamily4 = new FontFamily() { Val = FontFamilyValues.Roman };
            Pitch pitch4 = new Pitch() { Val = FontPitchValues.Variable };
            FontSignature fontSignature4 = new FontSignature() { UnicodeSignature0 = "A00002EF", UnicodeSignature1 = "4000004B", UnicodeSignature2 = "00000000", UnicodeSignature3 = "00000000", CodePageSignature0 = "0000009F", CodePageSignature1 = "00000000" };

            font4.Append(panose1Number4);
            font4.Append(fontCharSet4);
            font4.Append(fontFamily4);
            font4.Append(pitch4);
            font4.Append(fontSignature4);

            fonts1.Append(font1);
            fonts1.Append(font2);
            fonts1.Append(font3);
            fonts1.Append(font4);

            fontTablePart1.Fonts = fonts1;
        }