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);