/// <summary> /// Reads indexed string data. /// </summary> private static string[] ReadStringIndex(CompactFontFormatData data) { var index = CompactFontFormatIndexReader.ReadIndex(data); if (index.Length == 0) { return(EmptyArray <string> .Instance); } var count = index.Length - 1; var result = new string[count]; for (var i = 0; i < count; i++) { var length = index[i + 1] - index[i]; if (length < 0) { throw new InvalidOperationException($"Negative object length {length} at {i}. Current position: {data.Position}."); } result[i] = data.ReadString(length, OtherEncodings.Iso88591); } return(result); }
private static string ReadTag(CompactFontFormatData data) { var tag = data.ReadString(4, OtherEncodings.Iso88591); return(tag); }