private int getIndexOfChar(int c){
        int count = 0;
        for(char[] range : ranges){
            if(c >= range[0] && c <= range[1]){
                return count + (c - range[0]);
            }
            count += 1 + range[1] - range[0];
        }
        return getIndexOfChar(9703); // fallback
    }