⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fsdefinefont2.java

📁 利用opensource的开源jar实现生成flash文件
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
        small = aBool;
    }
// End Flash 7

    /** Is the font italicised.

        @return a boolean indicating whether the font is rendered in italics.
        */
    public boolean isItalic() 
    {
        return italic;
    }

    /** Is the font bold.

        @return a boolean indicating whether the font is rendered in a bold face.
        */
    public boolean isBold() 
    {
        return bold;
    }

// Flash 6
    /** Gets the language code identifying the type of spoken language for the font
     *  either FSText.Japanese, FSText.Korean, FSText.Latin, FSText.SimplifiedChinese 
     *  or FSText.TraditionalChinese.
     * 
     *  @return the language code used to determine how line-breaks are inserted 
     *  into text rendered using the font. Returns 0 if the object was decoded 
     *  from a movie contains Flash 5 or less.
     */
    public int getLanguage()
    {
        return language;
    }

    /** Sets the language code used to determine the position of line-breaks in 
     *  text rendered using the font.
     * 
     *  NOTE: The language attribute is ignored if the object is encoded in a Flash 5 movie.
     * 
     *  @param code the code identifying the spoken language either FSText.Japanese, 
     * FSText.Korean, FSText.Latin, FSText.SimplifiedChinese or FSText.TraditionalChinese.
     */
    public void setLanguage(int code)
    {
        language = code;
    }
// End Flash 6

    /** Gets the name of the font family.

        @return the name of the font.
        */
    public String getName()
    {
        return name; 
    }

    /** Gets the array of shapes used to define the outlines of each font glyph.

        @return an array of FSShape objects
        */
    public ArrayList getShapes()
    {
        return shapes;
    }

    /** Gets the array of codes used to identify each glyph in the font. The ordinal position of each Integer representing a code identifies a particular glyph in the shapes array.

        @return an array of Integer objects that contain the character codes for each glyph in the font.
        */
    public ArrayList getCodes()
    {
        return codes;
    }

    /** Gets the ascent for the font in twips.

        @return the ascent for the font.
        */
    public int getAscent()
    {
        return ascent;
    }

    /** Gets the descent for the font in twips.

        @return the descent for the font.
        */
    public int getDescent()
    {
        return descent;
    }

    /** Gets the leading for the font in twips.

        @return the leading for the font.
        */
    public int getLeading()
    {
        return leading;
    }

    /** Gets the array of advances defined for each glyph in the font.

        @return an array of Integer objects that contain the advance for each glyph in the font.
        */
    public ArrayList getAdvances()
    {
        return advances;
    }

    /** Gets the array of bounding rectangles defined for each glyph in the font.

        @return an array of FSBounds objects.
        */
    public ArrayList getBounds()
    {
        return bounds;
    }

    /** Gets the array of kerning records that define the spacing between glyph pairs.

        @return an array of FSKerning objects that define the spacing adjustment between pairs of glyphs.
        */
    public ArrayList getKernings()
    {
        return kernings;
    }

    /** Sets the encoding for the font character codes.

        @param aType the encoding scheme used to denote characters, either FSText.ASCII, FSText.SJIS or FSText.Unicode.
        */
    public void setEncoding(int aType)
    {
        encoding = aType;
    }

    /** Set the font is italicised.

        @param aBool a boolean flag indicating whether the font will be rendered in italics */
    public void setItalic(boolean aBool)
    {
        italic = aBool;
    }

    /** Set the font is bold.

        @param aBool a boolean flag indicating whether the font will be rendered in bold face.
        */
    public void setBold(boolean aBool)
    {
        bold = aBool;
    }

    /** Set the name of the font.

        @param aString the name assigned to the font, identifying the font family.
        */
    public void setName(String aString)
    {
        name = aString;
    }

    /** Set the array of shape records that define the outlines of the characters used from the font.

        @param anArray an array of FSShape objects that define the glyphs for the font.
        */
    public void setShapes(ArrayList anArray)
    {
        shapes = anArray;
    }

    /** Sets the codes used to identify each glyph in the font.

        @param anArray sets the code table that maps a particular glyph to a character code.
        */
    public void setCodes(ArrayList anArray)
    {
        codes = anArray;
    }

    /** Sets the ascent for the font in twips.

        @param aNumber the ascent for the font.
        */
    public void setAscent(int aNumber)
    {
        ascent = aNumber;
    }

    /** Sets the descent for the font in twips.

        @param aNumber the descent for the font.
        */
    public void setDescent(int aNumber)
    {
        descent = aNumber;
    }

    /** Sets the leading for the font in twips.

        @param aNumber the descent for the font.
        */
    public void setLeading(int aNumber)
    {
        leading = aNumber;
    }

    /** Sets the array of advances for each glyph in the font.

        @param anArray of Integer objects that define the spacing between glyphs.
        */
    public void setAdvances(ArrayList anArray)
    {
        advances = anArray;
    }

    /** Sets the array of bounding rectangles for each glyph in the font.

        @param anArray an array of FSBounds objects that define the bounding rectangles that enclose each glyph in the font.
        */
    public void setBounds(ArrayList anArray)
    {
        bounds = anArray;
    }

    /** Sets the array of kerning records for pairs of glyphs in the font.

        @param anArray an array of FSKerning objects that define an adjustment applied to the spacing between pairs of glyphs.
        */
    public void setKernings(ArrayList anArray)
    {
        kernings = anArray;
    }

    public Object clone()
    {    
        FSDefineFont2 anObject = (FSDefineFont2)super.clone();
        
        anObject.shapes = new ArrayList();
            
        for (Iterator i = shapes.iterator(); i.hasNext();)
            anObject.shapes.add(((FSShape)i.next()).clone());

        anObject.codes = new ArrayList();
            
        for (Iterator i = codes.iterator(); i.hasNext();)
            anObject.codes.add(new Integer(((Integer)i.next()).intValue()));

        if (advances != null)
        {
            anObject.advances = new ArrayList();
            
            for (Iterator i = advances.iterator(); i.hasNext();)
                anObject.advances.add(new Integer(((Integer)i.next()).intValue()));
        }

        if (bounds != null)
        {
            anObject.bounds = new ArrayList();
            
            for (Iterator i = bounds.iterator(); i.hasNext();)
                anObject.bounds.add(((FSBounds)i.next()).clone());
        }

        if (kernings != null)
        {
            anObject.kernings = new ArrayList();
            
            for (Iterator i = kernings.iterator(); i.hasNext();)
                anObject.kernings.add(((FSKerning)i.next()).clone());
        }
                
        return anObject;
    }

    public boolean equals(Object anObject)
    {
        boolean result = false;
        
        if (super.equals(anObject))
        {
            FSDefineFont2 typedObject = (FSDefineFont2)anObject;
            
            result = encoding == typedObject.encoding;
// Flash 7
            result = result && small == typedObject.small;
// End Flash 7
            result = result && italic == typedObject.italic;
            result = result && bold == typedObject.bold;
// Flash 6
            result = result && language == typedObject.language;
// End Flash 6

            if (name != null)
                result = result && name.equals(typedObject.name);
            else
                result = result && name == typedObject.name;

            if (shapes != null)
                result = result && shapes.equals(typedObject.shapes);
            else
                result = result && shapes == typedObject.shapes;

            if (codes != null)
                result = result && codes.equals(typedObject.codes);
            else
                result = result && codes == typedObject.codes;
            

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -