public static DataDisplayTable listGlyphDimensionBounds(Font font){
  String[] header={"Dimension","Value"};
  Align[] displayAlignment={Align.Left,Align.Right};
  DataDisplayTable table=new DataDisplayTable(Arrays.asList(header));
  table.setAlignment(Arrays.asList(displayAlignment));
  LocaTable locaTable=FontUtils.getLocaTable(font);
  GlyphTable glyfTable=FontUtils.getGlyphTable(font);
  int xMin=Integer.MAX_VALUE;
  int yMin=Integer.MAX_VALUE;
  int xMax=Integer.MIN_VALUE;
  int yMax=Integer.MIN_VALUE;
  for (int i=0; i < locaTable.numGlyphs(); i++) {
    Glyph glyph=glyfTable.glyph(locaTable.glyphOffset(i),locaTable.glyphLength(i));
    if (glyph.xMin() < xMin) {
      xMin=glyph.xMin();
    }
    if (glyph.yMin() < yMin) {
      yMin=glyph.yMin();
    }
    if (glyph.xMax() > xMax) {
      xMax=glyph.xMax();
    }
    if (glyph.yMax() > yMax) {
      yMax=glyph.yMax();
    }
  }
  table.add(Arrays.asList(new String[]{"xMin",String.format("%d",xMin)}));
  table.add(Arrays.asList(new String[]{"xMax",String.format("%d",xMax)}));
  table.add(Arrays.asList(new String[]{"yMin",String.format("%d",yMin)}));
  table.add(Arrays.asList(new String[]{"yMax",String.format("%d",yMax)}));
  return table;
}

public static DataDisplayTable listGlyphDimensionBounds ( Font font ) { String [ ] header = { "Dimension" , "Value" } ; Align [ ] displayAlignment = { Align . Left , Align . Right } ; DataDisplayTable table = new DataDisplayTable ( Arrays . asList ( header ) ) ; table . setAlignment ( Arrays . asList ( displayAlignment ) ) ; LocaTable locaTable = FontUtils . getLocaTable ( font ) ; GlyphTable glyfTable = FontUtils . getGlyphTable ( font ) ; int xMin = Integer . MAX_VALUE ; int yMin = Integer . MAX_VALUE ; int xMax = Integer . MIN_VALUE ; int yMax = Integer . MIN_VALUE ; for ( int i = 0 ; i < locaTable . numGlyphs ( ) ; i ++ ) { Glyph glyph = glyfTable . glyph ( locaTable . glyphOffset ( i ) , locaTable . glyphLength ( i ) ) ; if ( glyph . xMin ( ) < xMin ) { xMin = glyph . xMin ( ) ; } if ( glyph . yMin ( ) < yMin ) { yMin = glyph . yMin ( ) ; } if ( glyph . xMax ( ) > xMax ) { xMax = glyph . xMax ( ) ; } if ( glyph . yMax ( ) > yMax ) { yMax = glyph . yMax ( ) ; } } table . add ( Arrays . asList ( new String [ ] { "xMin" , String . format ( "%d" , xMin ) } ) ) ; table . add ( Arrays . asList ( new String [ ] { "xMax" , String . format ( "%d" , xMax ) } ) ) ; table . add ( Arrays . asList ( new String [ ] { "yMin" , String . format ( "%d" , yMin ) } ) ) ; table . add ( Arrays . asList ( new String [ ] { "yMax" , String . format ( "%d" , yMax ) } ) ) ; return table ; }
gets a list of minimum and maximum x and y dimensions for the glyphs in the font . this is based on the reported min and max values for each glyph and not on the actual outline sizes .
