Package org.apache.fontbox.ttf

Examples of org.apache.fontbox.ttf.CMAPTable


            }
            catch(IOException exception)
            {
                log.error("Can't read the true type font", exception);
            }
            CMAPTable cmapTable = trueTypeFont.getCMAP();
            if (cmapTable != null)
            {
                // get all relevant CMaps
                CMAPEncodingEntry[] cmaps = cmapTable.getCmaps();
                for (int i = 0; i < cmaps.length; i++)
                {
                    if (CMAPTable.PLATFORM_WINDOWS == cmaps[i].getPlatformId())
                    {
                        if (CMAPTable.ENCODING_UNICODE == cmaps[i].getPlatformEncodingId())
View Full Code Here


            //hmm there does not seem to be a clear definition for StemV,
            //this is close enough and I am told it doesn't usually get used.
            fd.setStemV( (fd.getFontBoundingBox().getWidth() * .13f) );

            CMAPTable cmapTable = ttf.getCMAP();
            CMAPEncodingEntry[] cmaps = cmapTable.getCmaps();
            CMAPEncodingEntry uniMap = null;
           
            for( int i=0; i<cmaps.length; i++ )
            {
                if( cmaps[i].getPlatformId() == CMAPTable.PLATFORM_WINDOWS)
View Full Code Here

            }
            catch(IOException exception)
            {
                log.error("Can't read the true type font", exception);
            }
            CMAPTable cmapTable = trueTypeFont.getCMAP();
            if (cmapTable != null)
            {
                // get all relevant CMaps
                CMAPEncodingEntry[] cmaps = cmapTable.getCmaps();
                for (int i = 0; i < cmaps.length; i++)
                {
                    if (CMAPTable.PLATFORM_WINDOWS == cmaps[i].getPlatformId())
                    {
                        if (CMAPTable.ENCODING_UNICODE == cmaps[i].getPlatformEncodingId())
View Full Code Here

            //hmm there does not seem to be a clear definition for StemV,
            //this is close enough and I am told it doesn't usually get used.
            fd.setStemV( (fd.getFontBoundingBox().getWidth() * .13f) );


            CMAPTable cmapTable = ttf.getCMAP();
            CMAPEncodingEntry[] cmaps = cmapTable.getCmaps();
            int[] glyphToCCode = null;
            for( int i=0; i<cmaps.length; i++ )
            {
                if( cmaps[i].getPlatformId() == CMAPTable.PLATFORM_WINDOWS &&
                    cmaps[i].getPlatformEncodingId() == CMAPTable.ENCODING_UNICODE )
View Full Code Here

            //hmm there does not seem to be a clear definition for StemV,
            //this is close enough and I am told it doesn't usually get used.
            fd.setStemV( (fd.getFontBoundingBox().getWidth() * .13f) );


            CMAPTable cmapTable = ttf.getCMAP();
            CMAPEncodingEntry[] cmaps = cmapTable.getCmaps();
            int[] glyphToCCode = null;
            for( int i=0; i<cmaps.length; i++ )
            {
                if( cmaps[i].getPlatformId() == CMAPTable.PLATFORM_WINDOWS &&
                    cmaps[i].getPlatformEncodingId() == CMAPTable.ENCODING_UNICODE )
View Full Code Here

            //hmm there does not seem to be a clear definition for StemV,
            //this is close enough and I am told it doesn't usually get used.
            fd.setStemV( (fd.getFontBoundingBox().getWidth() * .13f) );

            CMAPTable cmapTable = ttf.getCMAP();
            CMAPEncodingEntry[] cmaps = cmapTable.getCmaps();
            CMAPEncodingEntry uniMap = null;
           
            for( int i=0; i<cmaps.length; i++ )
            {
                if( cmaps[i].getPlatformId() == CMAPTable.PLATFORM_WINDOWS)
View Full Code Here

            //hmm there does not seem to be a clear definition for StemV,
            //this is close enough and I am told it doesn't usually get used.
            fd.setStemV( (fd.getFontBoundingBox().getWidth() * .13f) );


            CMAPTable cmapTable = ttf.getCMAP();
            CMAPEncodingEntry[] cmaps = cmapTable.getCmaps();
            int[] glyphToCCode = null;
            for( int i=0; i<cmaps.length; i++ )
            {
                if( cmaps[i].getPlatformId() == CMAPTable.PLATFORM_WINDOWS &&
                    cmaps[i].getPlatformEncodingId() == CMAPTable.ENCODING_UNICODE )
View Full Code Here

        TTFParser parser = new TTFParser();

        TrueTypeFont arial = parser.parse(arialIs);

        CmapTable cmapTable = arial.getCmap();
        Assert.assertNotNull(cmapTable);

        CmapSubtable[] cmaps = cmapTable.getCmaps();
        Assert.assertNotNull(cmaps);

        CmapSubtable cmap = null;

        for (CmapSubtable e : cmaps)
View Full Code Here

        // hmm there does not seem to be a clear definition for StemV,
        // this is close enough and I am told it doesn't usually get used.
        fd.setStemV(fd.getFontBoundingBox().getWidth() * .13f);

        CmapTable cmapTable = ttf.getCmap();
        CmapSubtable uniMap = cmapTable.getSubtable(CmapTable.PLATFORM_UNICODE,
                CmapTable.ENCODING_UNICODE_2_0_FULL);
        if (uniMap == null)
        {
            uniMap = cmapTable.getSubtable(CmapTable.PLATFORM_UNICODE,
                    CmapTable.ENCODING_UNICODE_2_0_BMP);
        }
        if (uniMap == null)
        {
            uniMap = cmapTable.getSubtable(CmapTable.PLATFORM_WINDOWS,
                    CmapTable.ENCODING_WIN_UNICODE);
        }
        if (uniMap == null)
        {
            // Microsoft's "Recommendations for OpenType Fonts" says that "Symbol" encoding
            // actually means "Unicode, non-standard character set"
            uniMap = cmapTable.getSubtable(CmapTable.PLATFORM_WINDOWS,
                    CmapTable.ENCODING_WIN_SYMBOL);
        }
        if (uniMap == null)
        {
            // there should always be a usable cmap, if this happens we haven't tried hard enough
            // to find one. Furthermore, if we loaded the font from disk then we should've checked
            // first to see that it had a suitable cmap before calling createFontDescriptor
            throw new IllegalArgumentException("ttf: no suitable cmap for font '" +
                    ttf.getNaming().getFontFamily() + "', found: " +
                    Arrays.toString(cmapTable.getCmaps()));
        }

        if (this.getFontEncoding() == null)
        {
            // todo: calling this.getFontEncoding() doesn't work if the font is loaded
View Full Code Here

        if (cmapInitialized)
        {
            return;
        }

        CmapTable cmapTable = ttf.getCmap();
        if (cmapTable != null)
        {
            // get all relevant "cmap" subtables
            CmapSubtable[] cmaps = cmapTable.getCmaps();
            for (CmapSubtable cmap : cmaps)
            {
                if (CmapTable.PLATFORM_WINDOWS == cmap.getPlatformId())
                {
                    if (CmapTable.ENCODING_WIN_UNICODE == cmap.getPlatformEncodingId())
View Full Code Here

TOP

Related Classes of org.apache.fontbox.ttf.CMAPTable

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.