private DialogBaseUnits computeDialogBaseUnits(FontMetrics metrics){
  double averageCharWidth=computeAverageCharWidth(metrics,averageCharWidthTestString);
  int ascent=metrics.getAscent();
  double height=ascent > 14 ? ascent : ascent + (15 - ascent) / 3;
  DialogBaseUnits dialogBaseUnits=new DialogBaseUnits(averageCharWidth,height);
  if (LOGGER.isLoggable(Level.CONFIG)) {
    LOGGER.config("Computed dialog base units " + dialogBaseUnits + " for: "+ metrics.getFont());
  }
  return dialogBaseUnits;
}

private DialogBaseUnits computeDialogBaseUnits ( FontMetrics metrics ) { double averageCharWidth = computeAverageCharWidth ( metrics , averageCharWidthTestString ) ; int ascent = metrics . getAscent ( ) ; double height = ascent > 14 ? ascent : ascent + ( 15 - ascent ) / 3 ; DialogBaseUnits dialogBaseUnits = new DialogBaseUnits ( averageCharWidth , height ) ; if ( LOGGER . isLoggable ( Level . CONFIG ) ) { LOGGER . config ( "Computed dialog base units " + dialogBaseUnits + " for: " + metrics . getFont ( ) ) ; } return dialogBaseUnits ; }
computes and returns the horizontal dialog base units . honors the font , font size and resolution . < p > implementation note : 14dluy map to 22 pixel for 8pt tahoma on 96 dpi . i could not yet manage to compute the microsoft compliant font height . therefore this method adds a correction value that seems to work well with the vast majority of desktops . < p > todo : revise the computation of vertical base units as soon as there are more information about the original computation in microsoft environments .
