Package org.axsl.font

Examples of org.axsl.font.FontException


    protected RegisteredFontFamily registerFontFamily2(final String name)
            throws FontException {
        /* Make sure it is not already registered. */
        RegisteredFontFamily rff = this.getRegisteredFontFamily(name);
        if (rff != null) {
            throw new FontException("font-family already registered: "
                    + name);
        }
        rff = new RegisteredFontFamily(this, name);
        this.fontFamilies.put(name, rff);
        return rff;
View Full Code Here


    public void registerFontFamilyAlias(final String alias,
            final String realFamily)
            throws FontException {
        final RegisteredFontFamily rff = this.fontFamilies.get(realFamily);
        if (rff == null) {
            throw new FontException("Font family " + realFamily
                    + " not found. Can't register alias: " + alias);
        }
        if (this.fontFamilyAliases.containsKey(alias)) {
            final RegisteredFontFamily family = this.fontFamilyAliases.get(
                    alias);
            throw new FontException("Alias " + alias
                    + " already registered to family " + family.getName());
        }
        this.fontFamilyAliases.put(alias, rff);
    }
View Full Code Here

        FontFileReader fontFileReader = null;
        if (fontFileURL != null) {
            try {
                fontFileReader = new FontFileReader(this, fontFileURL);
            } catch (final IOException e) {
                throw new FontException(e);
            }
        }
        MetricsFileReader metricsFileReader = null;
        if (metricsFileURL != null) {
            try {
                metricsFileReader = new MetricsFileReader(this, metricsFileURL);
            } catch (final IOException e) {
                throw new FontException(e);
            }
        }
        new RegisteredFont(this, fontID,
                fontFileReader, metricsFileReader, collectionID, embed,
                systemName);
View Full Code Here

        FontFileReader fontFileReader = null;
        if (fontFileContents != null) {
            try {
                fontFileReader = new FontFileReader(this, fontFileDescription, fontFileContents);
            } catch (final IOException e) {
                throw new FontException(e);
            }
        }
        MetricsFileReader metricsFileReader = null;
        if (metricsFileContents != null) {
            try {
                metricsFileReader = new MetricsFileReader(this, metricsFileDescription, metricsFileContents);
            } catch (final IOException e) {
                throw new FontException(e);
            }
        }
        new RegisteredFont(this, fontID,
                fontFileReader, metricsFileReader, collectionID, embed,
                systemName);
View Full Code Here

     */
    public void registerFont(final String fontID, final RegisteredFont rf)
            throws FontException {
        final Object object = this.registeredFonts.get(fontID);
        if (object != null) {
            throw new FontException("Font ID already registered: " + fontID);
        }
        this.registeredFonts.put(fontID, rf);
    }
View Full Code Here

     */
    public void registerFontSelectorFactory(final String name,
            final FontSelectorFactory factory) throws FontException {
        if (name == null
                || factory == null) {
            throw new FontException("Unable to register null or unnamed "
                    + "FontSelectorFactory.");
        }
        this.registeredFontSelectorFactories.put(name, factory);
    }
View Full Code Here

            parser.parse(this.filename);
        } catch (final SAXException e) {
            if (e.getException() instanceof FontException) {
                throw (FontException) e.getException();
            }
            throw new FontException(e);
        } catch (final IOException e) {
            throw new FontException(e);
        }
    }
View Full Code Here

            xmlReader.setEntityResolver(entityResolver);
            getLogger().debug("Font Config: Using "
                    + xmlReader.getClass().getName() + " as SAX2 Parser");
            return xmlReader;
        } catch (final javax.xml.parsers.ParserConfigurationException e) {
            throw new FontException(e);
        } catch (final org.xml.sax.SAXException e) {
            throw new FontException(e);
        }
    }
View Full Code Here

        /*
         * Check that the returned awt font really corresponds to this font,
         * and not to a fallback
         */
        if (!returnedFont.getPSName().equals(fsf.getPostscriptName())) {
            throw new FontException("Cannot find a system font for "
                    + fsf.getFontName());
        }
        return returnedFont;
     }
View Full Code Here

        InputStream fontStream = null;
        try {
            fontStream = fontFileReader.getInputStream();
            newFont = Font.createFont(fontFormat, fontStream);
        } catch (final IOException e) {
            throw new FontException("Error reading input stream for: \n  "
                    + fontFileReader.getDescription(), e);
        } catch (final IllegalArgumentException iae) {
            /* Ignore this. This just means that the fontFormat is not one that
             * java recognizes, probably because the runtime is lower than
             * java 1.5. The proper things to do is just return null.*/
        } catch (final FontFormatException ffe) {
            throw new FontException(ffe);
        } finally {
            if (fontStream != null) {
                try {
                    fontStream.close();
                } catch (final IOException ex) {
View Full Code Here

TOP

Related Classes of org.axsl.font.FontException

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.