Examples of TextRecord


Examples of flash.swf.types.TextRecord

     
      Iterator it = tag.records.iterator();
     
      while (it.hasNext())
      {
        TextRecord tr = (TextRecord)it.next();
        printTextRecord(tr, tag.code);
      }
     
      close(tag);
    }
View Full Code Here

Examples of flash.swf.types.TextRecord

     
      Iterator it = tag.records.iterator();
     
      while (it.hasNext())
      {
        TextRecord tr = (TextRecord)it.next();
        printTextRecord(tr, tag.code);
      }
     
      close(tag);
    }
View Full Code Here

Examples of flash.swf.types.TextRecord

        return e;
    }

    private TextRecord decodeTextRecord(int defineText, int flags, int glyphBits, int advanceBits) throws IOException
    {
        TextRecord t = new TextRecord();

        t.flags = flags;

        if (t.hasFont())
        {
            int idref = r.readUI16();
            t.font = (DefineFont) dict.getTag(idref);
        }

        if (t.hasColor())
        {
            switch (defineText)
            {
            case stagDefineText:
                t.color = decodeRGB(r);
                break;
            case stagDefineText2:
                t.color = decodeRGBA(r);
                break;
            default:
                assert false;
            }
        }

        if (t.hasX())
        {
            t.xOffset = r.readSI16();
        }

        if (t.hasY())
        {
            t.yOffset = r.readSI16();
        }

        if (t.hasHeight())
        {
            t.height = r.readUI16();
        }

        int count = r.readUI8();
View Full Code Here

Examples of flash.swf.types.TextRecord

        // compute necessary bit width
        int glyphBits = 0;
        int advanceBits = 0;
        for (int i=0; i < length; i++)
        {
            TextRecord tr = tag.records.get(i);

            for (int j = 0; j < tr.entries.length; j++)
            {
                GlyphEntry entry = tr.entries[j];

                while (entry.getIndex() > (1<<glyphBits))
                    glyphBits++;
                while (Math.abs(entry.advance) > (1<<advanceBits))
                    advanceBits++;
            }
        }

        // increment to get from bit index to bit count.
        ++glyphBits;
        ++advanceBits;

        w.writeUI8(glyphBits);
        w.writeUI8(++advanceBits); // add one extra bit because advances are signed

        for (int i = 0; i < length; i++)
        {
            TextRecord record = tag.records.get(i);
            encodeTextRecord(record, w, type, glyphBits, advanceBits);
        }

        w.writeUI8(0);
    }
View Full Code Here

Examples of flash.swf.types.TextRecord

        // compute necessary bit width
        int glyphBits = 0;
        int advanceBits = 0;
        for (int i=0; i < length; i++)
        {
            TextRecord tr = tag.records.get(i);

            for (int j = 0; j < tr.entries.length; j++)
            {
                GlyphEntry entry = tr.entries[j];

                while (entry.getIndex() > (1<<glyphBits))
                    glyphBits++;
                while (Math.abs(entry.advance) > (1<<advanceBits))
                    advanceBits++;
            }
        }

        // increment to get from bit index to bit count.
        ++glyphBits;
        ++advanceBits;

        w.writeUI8(glyphBits);
        w.writeUI8(++advanceBits); // add one extra bit because advances are signed

        for (int i = 0; i < length; i++)
        {
            TextRecord record = tag.records.get(i);
            encodeTextRecord(record, w, type, glyphBits, advanceBits);
        }

        w.writeUI8(0);
    }
View Full Code Here

Examples of flash.swf.types.TextRecord

     
      Iterator it = tag.records.iterator();
     
      while (it.hasNext())
      {
        TextRecord tr = (TextRecord)it.next();
        printTextRecord(tr, tag.code);
      }
     
      close(tag);
    }
View Full Code Here

Examples of flash.swf.types.TextRecord

     
      Iterator it = tag.records.iterator();
     
      while (it.hasNext())
      {
        TextRecord tr = (TextRecord)it.next();
        printTextRecord(tr, tag.code);
      }
     
      close(tag);
    }
View Full Code Here

Examples of flash.swf.types.TextRecord

        return e;
    }

    private TextRecord decodeTextRecord(int defineText, int flags, int glyphBits, int advanceBits) throws IOException
    {
        TextRecord t = new TextRecord();

        t.flags = flags;

        if (t.hasFont())
        {
            int idref = r.readUI16();
            t.font = (DefineFont) dict.getTag(idref);
        }

        if (t.hasColor())
        {
            switch (defineText)
            {
            case stagDefineText:
                t.color = decodeRGB(r);
                break;
            case stagDefineText2:
                t.color = decodeRGBA(r);
                break;
            default:
                assert false;
            }
        }

        if (t.hasX())
        {
            t.xOffset = r.readSI16();
        }

        if (t.hasY())
        {
            t.yOffset = r.readSI16();
        }

        if (t.hasHeight())
        {
            t.height = r.readUI16();
        }

        int count = r.readUI8();
View Full Code Here

Examples of flash.swf.types.TextRecord

            // Make sure we don't create empty TextRecords
            // A empty textRecord will crash Flash Player. Player Bug#57644
            if ((line == null) || (line.length() == 0))
                break;

            TextRecord tr = getStyleRecord(fontBuilder, height, color, xOffset,
                    (int)(yOffset +
                    yCount * height *
                    SwfConstants.TWIPS_PER_PIXEL));

            chars = line.toCharArray();
View Full Code Here

Examples of flash.swf.types.TextRecord

            line = reader.readLine();
            // Make sure we don't create empty TextRecords
            // A empty textRecord will crash Flash Player. Player Bug #102948
            if ((line == null) || (line.length() == 0))
                break;
            TextRecord tr = getStyleRecord(fontBuilder, height, color, xOffset, (int)(yOffset + yCount * height * SwfConstants.TWIPS_PER_PIXEL));

            chars = line.toCharArray();
            tr.entries = new GlyphEntry[chars.length];
            for (int i = 0; i < chars.length; i++)
            {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.