class PdfFont implements Comparable {


    /**
     * an image.
     */
    protected Image image;
    protected float hScale = 1;
    /**
     * the font metrics.
     */
    private BaseFont font;
    /**
     * the size.
     */
    private float size;

    // constructors

    PdfFont(BaseFont bf, float size) {
        this.size = size;
        font = bf;
    }

    // methods

    static PdfFont getDefaultFont() {
        try {
            BaseFont bf = BaseFont.createFont(BaseFont.HELVETICA, BaseFont.WINANSI, false);
            return new PdfFont(bf, 12);
        } catch (Exception ee) {
            throw new ExceptionConverter(ee);
        }
    }

    /**
     * Compares this <CODE>PdfFont</CODE> with another
     *
     * @param object the other <CODE>PdfFont</CODE>
     * @return a value
     */

    public int compareTo(Object object) {<FILL_FUNCTION_BODY>}

    /**
     * Returns the size of this font.
     *
     * @return a size
     */

    float size() {
        if (image == null) {
            return size;
        } else {
            return image.getScaledHeight();
        }
    }

    /**
     * Returns the approximative width of 1 character of this font.
     *
     * @return a width in Text Space
     */

    float width() {
        return width(' ');
    }

    /**
     * Returns the width of a certain character of this font.
     *
     * @param character a certain character
     * @return a width in Text Space
     */

    float width(int character) {
        if (image == null) {
            return font.getWidthPoint(character, size) * hScale;
        } else {
            return image.getScaledWidth();
        }
    }

    float width(String s) {
        if (image == null) {
            return font.getWidthPoint(s, size) * hScale;
        } else {
            return image.getScaledWidth();
        }
    }

    BaseFont getFont() {
        return font;
    }

    void setImage(Image image) {
        this.image = image;
    }

    void setHorizontalScaling(float hScale) {
        this.hScale = hScale;
    }
}

        if (image != null) {
            return 0;
        }
        if (object == null) {
            return -1;
        }
        PdfFont pdfFont;
        try {
            pdfFont = (PdfFont) object;
            if (font != pdfFont.font) {
                return 1;
            }
            if (this.size() != pdfFont.size()) {
                return 2;
            }
            return 0;
        } catch (ClassCastException cce) {
            return -2;
        }
    
<no_super_class>