Package org.apache.fop.fonts

Examples of org.apache.fop.fonts.MultiByteFont


        }
        if (ttf.isCFF()) {
            throw new UnsupportedOperationException(
                    "OpenType fonts with CFF data are not supported, yet");
        }
        multiFont = new MultiByteFont();
        multiFont.setResolver(this.resolver);
        returnFont = multiFont;

        returnFont.setFontName(ttf.getFamilyName());
        returnFont.setFontSubFamilyName(ttf.getSubFamilyName());
View Full Code Here


                return null;
            } else {
                try {
                    AbstractPDFStream embeddedFont;
                    if (desc.getFontType() == FontType.TYPE0) {
                        MultiByteFont mbfont = (MultiByteFont)font;
                        FontFileReader reader = new FontFileReader(in);

                        TTFSubSetFile subset = new TTFSubSetFile();
                        byte[] subsetFont = subset.readFont(reader,
                                             mbfont.getTTCName(), mbfont.getUsedGlyphs());
                        // Only TrueType CID fonts are supported now

                        embeddedFont = new PDFTTFStream(subsetFont.length);
                        ((PDFTTFStream)embeddedFont).setData(subsetFont, subsetFont.length);
                    } else if (desc.getFontType() == FontType.TYPE1) {
View Full Code Here

                return null;
            } else {
                try {
                    AbstractPDFStream embeddedFont;
                    if (desc.getFontType() == FontType.TYPE0) {
                        MultiByteFont mbfont = (MultiByteFont)font;
                        FontFileReader reader = new FontFileReader(in);

                        TTFSubSetFile subset = new TTFSubSetFile();
                        byte[] subsetFont = subset.readFont(reader,
                                             mbfont.getTTCName(), mbfont.getUsedGlyphs());
                        // Only TrueType CID fonts are supported now

                        embeddedFont = new PDFTTFStream(subsetFont.length);
                        ((PDFTTFStream)embeddedFont).setData(subsetFont, subsetFont.length);
                    } else if (desc.getFontType() == FontType.TYPE1) {
View Full Code Here

                return null;
            } else {
                try {
                    AbstractPDFStream embeddedFont;
                    if (desc.getFontType() == FontType.TYPE0) {
                        MultiByteFont mbfont = (MultiByteFont)font;
                        FontFileReader reader = new FontFileReader(in);

                        TTFSubSetFile subset = new TTFSubSetFile();
                        byte[] subsetFont = subset.readFont(reader,
                                             mbfont.getTTCName(), mbfont.getUsedGlyphs());
                        // Only TrueType CID fonts are supported now

                        embeddedFont = new PDFTTFStream(subsetFont.length);
                        ((PDFTTFStream)embeddedFont).setData(subsetFont, subsetFont.length);
                    } else if (desc.getFontType() == FontType.TYPE1) {
View Full Code Here

    private void buildFont(TTFFile ttf) {
        if (ttf.isCFF()) {
            throw new UnsupportedOperationException(
                    "OpenType fonts with CFF data are not supported, yet");
        }
        multiFont = new MultiByteFont();
        multiFont.setResolver(this.resolver);
        returnFont = multiFont;

        returnFont.setFontName(ttf.getPostScriptName());
        returnFont.setFullName(ttf.getFullName());
View Full Code Here

        if (this.encodingMode == EncodingMode.SINGLE_BYTE) {
            isCid = false;
        }

        if (isCid) {
            multiFont = new MultiByteFont();
            returnFont = multiFont;
            multiFont.setTTCName(ttcFontName);
        } else {
            singleFont = new SingleByteFont();
            returnFont = singleFont;
View Full Code Here

                return null;
            } else {
                try {
                    AbstractPDFStream embeddedFont;
                    if (desc.getFontType() == FontType.TYPE0) {
                        MultiByteFont mbfont = (MultiByteFont)font;
                        FontFileReader reader = new FontFileReader(in);

                        TTFSubSetFile subset = new TTFSubSetFile();
                        subset.readFont(reader, mbfont.getTTCName(), mbfont.getUsedGlyphs());
                        byte[] subsetFont = subset.getFontSubset();
                        // Only TrueType CID fonts are supported now

                        embeddedFont = new PDFTTFStream(subsetFont.length);
                        ((PDFTTFStream)embeddedFont).setData(subsetFont, subsetFont.length);
View Full Code Here

        if (this.encodingMode == EncodingMode.SINGLE_BYTE) {
            isCid = false;
        }

        if (isCid) {
            multiFont = new MultiByteFont();
            returnFont = multiFont;
            multiFont.setTTCName(ttcFontName);
        } else {
            singleFont = new SingleByteFont();
            returnFont = singleFont;
View Full Code Here

    /**
     * Copy advanced typographic information.
     */
    private void copyAdvanced ( TTFFile ttf ) {
        if ( returnFont instanceof MultiByteFont ) {
            MultiByteFont mbf = (MultiByteFont) returnFont;
            mbf.setGDEF ( ttf.getGDEF() );
            mbf.setGSUB ( ttf.getGSUB() );
            mbf.setGPOS ( ttf.getGPOS() );
        }
    }
View Full Code Here

        FontFileReader reader = new FontFileReader(in);
        boolean supported = ttf.readFont(reader, null);
        if (!supported) {
            throw new IOException("Could not load TrueType font: " + fontFileURI);
        }
        multiFont = new MultiByteFont();
        multiFont.setResolver(this.resolver);
        returnFont = multiFont;
        read();       
    }
View Full Code Here

TOP

Related Classes of org.apache.fop.fonts.MultiByteFont

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.