Package org.apache.fontbox.ttf

Examples of org.apache.fontbox.ttf.HorizontalMetricsTable


        Map<Integer, String> codeToName = this.getFontEncoding().getCodeToNameMap();

        int firstChar = Collections.min(codeToName.keySet());
        int lastChar = Collections.max(codeToName.keySet());

        HorizontalMetricsTable hMet = ttf.getHorizontalMetrics();
        int[] widthValues = hMet.getAdvanceWidth();
        // some monospaced fonts provide only one value for the width
        // instead of an array containing the same value for every glyphid
        boolean isMonospaced = fd.isFixedPitch() || widthValues.length == 1;
        int nWidths = lastChar - firstChar + 1;
        List<Integer> widths = new ArrayList<Integer>(nWidths);
View Full Code Here


            Map<Integer, String> codeToName = this.getFontEncoding().getCodeToNameMap();
            
            int firstChar = Collections.min(codeToName.keySet());
            int lastChar = Collections.max(codeToName.keySet());
           
            HorizontalMetricsTable hMet = ttf.getHorizontalMetrics();
            int[] widthValues = hMet.getAdvanceWidth();
            // some monospaced fonts provide only one value for the width
            // instead of an array containing the same value for every glyphid
            boolean isMonospaced = fd.isFixedPitch();
            int nWidths=lastChar-firstChar+1;
            List<Float> widths = new ArrayList<Float>(nWidths);
View Full Code Here

            Map<Integer, String> codeToName = this.getFontEncoding().getCodeToNameMap();
            
            int firstChar = Collections.min(codeToName.keySet());
            int lastChar = Collections.max(codeToName.keySet());
           
            HorizontalMetricsTable hMet = ttf.getHorizontalMetrics();
            int[] widthValues = hMet.getAdvanceWidth();
            // some monospaced fonts provide only one value for the width
            // instead of an array containing the same value for every glyphid
            boolean isMonospaced = fd.isFixedPitch();
            int nWidths=lastChar-firstChar+1;
            List<Float> widths = new ArrayList<Float>(nWidths);
View Full Code Here

                    glyphToCCode = cmaps[i].getGlyphIdToCharacterCode();
                }
            }
            int firstChar = 0;
            int maxWidths = glyphToCCode.length;
            HorizontalMetricsTable hMet = ttf.getHorizontalMetrics();
            int[] widthValues = hMet.getAdvanceWidth();
            List widths = new ArrayList(maxWidths);
            Integer zero = new Integer( 250 );
            for( int i=0; i<maxWidths; i++ )
            {
                widths.add( zero );
View Full Code Here

            Map<Integer, String> codeToName = this.getFontEncoding().getCodeToNameMap();
            
            int firstChar = Collections.min(codeToName.keySet());
            int lastChar = Collections.max(codeToName.keySet());
           
            HorizontalMetricsTable hMet = ttf.getHorizontalMetrics();
            int[] widthValues = hMet.getAdvanceWidth();
            int nWidths=lastChar-firstChar+1;
            List<Float> widths = new ArrayList<Float>(nWidths);
            // width of the .notdef character.
            Float zero = Float.valueOf(widthValues[0]*scaling);
            for( int i=0; i<nWidths; i++ )
View Full Code Here

                    glyphToCCode = cmaps[i].getGlyphIdToCharacterCode();
                }
            }
            int firstChar = 0;
            int maxWidths = glyphToCCode.length;
            HorizontalMetricsTable hMet = ttf.getHorizontalMetrics();
            int[] widthValues = hMet.getAdvanceWidth();
            List<Float> widths = new ArrayList<Float>(maxWidths);
            float zero = 250;
            for( int i=0; i<maxWidths; i++ )
            {
                widths.add( zero );
View Full Code Here

            Map<Integer, String> codeToName = this.getFontEncoding().getCodeToNameMap();
            
            int firstChar = Collections.min(codeToName.keySet());
            int lastChar = Collections.max(codeToName.keySet());
           
            HorizontalMetricsTable hMet = ttf.getHorizontalMetrics();
            int[] widthValues = hMet.getAdvanceWidth();
            int nWidths=lastChar-firstChar+1;
            List<Float> widths = new ArrayList<Float>(nWidths);
            // width of the .notdef character.
            Float zero = Float.valueOf(widthValues[0]*scaling);
            for( int i=0; i<nWidths; i++ )
View Full Code Here

                    }
                }
            }
            int firstChar = os2.getFirstCharIndex();
            int maxWidths = glyphToCCode.length;
            HorizontalMetricsTable hMet = ttf.getHorizontalMetrics();
            int[] widthValues = hMet.getAdvanceWidth();
            List<Float> widths = new ArrayList<Float>(maxWidths);
            float zero = 250;
            for( int i=0; i<maxWidths; i++ )
            {
                widths.add( zero );
View Full Code Here

            Map<Integer, String> codeToName = this.getFontEncoding().getCodeToNameMap();
            
            int firstChar = Collections.min(codeToName.keySet());
            int lastChar = Collections.max(codeToName.keySet());
           
            HorizontalMetricsTable hMet = ttf.getHorizontalMetrics();
            int[] widthValues = hMet.getAdvanceWidth();
            // some monospaced fonts provide only one value for the width
            // instead of an array containing the same value for every glyphid
            boolean isMonospaced = fd.isFixedPitch();
            int nWidths=lastChar-firstChar+1;
            List<Float> widths = new ArrayList<Float>(nWidths);
View Full Code Here

            Map<Integer, String> codeToName = this.getFontEncoding().getCodeToNameMap();
            
            int firstChar = Collections.min(codeToName.keySet());
            int lastChar = Collections.max(codeToName.keySet());
           
            HorizontalMetricsTable hMet = ttf.getHorizontalMetrics();
            int[] widthValues = hMet.getAdvanceWidth();
            // some monospaced fonts provide only one value for the width
            // instead of an array containing the same value for every glyphid
            boolean isMonospaced = fd.isFixedPitch() || widthValues.length == 1;
            int nWidths=lastChar-firstChar+1;
            List<Float> widths = new ArrayList<Float>(nWidths);
View Full Code Here

TOP

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

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.