Package org.axsl.font

Examples of org.axsl.font.FontException


            charIndex = this.charSet.getIndex(theChar);
        }
        final short[] extentTable = this.getExtentTable();
        if (charIndex < 0
                || charIndex > extentTable.length) {
            throw new FontException("Cannot encode glyph name: " + this.glyphName + " at line: "
                    + this.currentLineNumber);
        }
        extentTable[charIndex] = this.charWidth;
        if (this.glyphIndex > -1) {
            /* Accumulate the information needed to create the internal
View Full Code Here


        final XMLSerializer serializer = new XMLSerializer();
        serializer.setOutputByteStream(tempOut);
        try {
            serializer.serialize(document);
        } catch (final IOException e) {
            throw new FontException("Error serializing DOM: " + e.getMessage());
        }
        final byte[] serializedDOM = tempOut.toByteArray();

        /* Pretty print. */
        final ByteArrayInputStream inputStream = new ByteArrayInputStream(
                serializedDOM);
        final InputSource prettyInput = new InputSource(inputStream);
        final FOrayPretty pretty = new FOrayPretty(prettyInput, output,
                null);
        try {
            pretty.start();
        } catch (final IOException e) {
            throw new FontException(e);
        } catch (final SAXException e) {
            throw new FontException(e);
        } catch (final ParserConfigurationException e) {
            throw new FontException(e);
        }
    }
View Full Code Here

    public void write(final File file) throws FontException {
        FileOutputStream output = null;
        try {
            output = new FileOutputStream(file);
        } catch (final FileNotFoundException e) {
            throw new FontException(e);
        }
        this.write(output);
    }
View Full Code Here

        if (fontSelected == null) {
            /* None of the requested font-family items can provide a suitable
             * font. */
            final FontUse4a fontUse = getDefaultFontUse();
            if (fontUse == null) {
                throw new FontException("Unable to provide even a default "
                        + "font.");
            }
            return fontUse;
        }
        final ConsumerFont4a consumerFont = registerFontUse(fontSelected);
View Full Code Here

     * @throws FontException If the encoding latitude is not valid.
     */
    public void setEncodingLatitude(final int encodingLatitude)
            throws FontException {
        if (! validEncodingLatitude(encodingLatitude)) {
            throw new FontException("FOrayFontConsumer invalid encoding "
                    + "latitude: " + encodingLatitude);
        }
        this.encodingLatitude = (byte) encodingLatitude;
    }
View Full Code Here

     */
    public void parseFont() throws FontException {
        try {
            this.metricsFile = this.getMetricsFile();
        } catch (final IOException e) {
            throw new FontException(e);
        }
        this.setFontComplexity(Font.Complexity.SIMPLE);
        this.setPostscriptName(this.metricsFile.getPostscriptName());
        this.setFontName(this.metricsFile.getFontName());
        this.setFamilyName(this.metricsFile.getFontFamilyName());
View Full Code Here

        if (serializedMetricsFile == null) {
            final MetricsFileReader reader = this.getRegisteredFont()
                    .getMetricsFileReader();
            metricsFile = reader.metricsFileFactory();
            if (metricsFile == null) {
                throw new FontException("Unknown Metric Format: "
                        + reader.getDescription());
            }
            if (metricsFile.getInternalEncoding() == null) {
                throw new FontException("Unusable Internal Encoding: "
                        + reader.getDescription());
            }
            return metricsFile;
        } else {
            try {
                metricsFile = deserializeMetricsFile();
            } catch (final IOException e) {
                throw new FontException(e);
            } catch (final ClassNotFoundException e) {
                throw new FontException(e);
            }
        }
        return metricsFile;
    }
View Full Code Here

        case OTF_CFF:
        case OTF_TRUETYPE: {
            return new FSTrueTypeFont(this);
        }
        }
        throw new FontException("Font " + this.configuredFontName
                + " is an unknown format.");
    }
View Full Code Here

        description.setSimulateStretch(simulatedStretch);
        for (int i = 0; i < this.fontDescriptions.size(); i++) {
            final RegisteredFontDesc registeredDesc
                    = this.fontDescriptions.get(i);
            if (description.equivalent(registeredDesc)) {
                throw new FontException("Equivalent font-description "
                        + "already exists in font-family \""
                        + this.name + "\":\n"
                        + "font-style "
                        + description.getFontStyle().getFoValue()
                        + " font-weight "
View Full Code Here

        }
        InputStream inputStream;
        try {
            inputStream = fontConfigURL.openStream();
        } catch (final IOException e) {
            throw new FontException(e.getMessage());
        }
        final InputSource source = new InputSource(inputStream);
        final ConfigParser parser =
            new ConfigParser(this, source);
        parser.start();
        if (this.hasFatalConfigurationError) {
            throw new FontException("Font Configuration has fatal error(s).");
        }
    }
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.