Examples of CMap


Examples of com.sun.pdfview.font.ttf.CMap

    private boolean fixCMapTable (TrueTypeFont ttf, CmapTable cmap) {
        CMapFormat4 fourMap = null;
        CMapFormat0 zeroMap = null;

        for (int i = 0; i < mapIDs.length; i += 2) {
            CMap map = this.cmapTable.getCMap (mapIDs[i], mapIDs[i + 1]);
            if (map != null) {
                if (fourMap == null && map instanceof CMapFormat4) {
                    fourMap = (CMapFormat4) map;
                } else if (zeroMap == null && map instanceof CMapFormat0) {
                    zeroMap = (CMapFormat0) map;
View Full Code Here

Examples of com.sun.pdfview.font.ttf.CMap

        if (cmap == null) {
            return null;
        }

        // try maps in required order of (3, 1), (1, 0)
        CMap map = cmap.getCMap ((short) 3, (short) 1);
        if (map == null) {
            map = cmap.getCMap ((short) 1, (short) 0);
        }
        int idx = map.map (val);
        if (idx != 0) {
            return getOutline (idx, width);
        }

        return null;
View Full Code Here

Examples of org.apache.fontbox.cmap.CMap

        checkCIDSystemInfo(sysinfo);

        try
        {
            // extract information from the CMap stream
            CMap fontboxCMap = new CMapParser().parse(aCMap.getUnfilteredStream());
            int wmValue = fontboxCMap.getWMode();
            String cmnValue = fontboxCMap.getName();

            /*
             * According to the getInt javadoc, -1 is returned if there are no result. In the PDF Reference v1.7 p449,
             * we can read that Default value is 0.
             */
 
View Full Code Here

Examples of org.apache.fontbox.cmap.CMap

            // try to find the corresponding Unicode (UC2) CMap
            if (cMapName != null && !cMapName.equals("Identity-H") &&
                                    !cMapName.equals("Identity-V"))
            {
                CMap cMap = CMapManager.getPredefinedCMap(cMapName);
                if (cMap != null)
                {
                    String ucs2Name = cMap.getRegistry() + "-" + cMap.getOrdering() + "-UCS2";
                    CMap ucs2CMap = CMapManager.getPredefinedCMap(ucs2Name);
                    if (ucs2CMap != null)
                    {
                        cMapUCS2 = ucs2CMap;
                    }
                }
View Full Code Here

Examples of org.apache.fontbox.cmap.CMap

    }

    @Override
    public int codeToCID(int code)
    {
        CMap cMap = parent.getCMap();

        // Acrobat allows bad PDFs to use Unicode CMaps here instead of CID CMaps, see PDFBOX-1283
        if (!cMap.hasCIDMappings() && cMap.hasUnicodeMappings())
        {
            return cMap.toUnicode(code).codePointAt(0); // actually: code -> CID
        }

        return cMap.toCID(code);
    }
View Full Code Here

Examples of org.apache.fontbox.cmap.CMap

     *
     * @param cMapName CMap name
     */
    public static CMap getPredefinedCMap(String cMapName) throws IOException
    {
        CMap cmap = cMapCache.get(cMapName);
        if (cmap != null)
        {
            return cmap;
        }

        CMapParser parser = new CMapParser();
        CMap targetCmap = parser.parsePredefined(cMapName);

        // limit the cache to predefined CMaps
        cMapCache.put(targetCmap.getName(), targetCmap);
        return targetCmap;
    }
View Full Code Here

Examples of org.apache.fontbox.cmap.CMap

     * @param cMapStream the CMap to be read
     * @return the parsed CMap
     */
    public static CMap parseCMap(InputStream cMapStream) throws IOException
    {
        CMap targetCmap = null;
        if (cMapStream != null)
        {
            CMapParser parser = new CMapParser();
            targetCmap = parser.parse(cMapStream);
        }
View Full Code Here

Examples of org.apache.fontbox.cmap.CMap

        checkCIDSystemInfo(sysinfo);

        try
        {
            // extract information from the CMap stream
            CMap fontboxCMap = new CMapParser().parse(null, aCMap.getUnfilteredStream());
            int wmValue = fontboxCMap.getWMode();
            String cmnValue = fontboxCMap.getName();

            /*
             * According to the getInt javadoc, -1 is returned if there are no result. In the PDF Reference v1.7 p449,
             * we can read that Default value is 0.
             */
 
View Full Code Here

Examples of org.apache.fontbox.cmap.CMap

        return retval;
    }

    protected CMap parseCmap( String cmapRoot, InputStream cmapStream)
    {
        CMap targetCmap = null;
        if( cmapStream != null )
        {
            CMapParser parser = new CMapParser();
            try
            {
                targetCmap = parser.parse( cmapRoot, cmapStream );
                // limit the cache to external CMaps
                if (cmapRoot != null)
                {
                    cmapObjects.put( targetCmap.getName(), targetCmap );
                }
            }
            catch (IOException exception) {}
        }
        return targetCmap;
View Full Code Here

Examples of org.apache.fontbox.cmap.CMap

        return retval;
    }

    protected CMap parseCmap( String cmapRoot, InputStream cmapStream)
    {
        CMap targetCmap = null;
        if( cmapStream != null )
        {
            CMapParser parser = new CMapParser();
            try
            {
                targetCmap = parser.parse( cmapRoot, cmapStream );
                // limit the cache to external CMaps
                if (cmapRoot != null)
                {
                    cmapObjects.put( targetCmap.getName(), targetCmap );
                }
            }
            catch (IOException exception)
            {
                LOG.error("An error occurs while reading a CMap", exception);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.