Package org.apache.flex.swf.types

Examples of org.apache.flex.swf.types.TextRecord


        final int advanceBits = bitStream.readUI8();
        final ArrayList<TextRecord> textRecords = new ArrayList<TextRecord>();

        while (true)
        {
            final TextRecord textRecord = readTextRecord(tagType, glyphBits, advanceBits);
            if (textRecord == null)
                break;
            textRecords.add(textRecord);
        }
View Full Code Here


        if (!textRecordType)
            return null;

        bitStream.readUB(3); // reserved

        final TextRecord textRecord = new TextRecord();
        textRecord.setStyleFlagsHasFont(bitStream.readBit());
        textRecord.setStyleFlagsHasColor(bitStream.readBit());
        textRecord.setStyleFlagsHasYOffset(bitStream.readBit());
        textRecord.setStyleFlagsHasXOffset(bitStream.readBit());

        if (textRecord.isStyleFlagsHasFont())
        {
            final int fontId = bitStream.readUI16();
            final ICharacterTag fontTag = getTagById(fontId, type);
            textRecord.setFontTag(fontTag);
        }

        if (textRecord.isStyleFlagsHasColor())
        {
            if (type == TagType.DefineText2)
            {
                textRecord.setTextColor(readRGBA());
            }
            else
            {
                textRecord.setTextColor(readRGB());
            }
        }

        if (textRecord.isStyleFlagsHasXOffset())
        {
            textRecord.setxOffset(bitStream.readSI16());
        }

        if (textRecord.isStyleFlagsHasYOffset())
        {
            textRecord.setyOffset(bitStream.readSI16());
        }

        if (textRecord.isStyleFlagsHasFont())
        {
            textRecord.setTextHeight(bitStream.readUI16());
        }

        textRecord.setGlyphCount(bitStream.readUI8());

        final GlyphEntry[] glyphEntries = new GlyphEntry[textRecord.getGlyphCount()];
        for (int i = 0; i < textRecord.getGlyphCount(); i++)
        {
            glyphEntries[i] = readGlyphEntry(glyphBits, advanceBits);
        }
        textRecord.setGlyphEntries(glyphEntries);

        return textRecord;
    }
View Full Code Here

TOP

Related Classes of org.apache.flex.swf.types.TextRecord

Copyright © 2018 www.massapicom. 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.