@SuppressWarnings("unchecked") protected void BuildNewLGSubrs(int Font) throws java.io.IOException {
  if (fonts[Font].isCID) {
    hSubrsUsed=new GenericArray<>(fonts[Font].fdprivateOffsets.length);
    lSubrsUsed=new GenericArray<>(fonts[Font].fdprivateOffsets.length);
    NewLSubrsIndex=new byte[fonts[Font].fdprivateOffsets.length][];
    fonts[Font].PrivateSubrsOffset=new int[fonts[Font].fdprivateOffsets.length];
    fonts[Font].PrivateSubrsOffsetsArray=new int[fonts[Font].fdprivateOffsets.length][];
    List<Integer> FDInList=new ArrayList<>(FDArrayUsed);
    for (int j=0; j < FDInList.size(); j++) {
      int FD=(int)FDInList.get(j);
      hSubrsUsed.set(FD,new HashMap<Integer,int[]>());
      lSubrsUsed.set(FD,new ArrayList<Integer>());
      BuildFDSubrsOffsets(Font,FD);
      if (fonts[Font].PrivateSubrsOffset[FD] >= 0) {
        BuildSubrUsed(Font,FD,fonts[Font].PrivateSubrsOffset[FD],fonts[Font].PrivateSubrsOffsetsArray[FD],hSubrsUsed.get(FD),lSubrsUsed.get(FD));
        NewLSubrsIndex[FD]=BuildNewIndex(fonts[Font].PrivateSubrsOffsetsArray[FD],hSubrsUsed.get(FD),RETURN_OP);
      }
    }
  }
 else   if (fonts[Font].privateSubrs >= 0) {
    fonts[Font].SubrsOffsets=getIndex(fonts[Font].privateSubrs);
    BuildSubrUsed(Font,-1,fonts[Font].privateSubrs,fonts[Font].SubrsOffsets,hSubrsUsedNonCID,lSubrsUsedNonCID);
  }
  BuildGSubrsUsed(Font);
  if (fonts[Font].privateSubrs >= 0)   NewSubrsIndexNonCID=BuildNewIndex(fonts[Font].SubrsOffsets,hSubrsUsedNonCID,RETURN_OP);
  NewGSubrsIndex=BuildNewIndex(gsubrOffsets,hGSubrsUsed,RETURN_OP);
}

@ SuppressWarnings ( "unchecked" ) protected void BuildNewLGSubrs ( int Font ) throws java . io . IOException { if ( fonts [ Font ] . isCID ) { hSubrsUsed = new GenericArray < > ( fonts [ Font ] . fdprivateOffsets . length ) ; lSubrsUsed = new GenericArray < > ( fonts [ Font ] . fdprivateOffsets . length ) ; NewLSubrsIndex = new byte [ fonts [ Font ] . fdprivateOffsets . length ] [ ] ; fonts [ Font ] . PrivateSubrsOffset = new int [ fonts [ Font ] . fdprivateOffsets . length ] ; fonts [ Font ] . PrivateSubrsOffsetsArray = new int [ fonts [ Font ] . fdprivateOffsets . length ] [ ] ; List < Integer > FDInList = new ArrayList < > ( FDArrayUsed ) ; for ( int j = 0 ; j < FDInList . size ( ) ; j ++ ) { int FD = ( int ) FDInList . get ( j ) ; hSubrsUsed . set ( FD , new HashMap < Integer , int [ ] > ( ) ) ; lSubrsUsed . set ( FD , new ArrayList < Integer > ( ) ) ; BuildFDSubrsOffsets ( Font , FD ) ; if ( fonts [ Font ] . PrivateSubrsOffset [ FD ] >= 0 ) { BuildSubrUsed ( Font , FD , fonts [ Font ] . PrivateSubrsOffset [ FD ] , fonts [ Font ] . PrivateSubrsOffsetsArray [ FD ] , hSubrsUsed . get ( FD ) , lSubrsUsed . get ( FD ) ) ; NewLSubrsIndex [ FD ] = BuildNewIndex ( fonts [ Font ] . PrivateSubrsOffsetsArray [ FD ] , hSubrsUsed . get ( FD ) , RETURN_OP ) ; } } } else if ( fonts [ Font ] . privateSubrs >= 0 ) { fonts [ Font ] . SubrsOffsets = getIndex ( fonts [ Font ] . privateSubrs ) ; BuildSubrUsed ( Font , - 1 , fonts [ Font ] . privateSubrs , fonts [ Font ] . SubrsOffsets , hSubrsUsedNonCID , lSubrsUsedNonCID ) ; } BuildGSubrsUsed ( Font ) ; if ( fonts [ Font ] . privateSubrs >= 0 ) NewSubrsIndexNonCID = BuildNewIndex ( fonts [ Font ] . SubrsOffsets , hSubrsUsedNonCID , RETURN_OP ) ; NewGSubrsIndex = BuildNewIndex ( gsubrOffsets , hGSubrsUsed , RETURN_OP ) ; }
function builds the new local & global subsrs indices . if cid then all of the fd array lsubrs will be subsetted .
