Package org.apache.fontbox.afm

Examples of org.apache.fontbox.afm.CharMetric


            widths.add(zero);
        }

        while (iter.hasNext())
        {
            CharMetric m = iter.next();
            int n = m.getCharacterCode();
            if (n > 0)
            {
                firstchar = Math.min(firstchar, n);
                lastchar = Math.max(lastchar, n);
                if (m.getWx() > 0)
                {
                    int width = Math.round(m.getWx());
                    widths.set(n, width);
                }
            }
        }
        dict.setInt(COSName.FIRST_CHAR, 0);
View Full Code Here


        {
            widths.add((float)zero);
        }
        while (iter.hasNext())
        {
            CharMetric m = iter.next();
            int n = m.getCharacterCode();
            if (n > 0)
            {
                firstchar = Math.min(firstchar, n);
                lastchar = Math.max(lastchar, n);
                if (m.getWx() > 0)
                {
                    int width = Math.round(m.getWx());
                    widths.set(n, (float)width);
                    // germandbls has 2 character codes !! Don't ask me why .....
                    // StandardEncoding = 0373 = 251
                    // WinANSIEncoding = 0337 = 223
                    if (m.getName().equals("germandbls") && n != 223)
                    {
                        widths.set(0337, (float)width);
                    }
                }
            }
            else
            {
                // my AFMPFB-Fonts has no character-codes for german umlauts
                // so that I've to add them here by hand
                if (m.getName().equals("adieresis"))
                {
                    widths.set(0344, widths.get(encoding.getCode("a")));
                }
                else if (m.getName().equals("odieresis"))
                {
                    widths.set(0366, widths.get(encoding.getCode("o")));
                }
                else if (m.getName().equals("udieresis"))
                {
                    widths.set(0374, widths.get(encoding.getCode("u")));
                }
                else if (m.getName().equals("Adieresis"))
                {
                    widths.set(0304, widths.get(encoding.getCode("A")));
                }
                else if (m.getName().equals("Odieresis"))
                {
                    widths.set(0326, widths.get(encoding.getCode("O")));
                }
                else if (m.getName().equals("Udieresis"))
                {
                    widths.set(0334, widths.get(encoding.getCode("U")));
                }
            }
        }
View Full Code Here

        {
            widths.add(zero);
        }
        while (iter.hasNext())
        {
            CharMetric m = iter.next();
            int n = m.getCharacterCode();
            if (n > 0)
            {
                firstchar = Math.min(firstchar, n);
                lastchar = Math.max(lastchar, n);
                if (m.getWx() > 0)
                {
                    float width = m.getWx();
                    widths.set(n,new Float(width));
                    // germandbls has 2 character codes !! Don't ask me why .....
                    // StandardEncoding = 0373 = 251
                    // WinANSIEncoding = 0337 = 223
                    if (m.getName().equals("germandbls") && n != 223)
                    {
                        widths.set(0337,new Float(width));
                    }
                }
            }
            else
            {
                // my AFMPFB-Fonts has no character-codes for german umlauts
                // so that I've to add them here by hand
                if (m.getName().equals("adieresis"))
                {
                    widths.set(0344,(Float)widths.get(encoding.getCode("a")));
                }
                else if (m.getName().equals("odieresis"))
                {
                    widths.set(0366,(Float)widths.get(encoding.getCode("o")));
                }
                else if (m.getName().equals("udieresis"))
                {
                    widths.set(0374,(Float)widths.get(encoding.getCode("u")));
                }
                else if (m.getName().equals("Adieresis"))
                {
                    widths.set(0304,(Float)widths.get(encoding.getCode("A")));
                }
                else if (m.getName().equals("Odieresis"))
                {
                    widths.set(0326,(Float)widths.get(encoding.getCode("O")));
                }
                else if (m.getName().equals("Udieresis"))
                {
                    widths.set(0334,(Float)widths.get(encoding.getCode("U")));
                }
            }
        }
View Full Code Here

        {
            widths.add(zero);
        }
        while (iter.hasNext())
        {
            CharMetric m = iter.next();
            int n = m.getCharacterCode();
            if (n > 0)
            {
                firstchar = Math.min(firstchar, n);
                lastchar = Math.max(lastchar, n);
                if (m.getWx() > 0)
                {
                    float width = m.getWx();
                    widths.set(n,new Float(width));
                    // germandbls has 2 character codes !! Don't ask me why .....
                    // StandardEncoding = 0373 = 251
                    // WinANSIEncoding = 0337 = 223
                    if (m.getName().equals("germandbls") && n != 223)
                    {
                        widths.set(0337,new Float(width));
                    }
                }
            }
            else
            {
                // my AFMPFB-Fonts has no character-codes for german umlauts
                // so that I've to add them here by hand
                if (m.getName().equals("adieresis"))
                {
                    widths.set(0344,(Float)widths.get(encoding.getCode("a")));
                }
                else if (m.getName().equals("odieresis"))
                {
                    widths.set(0366,(Float)widths.get(encoding.getCode("o")));
                }
                else if (m.getName().equals("udieresis"))
                {
                    widths.set(0374,(Float)widths.get(encoding.getCode("u")));
                }
                else if (m.getName().equals("Adieresis"))
                {
                    widths.set(0304,(Float)widths.get(encoding.getCode("A")));
                }
                else if (m.getName().equals("Odieresis"))
                {
                    widths.set(0326,(Float)widths.get(encoding.getCode("O")));
                }
                else if (m.getName().equals("Udieresis"))
                {
                    widths.set(0334,(Float)widths.get(encoding.getCode("U")));
                }
            }
        }
View Full Code Here

        {
            widths.add((float)zero);
        }
        while (iter.hasNext())
        {
            CharMetric m = iter.next();
            int n = m.getCharacterCode();
            if (n > 0)
            {
                firstchar = Math.min(firstchar, n);
                lastchar = Math.max(lastchar, n);
                if (m.getWx() > 0)
                {
                    int width = Math.round(m.getWx());
                    widths.set(n, (float)width);
                    // germandbls has 2 character codes !! Don't ask me why .....
                    // StandardEncoding = 0373 = 251
                    // WinANSIEncoding = 0337 = 223
                    if (m.getName().equals("germandbls") && n != 223)
                    {
                        widths.set(0337, (float)width);
                    }
                }
            }
            else
            {
                // my AFMPFB-Fonts has no character-codes for german umlauts
                // so that I've to add them here by hand
                if (m.getName().equals("adieresis"))
                {
                    widths.set(0344, widths.get(encoding.getCode("a")));
                }
                else if (m.getName().equals("odieresis"))
                {
                    widths.set(0366, widths.get(encoding.getCode("o")));
                }
                else if (m.getName().equals("udieresis"))
                {
                    widths.set(0374, widths.get(encoding.getCode("u")));
                }
                else if (m.getName().equals("Adieresis"))
                {
                    widths.set(0304, widths.get(encoding.getCode("A")));
                }
                else if (m.getName().equals("Odieresis"))
                {
                    widths.set(0326, widths.get(encoding.getCode("O")));
                }
                else if (m.getName().equals("Udieresis"))
                {
                    widths.set(0334, widths.get(encoding.getCode("U")));
                }
            }
        }
View Full Code Here

        {
            widths.add(zero);
        }
        while (iter.hasNext())
        {
            CharMetric m = iter.next();
            int n = m.getCharacterCode();
            if (n > 0)
            {
                firstchar = Math.min(firstchar, n);
                lastchar = Math.max(lastchar, n);
                if (m.getWx() > 0)
                {
                    float width = m.getWx();
                    widths.set(n,new Float(width));
                    // germandbls has 2 character codes !! Don't ask me why .....
                    // StandardEncoding = 0373 = 251
                    // WinANSIEncoding = 0337 = 223
                    if (m.getName().equals("germandbls") && n != 223)
                    {
                        widths.set(0337,new Float(width));
                    }
                }
            }
            else
            {
                // my AFMPFB-Fonts has no character-codes for german umlauts
                // so that I've to add them here by hand
                if (m.getName().equals("adieresis"))
                {
                    widths.set(0344,(Float)widths.get(encoding.getCode("a")));
                }
                else if (m.getName().equals("odieresis"))
                {
                    widths.set(0366,(Float)widths.get(encoding.getCode("o")));
                }
                else if (m.getName().equals("udieresis"))
                {
                    widths.set(0374,(Float)widths.get(encoding.getCode("u")));
                }
                else if (m.getName().equals("Adieresis"))
                {
                    widths.set(0304,(Float)widths.get(encoding.getCode("A")));
                }
                else if (m.getName().equals("Odieresis"))
                {
                    widths.set(0326,(Float)widths.get(encoding.getCode("O")));
                }
                else if (m.getName().equals("Udieresis"))
                {
                    widths.set(0334,(Float)widths.get(encoding.getCode("U")));
                }
            }
        }
View Full Code Here

    {
        metric = fontInfo;
        Iterator<CharMetric> characters = metric.getCharMetrics().iterator();
        while( characters.hasNext() )
        {
            CharMetric nextMetric = (CharMetric)characters.next();
            addCharacterEncoding( nextMetric.getCharacterCode(), nextMetric.getName() );
        }
    }
View Full Code Here

    {
        metric = fontInfo;
        Iterator characters = metric.getCharMetrics().iterator();
        while( characters.hasNext() )
        {
            CharMetric nextMetric = (CharMetric)characters.next();
            addCharacterEncoding( nextMetric.getCharacterCode(), COSName.getPDFName( nextMetric.getName() ) );
        }
    }
View Full Code Here

        {
            widths.add(zero);
        }
        while (iter.hasNext())
        {
            CharMetric m = (CharMetric) iter.next();
            int n = m.getCharacterCode();
            if (n > 0)
            {
                firstchar = Math.min(firstchar, n);
                lastchar = Math.max(lastchar, n);
                if (m.getWx() > 0)
                {
                    float width = m.getWx();
                    widths.set(n,new Float(width));
                    // germandbls has 2 character codes !! Don't ask me why .....
                    // StandardEncoding = 0373 = 251
                    // WinANSIEncoding = 0337 = 223
                    if (m.getName().equals("germandbls") && n != 223)
                    {
                        widths.set(0337,new Float(width));
                    }
                }
            }
            else
            {
                // my AFMPFB-Fonts has no character-codes for german umlauts
                // so that I've to add them here by hand
                if (m.getName().equals("adieresis"))
                {
                    widths.set(0344,(Float)widths.get(encoding.getCode(COSName.getPDFName( "a" ))));
                }
                else if (m.getName().equals("odieresis"))
                {
                    widths.set(0366,(Float)widths.get(encoding.getCode(COSName.getPDFName( "o" ))));
                }
                else if (m.getName().equals("udieresis"))
                {
                    widths.set(0374,(Float)widths.get(encoding.getCode(COSName.getPDFName( "u" ))));
                }
                else if (m.getName().equals("Adieresis"))
                {
                    widths.set(0304,(Float)widths.get(encoding.getCode(COSName.getPDFName( "A" ))));
                }
                else if (m.getName().equals("Odieresis"))
                {
                    widths.set(0326,(Float)widths.get(encoding.getCode(COSName.getPDFName( "O" ))));
                }
                else if (m.getName().equals("Udieresis"))
                {
                    widths.set(0334,(Float)widths.get(encoding.getCode(COSName.getPDFName( "U" ))));
                }
            }
        }
View Full Code Here

        {
            widths.add(zero);
        }
        while (iter.hasNext())
        {
            CharMetric m = (CharMetric) iter.next();
            int n = m.getCharacterCode();
            if (n > 0)
            {
                firstchar = Math.min(firstchar, n);
                lastchar = Math.max(lastchar, n);
                if (m.getWx() > 0)
                {
                    float width = m.getWx();
                    widths.set(n,new Float(width));
                    // germandbls has 2 character codes !! Don't ask me why .....
                    // StandardEncoding = 0373 = 251
                    // WinANSIEncoding = 0337 = 223
                    if (m.getName().equals("germandbls") && n != 223)
                    {
                        widths.set(0337,new Float(width));
                    }
                }
            }
            else
            {
                // my AFMPFB-Fonts has no character-codes for german umlauts
                // so that I've to add them here by hand
                if (m.getName().equals("adieresis"))
                {
                    widths.set(0344,(Float)widths.get(encoding.getCode(COSName.getPDFName( "a" ))));
                }
                else if (m.getName().equals("odieresis"))
                {
                    widths.set(0366,(Float)widths.get(encoding.getCode(COSName.getPDFName( "o" ))));
                }
                else if (m.getName().equals("udieresis"))
                {
                    widths.set(0374,(Float)widths.get(encoding.getCode(COSName.getPDFName( "u" ))));
                }
                else if (m.getName().equals("Adieresis"))
                {
                    widths.set(0304,(Float)widths.get(encoding.getCode(COSName.getPDFName( "A" ))));
                }
                else if (m.getName().equals("Odieresis"))
                {
                    widths.set(0326,(Float)widths.get(encoding.getCode(COSName.getPDFName( "O" ))));
                }
                else if (m.getName().equals("Udieresis"))
                {
                    widths.set(0334,(Float)widths.get(encoding.getCode(COSName.getPDFName( "U" ))));
                }
            }
        }
View Full Code Here

TOP

Related Classes of org.apache.fontbox.afm.CharMetric

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.