//--------------------------------------------------------------------------
        //
        // Utility Methods
        //
        //--------------------------------------------------------------------------

        /// <summary> Tests whether this DefineFont2 tag is equivalent to another DefineFont2
        /// tag instance.
        ///
        /// </summary>
        /// <param name="obj">Another DefineFont2 instance to test for equality.
        /// </param>
        /// <returns> true if the given instance is considered equal to this instance
        /// </returns>
        public override bool Equals(System.Object obj)
        {
            bool isEqual = false;

            if (obj is DefineFont2 && base.Equals(obj))
            {
                DefineFont2 defineFont = (DefineFont2)obj;

                // wideOffsets and wideCodes not considered in the equality check
                // as these are determined at encoding time

                if ((defineFont.hasLayout == this.hasLayout) && (defineFont.shiftJIS == this.shiftJIS) && (defineFont.ansi == this.ansi) && (defineFont.italic == this.italic) && (defineFont.bold == this.bold) && (defineFont.langCode == this.langCode) && (defineFont.ascent == this.ascent) && (defineFont.descent == this.descent) && (defineFont.leading == this.leading) && (defineFont.kerningCount == this.kerningCount) && equals(defineFont.name, this.name) && equals(defineFont.fontName, this.fontName) && SupportClass.ArraySupport.Equals(defineFont.glyphShapeTable, this.glyphShapeTable) && SupportClass.ArraySupport.Equals(defineFont.codeTable, this.codeTable) && SupportClass.ArraySupport.Equals(defineFont.advanceTable, this.advanceTable) && SupportClass.ArraySupport.Equals(defineFont.boundsTable, this.boundsTable) && SupportClass.ArraySupport.Equals(defineFont.kerningTable, this.kerningTable))
                {
                    isEqual = true;
                }
            }

            return(isEqual);
        }
		private Tag decodeDefineFont2And3(DefineFont2 t)
		{
			int id = r.readUI16();
			
			r.syncBits();
			
			t.hasLayout = r.readBit();
			t.shiftJIS = r.readBit();
			t.smallText = r.readBit();
			t.ansi = r.readBit();
			t.wideOffsets = r.readBit();
			t.wideCodes = r.readBit();
			// enable after we're sure that bug 147073 isn't a bug.  If it is a bug, then this can be
			// removed as well as the stageDefineFont3-specific code in TagEncoder.defineFont2()
			//if (t.code == stagDefineFont3 && ! t.wideCodes)
			//{
			//    handler.error("widecodes must be true in DefineFont3");
			//}
			
			t.italic = r.readBit();
			t.bold = r.readBit();
			
			t.langCode = r.readUI8();
			
			t.fontName = r.readLengthString();
			
			int numGlyphs = r.readUI16();
			
			// skip offset table
			for (int i = 0; i < numGlyphs; i++)
			{
				if (t.wideOffsets)
					r.readUI32();
				else
					r.readUI16();
			}
			
			if (numGlyphs > 0)
			{
				// skip codeTableOffset
				if (t.wideOffsets)
					r.readUI32();
				else
					r.readUI16();
			}
			
			t.glyphShapeTable = new Shape[numGlyphs];
			
			for (int i = 0; i < numGlyphs; i++)
			{
				t.glyphShapeTable[i] = decodeShape(Flash.Swf.TagValues.stagDefineShape3);
			}
			
			t.codeTable = new char[numGlyphs];
			if (t.wideCodes)
			{
				for (int i = 0; i < numGlyphs; i++)
					t.codeTable[i] = (char) r.readUI16();
			}
			else
			{
				for (int i = 0; i < numGlyphs; i++)
					t.codeTable[i] = (char) r.readUI8();
			}
			
			if (t.hasLayout)
			{
				t.ascent = r.readSI16();
				t.descent = r.readSI16();
				t.leading = r.readSI16();
				t.advanceTable = new short[numGlyphs];
				for (int i = 0; i < numGlyphs; i++)
				{
					t.advanceTable[i] = (short) r.readSI16();
				}
				t.boundsTable = new Rect[numGlyphs];
				for (int i = 0; i < numGlyphs; i++)
				{
					t.boundsTable[i] = decodeRect();
				}
				
				t.kerningCount = r.readUI16();
				t.kerningTable = new KerningRecord[t.kerningCount];
				for (int i = 0; i < t.kerningCount; i++)
				{
					t.kerningTable[i] = decodeKerningRecord(t.wideCodes);
				}
			}
			
			dict.add(id, t);
			dict.addFontFace(t);
			return t;
		}
		public virtual void  defineFont2(DefineFont2 tag)
		{
		}
		private Tag decodeDefineFont2()
		{
			DefineFont2 t = new DefineFont2();
			return decodeDefineFont2And3(t);
		}