public int[] ReadIndex(CompactFontFormatData data)
        {
            var count = data.ReadCard16();

            var offsetSize = data.ReadOffsize();

            var offsets = new int[count + 1];

            for (var i = 0; i < offsets.Length; i++)
            {
                offsets[i] = data.ReadOffset(offsetSize);
            }

            return(offsets);
        }
Пример #2
0
        public static int[] ReadIndex(CompactFontFormatData data)
        {
            var count = data.ReadCard16();

            if (count == 0)
            {
                return(EmptyArray <int> .Instance);
            }

            var offsetSize = data.ReadOffsize();

            var offsets = new int[count + 1];

            for (var i = 0; i < offsets.Length; i++)
            {
                offsets[i] = data.ReadOffset(offsetSize);
            }

            return(offsets);
        }