private HorizontalMetricsTable CreateHmtxTable(GlyfDataTable glyfTable) { // Fetches horizontal metrics for all glyphs HorizontalMetricsTable hmtxOld = reader.GetHorizontalMetricsTable(); DirectoryEntry entry = new DirectoryEntry(TableNames.Hmtx); HorizontalMetricsTable hmtx = new HorizontalMetricsTable(entry, glyfTable.Count); // Copy required horizontal metrics. IndexMappings mappings = reader.IndexMappings; foreach (int subsetIndex in mappings.SubsetIndices) { int glyphIndex = mappings.GetGlyphIndex(subsetIndex); hmtx[subsetIndex] = hmtxOld[glyphIndex].Clone(); } return(hmtx); }