diff --git a/samples/ListFonts/Program.cs b/samples/ListFonts/Program.cs index d76588502..e641fee5b 100644 --- a/samples/ListFonts/Program.cs +++ b/samples/ListFonts/Program.cs @@ -10,7 +10,7 @@ public static class Program { public static void Main(string[] args) { - var pairings = new List(); + List pairings = []; IOrderedEnumerable ordered = SystemFonts.Families.OrderBy(x => x.Name); foreach (FontFamily family in ordered) { diff --git a/src/SixLabors.Fonts/ArrayBuilder{T}.cs b/src/SixLabors.Fonts/ArrayBuilder{T}.cs index e55c20e43..068154e5b 100644 --- a/src/SixLabors.Fonts/ArrayBuilder{T}.cs +++ b/src/SixLabors.Fonts/ArrayBuilder{T}.cs @@ -153,7 +153,7 @@ private void EnsureCapacity(int min) newCapacity = (uint)min; } - var array = new T[newCapacity]; + T[] array = new T[newCapacity]; if (this.size > 0) { diff --git a/src/SixLabors.Fonts/ArraySlice{T}.cs b/src/SixLabors.Fonts/ArraySlice{T}.cs index 27200610f..4dcb31855 100644 --- a/src/SixLabors.Fonts/ArraySlice{T}.cs +++ b/src/SixLabors.Fonts/ArraySlice{T}.cs @@ -48,7 +48,7 @@ public ArraySlice(T[] data, int start, int length) /// /// Gets an empty /// - public static ArraySlice Empty => new(Array.Empty()); + public static ArraySlice Empty => new([]); /// /// Gets the offset position in the underlying buffer this slice was created from. diff --git a/src/SixLabors.Fonts/Font.cs b/src/SixLabors.Fonts/Font.cs index 570493043..c5df28266 100644 --- a/src/SixLabors.Fonts/Font.cs +++ b/src/SixLabors.Fonts/Font.cs @@ -238,7 +238,7 @@ public bool TryGetGlyph( TextRun textRun = new() { Start = 0, End = 1, Font = this, TextAttributes = textAttributes, TextDecorations = textDecorations }; if (this.FontMetrics.TryGetGlyphMetrics(codePoint, textAttributes, textDecorations, layoutMode, support, out GlyphMetrics? metrics)) { - glyph = new(metrics.CloneForRendering(textRun), this.Size); + glyph = new Glyph(metrics.CloneForRendering(textRun), this.Size); return true; } diff --git a/src/SixLabors.Fonts/FontDescription.cs b/src/SixLabors.Fonts/FontDescription.cs index da0d75d40..59a5ee4cd 100644 --- a/src/SixLabors.Fonts/FontDescription.cs +++ b/src/SixLabors.Fonts/FontDescription.cs @@ -92,7 +92,7 @@ public static FontDescription LoadDescription(string path) Guard.NotNullOrWhiteSpace(path, nameof(path)); using FileStream fs = File.OpenRead(path); - using var reader = new FontReader(fs); + using FontReader reader = new(fs); return LoadDescription(reader); } @@ -106,7 +106,7 @@ public static FontDescription LoadDescription(Stream stream) Guard.NotNull(stream, nameof(stream)); // Only read the name tables. - using var reader = new FontReader(stream); + using FontReader reader = new(stream); return LoadDescription(reader); } @@ -152,14 +152,14 @@ public static FontDescription[] LoadFontCollectionDescriptions(string path) public static FontDescription[] LoadFontCollectionDescriptions(Stream stream) { long startPos = stream.Position; - using var reader = new BigEndianBinaryReader(stream, true); - var ttcHeader = TtcHeader.Read(reader); + using BigEndianBinaryReader reader = new(stream, true); + TtcHeader ttcHeader = TtcHeader.Read(reader); - var result = new FontDescription[(int)ttcHeader.NumFonts]; + FontDescription[] result = new FontDescription[(int)ttcHeader.NumFonts]; for (int i = 0; i < ttcHeader.NumFonts; ++i) { stream.Position = startPos + ttcHeader.OffsetTable[i]; - using var fontReader = new FontReader(stream); + using FontReader fontReader = new(stream); result[i] = LoadDescription(fontReader); } diff --git a/src/SixLabors.Fonts/FontFamily.cs b/src/SixLabors.Fonts/FontFamily.cs index 6ccf655b5..73758740c 100644 --- a/src/SixLabors.Fonts/FontFamily.cs +++ b/src/SixLabors.Fonts/FontFamily.cs @@ -126,7 +126,7 @@ public bool TryGetPaths(out IEnumerable paths) FontsThrowHelper.ThrowDefaultInstance(); } - var filePaths = new List(); + List filePaths = []; foreach (FontStyle style in this.GetAvailableStyles()) { if (this.collection.TryGetMetrics(this.Name, this.Culture, style, out FontMetrics? metrics) diff --git a/src/SixLabors.Fonts/FontReader.cs b/src/SixLabors.Fonts/FontReader.cs index 2c27ef409..957d703e9 100644 --- a/src/SixLabors.Fonts/FontReader.cs +++ b/src/SixLabors.Fonts/FontReader.cs @@ -25,7 +25,7 @@ internal FontReader(Stream stream, TableLoader loader) Func loadHeader = TableHeader.Read; this.stream = stream; - using var reader = new BigEndianBinaryReader(stream, true); + using BigEndianBinaryReader reader = new(stream, true); // we should immediately read the table header to learn which tables we have and what order they are in uint version = reader.ReadUInt32(); @@ -90,9 +90,9 @@ internal FontReader(Stream stream, TableLoader loader) this.isOwnedStream = true; byte[] compressedBuffer = reader.ReadBytes((int)totalCompressedSize); - var decompressedStream = new MemoryStream(); - using var input = new MemoryStream(compressedBuffer); - using var decompressor = new BrotliStream(input, CompressionMode.Decompress); + MemoryStream decompressedStream = new(); + using MemoryStream input = new(compressedBuffer); + using BrotliStream decompressor = new(input, CompressionMode.Decompress); decompressor.CopyTo(decompressedStream); decompressedStream.Position = 0; this.stream = decompressedStream; @@ -111,7 +111,7 @@ internal FontReader(Stream stream, TableLoader loader) this.CompressedTableData = false; } - var headers = new Dictionary(tableCount); + Dictionary headers = new(tableCount); for (int i = 0; i < tableCount; i++) { TableHeader tbl = loadHeader(reader); diff --git a/src/SixLabors.Fonts/GlyphMetrics.cs b/src/SixLabors.Fonts/GlyphMetrics.cs index e7b5093e3..d0d62ff73 100644 --- a/src/SixLabors.Fonts/GlyphMetrics.cs +++ b/src/SixLabors.Fonts/GlyphMetrics.cs @@ -54,13 +54,13 @@ internal GlyphMetrics( { float units = this.UnitsPerEm; scaleFactor /= new Vector2(font.SubscriptXSize / units, font.SubscriptYSize / units); - offset = new(font.SubscriptXOffset, font.SubscriptYOffset < 0 ? font.SubscriptYOffset : -font.SubscriptYOffset); + offset = new Vector2(font.SubscriptXOffset, font.SubscriptYOffset < 0 ? font.SubscriptYOffset : -font.SubscriptYOffset); } else if ((textAttributes & TextAttributes.Superscript) == TextAttributes.Superscript) { float units = this.UnitsPerEm; scaleFactor /= new Vector2(font.SuperscriptXSize / units, font.SuperscriptYSize / units); - offset = new(font.SuperscriptXOffset, font.SuperscriptYOffset < 0 ? -font.SuperscriptYOffset : font.SuperscriptYOffset); + offset = new Vector2(font.SuperscriptXOffset, font.SuperscriptYOffset < 0 ? -font.SuperscriptYOffset : font.SuperscriptYOffset); } this.ScaleFactor = scaleFactor; @@ -355,19 +355,19 @@ protected void RenderDecorationsTo( { // To ensure that we share the scaling when sharing font metrics we need to // recalculate the offset and scale factor here using the common font metrics. - scaleFactor = new(fontMetrics.UnitsPerEm * 72F); + scaleFactor = new Vector2(fontMetrics.UnitsPerEm * 72F); offset = Vector2.Zero; if ((this.TextAttributes & TextAttributes.Subscript) == TextAttributes.Subscript) { float units = this.UnitsPerEm; scaleFactor /= new Vector2(fontMetrics.SubscriptXSize / units, fontMetrics.SubscriptYSize / units); - offset = new(fontMetrics.SubscriptXOffset, fontMetrics.SubscriptYOffset < 0 ? fontMetrics.SubscriptYOffset : -fontMetrics.SubscriptYOffset); + offset = new Vector2(fontMetrics.SubscriptXOffset, fontMetrics.SubscriptYOffset < 0 ? fontMetrics.SubscriptYOffset : -fontMetrics.SubscriptYOffset); } else if ((this.TextAttributes & TextAttributes.Superscript) == TextAttributes.Superscript) { float units = this.UnitsPerEm; scaleFactor /= new Vector2(fontMetrics.SuperscriptXSize / units, fontMetrics.SuperscriptYSize / units); - offset = new(fontMetrics.SuperscriptXOffset, fontMetrics.SuperscriptYOffset < 0 ? -fontMetrics.SuperscriptYOffset : fontMetrics.SuperscriptYOffset); + offset = new Vector2(fontMetrics.SuperscriptXOffset, fontMetrics.SuperscriptYOffset < 0 ? -fontMetrics.SuperscriptYOffset : fontMetrics.SuperscriptYOffset); } } diff --git a/src/SixLabors.Fonts/GlyphPositioningCollection.cs b/src/SixLabors.Fonts/GlyphPositioningCollection.cs index 0094a2635..cf7f83f51 100644 --- a/src/SixLabors.Fonts/GlyphPositioningCollection.cs +++ b/src/SixLabors.Fonts/GlyphPositioningCollection.cs @@ -17,7 +17,7 @@ internal sealed class GlyphPositioningCollection : IGlyphShapingCollection /// /// Contains a map the index of a map within the collection, non-sequential codepoint offsets, and their glyph ids, point size, and mtrics. /// - private readonly List glyphs = new(); + private readonly List glyphs = []; /// /// Initializes a new instance of the class. @@ -193,7 +193,7 @@ public bool TryUpdate(Font font, GlyphSubstitutionCollection collection) // Track the number of inserted glyphs at the offset so we can correctly increment our position. GlyphShapingBounds bounds = new(0, 0, metrics.AdvanceWidth, metrics.AdvanceHeight); - this.glyphs.Insert(i += replacementCount, new(offset, new(shape, true) { Bounds = bounds }, pointSize, metrics.CloneForRendering(shape.TextRun))); + this.glyphs.Insert(i += replacementCount, new GlyphPositioningData(offset, new GlyphShapingData(shape, true) { Bounds = bounds }, pointSize, metrics.CloneForRendering(shape.TextRun))); replacementCount++; } } @@ -260,10 +260,10 @@ public bool TryAdd(Font font, GlyphSubstitutionCollection collection) } GlyphShapingBounds bounds = isVertical - ? new(0, 0, 0, metrics.AdvanceHeight) - : new(0, 0, metrics.AdvanceWidth, 0); + ? new GlyphShapingBounds(0, 0, 0, metrics.AdvanceHeight) + : new GlyphShapingBounds(0, 0, metrics.AdvanceWidth, 0); - this.glyphs.Add(new(offset, new(data, true) { Bounds = bounds }, font.Size, metrics.CloneForRendering(data.TextRun))); + this.glyphs.Add(new GlyphPositioningData(offset, new GlyphShapingData(data, true) { Bounds = bounds }, font.Size, metrics.CloneForRendering(data.TextRun))); } return !hasFallBacks; diff --git a/src/SixLabors.Fonts/GlyphShapingData.cs b/src/SixLabors.Fonts/GlyphShapingData.cs index 4e0e3e932..9c68bd8c9 100644 --- a/src/SixLabors.Fonts/GlyphShapingData.cs +++ b/src/SixLabors.Fonts/GlyphShapingData.cs @@ -41,7 +41,7 @@ public GlyphShapingData(GlyphShapingData data, bool clearFeatures = false) this.IsDecomposed = data.IsDecomposed; if (data.UniversalShapingEngineInfo != null) { - this.UniversalShapingEngineInfo = new( + this.UniversalShapingEngineInfo = new UniversalShapingEngineInfo( data.UniversalShapingEngineInfo.Category, data.UniversalShapingEngineInfo.SyllableType, data.UniversalShapingEngineInfo.Syllable); @@ -49,7 +49,7 @@ public GlyphShapingData(GlyphShapingData data, bool clearFeatures = false) if (data.IndicShapingEngineInfo != null) { - this.IndicShapingEngineInfo = new( + this.IndicShapingEngineInfo = new IndicShapingEngineInfo( data.IndicShapingEngineInfo.Category, data.IndicShapingEngineInfo.Position, data.IndicShapingEngineInfo.SyllableType, diff --git a/src/SixLabors.Fonts/GlyphSubstitutionCollection.cs b/src/SixLabors.Fonts/GlyphSubstitutionCollection.cs index 2833bea43..c299bac50 100644 --- a/src/SixLabors.Fonts/GlyphSubstitutionCollection.cs +++ b/src/SixLabors.Fonts/GlyphSubstitutionCollection.cs @@ -17,7 +17,7 @@ internal sealed class GlyphSubstitutionCollection : IGlyphShapingCollection /// /// Contains a map the index of a map within the collection, non-sequential codepoint offsets, and their glyph ids. /// - private readonly List glyphs = new(); + private readonly List glyphs = []; /// /// Initializes a new instance of the class. @@ -101,7 +101,7 @@ public void DisableShapingFeature(int index, Tag feature) /// The data. /// The zero-based index within the input codepoint collection. public void AddGlyph(GlyphShapingData data, int offset) - => this.glyphs.Add(new(offset, new(data, false))); + => this.glyphs.Add(new OffsetGlyphDataPair(offset, new GlyphShapingData(data, false))); /// /// Adds the glyph id and the codepoint it represents to the collection. @@ -112,7 +112,7 @@ public void AddGlyph(GlyphShapingData data, int offset) /// The text run this glyph belongs to. /// The zero-based index within the input codepoint collection. public void AddGlyph(ushort glyphId, CodePoint codePoint, TextDirection direction, TextRun textRun, int offset) - => this.glyphs.Add(new(offset, new(textRun) + => this.glyphs.Add(new OffsetGlyphDataPair(offset, new GlyphShapingData(textRun) { CodePoint = codePoint, Direction = direction, @@ -363,7 +363,7 @@ public void Replace(int index, ReadOnlySpan glyphIds, Tag feature) data.AppliedFeatures.Add(feature); - this.glyphs.Insert(++index, new(pair.Offset, data)); + this.glyphs.Insert(++index, new OffsetGlyphDataPair(pair.Offset, data)); } } } diff --git a/src/SixLabors.Fonts/ReadOnlyArraySlice{T}.cs b/src/SixLabors.Fonts/ReadOnlyArraySlice{T}.cs index 6c0789213..0799cc0ad 100644 --- a/src/SixLabors.Fonts/ReadOnlyArraySlice{T}.cs +++ b/src/SixLabors.Fonts/ReadOnlyArraySlice{T}.cs @@ -48,7 +48,7 @@ public ReadOnlyArraySlice(T[] data, int start, int length) /// /// Gets an empty /// - public static ReadOnlyArraySlice Empty => new(Array.Empty()); + public static ReadOnlyArraySlice Empty => new([]); /// /// Gets the offset position in the underlying buffer this slice was created from. diff --git a/src/SixLabors.Fonts/StreamFontMetrics.cs b/src/SixLabors.Fonts/StreamFontMetrics.cs index 5226cc234..a6445d5c9 100644 --- a/src/SixLabors.Fonts/StreamFontMetrics.cs +++ b/src/SixLabors.Fonts/StreamFontMetrics.cs @@ -59,9 +59,9 @@ internal StreamFontMetrics(TrueTypeFontTables tables) this.trueTypeFontTables = tables; this.outlineType = OutlineType.TrueType; this.description = new FontDescription(tables.Name, tables.Os2, tables.Head); - this.glyphIdCache = new(); - this.codePointCache = new(); - this.glyphCache = new(); + this.glyphIdCache = new ConcurrentDictionary<(int CodePoint, int NextCodePoint), (bool Success, ushort GlyphId, bool SkipNextCodePoint)>(); + this.codePointCache = new ConcurrentDictionary(); + this.glyphCache = new ConcurrentDictionary<(int CodePoint, ushort Id, TextAttributes Attributes, ColorFontSupport ColorSupport, bool IsVerticalLayout), GlyphMetrics>(); (HorizontalMetrics HorizontalMetrics, VerticalMetrics VerticalMetrics) metrics = this.Initialize(tables); this.horizontalMetrics = metrics.HorizontalMetrics; @@ -77,9 +77,9 @@ internal StreamFontMetrics(CompactFontTables tables) this.compactFontTables = tables; this.outlineType = OutlineType.CFF; this.description = new FontDescription(tables.Name, tables.Os2, tables.Head); - this.glyphIdCache = new(); - this.codePointCache = new(); - this.glyphCache = new(); + this.glyphIdCache = new ConcurrentDictionary<(int CodePoint, int NextCodePoint), (bool Success, ushort GlyphId, bool SkipNextCodePoint)>(); + this.codePointCache = new ConcurrentDictionary(); + this.glyphCache = new ConcurrentDictionary<(int CodePoint, ushort Id, TextAttributes Attributes, ColorFontSupport ColorSupport, bool IsVerticalLayout), GlyphMetrics>(); (HorizontalMetrics HorizontalMetrics, VerticalMetrics VerticalMetrics) metrics = this.Initialize(tables); this.horizontalMetrics = metrics.HorizontalMetrics; @@ -465,7 +465,7 @@ private static HorizontalMetrics InitializeHorizontalMetrics(HorizontalHeadTable advanceWidthMax = (short)hhea.AdvanceWidthMax; advanceHeightMax = vhea == null ? lineHeight : vhea.AdvanceHeightMax; - return new() + return new HorizontalMetrics { Ascender = ascender, Descender = descender, diff --git a/src/SixLabors.Fonts/SystemFontCollection.cs b/src/SixLabors.Fonts/SystemFontCollection.cs index 877b2cac6..f130f4392 100644 --- a/src/SixLabors.Fonts/SystemFontCollection.cs +++ b/src/SixLabors.Fonts/SystemFontCollection.cs @@ -144,7 +144,7 @@ IEnumerator IReadOnlyFontMetricsCollection.GetEnumerator() private static FontCollection CreateSystemFontCollection(IEnumerable paths, IReadOnlyCollection searchDirectories) { - var collection = new FontCollection(searchDirectories); + FontCollection collection = new(searchDirectories); foreach (string path in paths) { diff --git a/src/SixLabors.Fonts/Tables/AdvancedTypographic/ChainedClassSequenceRuleSetTable.cs b/src/SixLabors.Fonts/Tables/AdvancedTypographic/ChainedClassSequenceRuleSetTable.cs index c2c854578..ded6d5601 100644 --- a/src/SixLabors.Fonts/Tables/AdvancedTypographic/ChainedClassSequenceRuleSetTable.cs +++ b/src/SixLabors.Fonts/Tables/AdvancedTypographic/ChainedClassSequenceRuleSetTable.cs @@ -28,7 +28,7 @@ public static ChainedClassSequenceRuleSetTable Load(BigEndianBinaryReader reader Span seqRuleOffsets = seqRuleOffsetsBuffer.GetSpan(); reader.ReadUInt16Array(seqRuleOffsets); - var subRules = new ChainedClassSequenceRuleTable[seqRuleCount]; + ChainedClassSequenceRuleTable[] subRules = new ChainedClassSequenceRuleTable[seqRuleCount]; for (int i = 0; i < subRules.Length; i++) { subRules[i] = ChainedClassSequenceRuleTable.Load(reader, offset + seqRuleOffsets[i]); diff --git a/src/SixLabors.Fonts/Tables/AdvancedTypographic/ChainedSequenceRuleSetTable.cs b/src/SixLabors.Fonts/Tables/AdvancedTypographic/ChainedSequenceRuleSetTable.cs index cabbbf501..20cdd6365 100644 --- a/src/SixLabors.Fonts/Tables/AdvancedTypographic/ChainedSequenceRuleSetTable.cs +++ b/src/SixLabors.Fonts/Tables/AdvancedTypographic/ChainedSequenceRuleSetTable.cs @@ -28,7 +28,7 @@ public static ChainedSequenceRuleSetTable Load(BigEndianBinaryReader reader, lon Span chainedSeqRuleOffsets = chainedSeqRuleOffsetsBuffer.GetSpan(); reader.ReadUInt16Array(chainedSeqRuleOffsets); - var chainedSequenceRules = new ChainedSequenceRuleTable[chainedSeqRuleCount]; + ChainedSequenceRuleTable[] chainedSequenceRules = new ChainedSequenceRuleTable[chainedSeqRuleCount]; for (int i = 0; i < chainedSequenceRules.Length; i++) { chainedSequenceRules[i] = ChainedSequenceRuleTable.Load(reader, offset + chainedSeqRuleOffsets[i]); diff --git a/src/SixLabors.Fonts/Tables/AdvancedTypographic/ClassSequenceRuleSetTable.cs b/src/SixLabors.Fonts/Tables/AdvancedTypographic/ClassSequenceRuleSetTable.cs index e3b282f76..691ea0ce6 100644 --- a/src/SixLabors.Fonts/Tables/AdvancedTypographic/ClassSequenceRuleSetTable.cs +++ b/src/SixLabors.Fonts/Tables/AdvancedTypographic/ClassSequenceRuleSetTable.cs @@ -35,7 +35,7 @@ public static ClassSequenceRuleSetTable Load(BigEndianBinaryReader reader, long Span seqRuleOffsets = seqRuleOffsetsBuffer.GetSpan(); reader.ReadUInt16Array(seqRuleOffsets); - var subRules = new ClassSequenceRuleTable[seqRuleCount]; + ClassSequenceRuleTable[] subRules = new ClassSequenceRuleTable[seqRuleCount]; for (int i = 0; i < subRules.Length; i++) { subRules[i] = ClassSequenceRuleTable.Load(reader, offset + seqRuleOffsets[i]); diff --git a/src/SixLabors.Fonts/Tables/AdvancedTypographic/CoverageTable.cs b/src/SixLabors.Fonts/Tables/AdvancedTypographic/CoverageTable.cs index b0839cb17..a613200e9 100644 --- a/src/SixLabors.Fonts/Tables/AdvancedTypographic/CoverageTable.cs +++ b/src/SixLabors.Fonts/Tables/AdvancedTypographic/CoverageTable.cs @@ -29,7 +29,7 @@ public static CoverageTable Load(BigEndianBinaryReader reader, long offset) public static CoverageTable[] LoadArray(BigEndianBinaryReader reader, long offset, ReadOnlySpan coverageOffsets) { - var tables = new CoverageTable[coverageOffsets.Length]; + CoverageTable[] tables = new CoverageTable[coverageOffsets.Length]; for (int i = 0; i < tables.Length; i++) { tables[i] = Load(reader, offset + coverageOffsets[i]); @@ -103,7 +103,7 @@ public static CoverageFormat2Table Load(BigEndianBinaryReader reader) // | RangeRecord | rangeRecords[rangeCount] | Array of glyph ranges — ordered by startGlyphID. | // +-------------+--------------------------+--------------------------------------------------+ ushort rangeCount = reader.ReadUInt16(); - var records = new CoverageRangeRecord[rangeCount]; + CoverageRangeRecord[] records = new CoverageRangeRecord[rangeCount]; for (int i = 0; i < records.Length; i++) { diff --git a/src/SixLabors.Fonts/Tables/AdvancedTypographic/FeatureListTable.cs b/src/SixLabors.Fonts/Tables/AdvancedTypographic/FeatureListTable.cs index ba6f5d44f..69ab299e9 100644 --- a/src/SixLabors.Fonts/Tables/AdvancedTypographic/FeatureListTable.cs +++ b/src/SixLabors.Fonts/Tables/AdvancedTypographic/FeatureListTable.cs @@ -33,7 +33,7 @@ public static FeatureListTable Load(BigEndianBinaryReader reader, long offset) reader.Seek(offset, SeekOrigin.Begin); ushort featureCount = reader.ReadUInt16(); - var featureRecords = new FeatureRecord[featureCount]; + FeatureRecord[] featureRecords = new FeatureRecord[featureCount]; for (int i = 0; i < featureRecords.Length; i++) { // FeatureRecord @@ -51,7 +51,7 @@ public static FeatureListTable Load(BigEndianBinaryReader reader, long offset) // Load the other table features. // We do this last to avoid excessive seeking. - var featureTables = new FeatureTable[featureCount]; + FeatureTable[] featureTables = new FeatureTable[featureCount]; for (int i = 0; i < featureTables.Length; i++) { FeatureRecord featureRecord = featureRecords[i]; diff --git a/src/SixLabors.Fonts/Tables/AdvancedTypographic/GPos/AnchorTable.cs b/src/SixLabors.Fonts/Tables/AdvancedTypographic/GPos/AnchorTable.cs index bc12a7722..c624963ae 100644 --- a/src/SixLabors.Fonts/Tables/AdvancedTypographic/GPos/AnchorTable.cs +++ b/src/SixLabors.Fonts/Tables/AdvancedTypographic/GPos/AnchorTable.cs @@ -128,13 +128,13 @@ public override AnchorXY GetAnchor(FontMetrics fontMetrics, GlyphShapingData dat if (this.anchorPointIndex < points.Count) { Vector2 point = points[this.anchorPointIndex].Point; - return new((short)point.X, (short)point.Y); + return new AnchorXY((short)point.X, (short)point.Y); } } } } - return new(this.XCoordinate, this.YCoordinate); + return new AnchorXY(this.XCoordinate, this.YCoordinate); } } diff --git a/src/SixLabors.Fonts/Tables/AdvancedTypographic/GPos/Class1Record.cs b/src/SixLabors.Fonts/Tables/AdvancedTypographic/GPos/Class1Record.cs index 27cbd260a..5ab8641b5 100644 --- a/src/SixLabors.Fonts/Tables/AdvancedTypographic/GPos/Class1Record.cs +++ b/src/SixLabors.Fonts/Tables/AdvancedTypographic/GPos/Class1Record.cs @@ -17,7 +17,7 @@ public static Class1Record Load(BigEndianBinaryReader reader, int class2Count, V // | Class2Record | class2Records[class2Count] | Array of Class2 records, ordered by classes | // | | | in classDef2. | // +--------------+----------------------------+---------------------------------------------+ - var class2Records = new Class2Record[class2Count]; + Class2Record[] class2Records = new Class2Record[class2Count]; for (int i = 0; i < class2Records.Length; i++) { class2Records[i] = new Class2Record(reader, valueFormat1, valueFormat2); diff --git a/src/SixLabors.Fonts/Tables/AdvancedTypographic/GPos/LookupListTable.cs b/src/SixLabors.Fonts/Tables/AdvancedTypographic/GPos/LookupListTable.cs index 2b65f424b..29a3b1fd3 100644 --- a/src/SixLabors.Fonts/Tables/AdvancedTypographic/GPos/LookupListTable.cs +++ b/src/SixLabors.Fonts/Tables/AdvancedTypographic/GPos/LookupListTable.cs @@ -38,7 +38,7 @@ public static LookupListTable Load(BigEndianBinaryReader reader, long offset) Span lookupOffsets = lookupOffsetsBuffer.GetSpan(); reader.ReadUInt16Array(lookupOffsets); - var lookupTables = new LookupTable[lookupCount]; + LookupTable[] lookupTables = new LookupTable[lookupCount]; for (int i = 0; i < lookupTables.Length; i++) { @@ -111,7 +111,7 @@ public static LookupTable Load(BigEndianBinaryReader reader, long offset) ? reader.ReadUInt16() : (ushort)0; - var lookupSubTables = new LookupSubTable[subTableCount]; + LookupSubTable[] lookupSubTables = new LookupSubTable[subTableCount]; for (int i = 0; i < lookupSubTables.Length; i++) { diff --git a/src/SixLabors.Fonts/Tables/AdvancedTypographic/GPos/LookupType1SubTable.cs b/src/SixLabors.Fonts/Tables/AdvancedTypographic/GPos/LookupType1SubTable.cs index e5307d754..f120dc5f7 100644 --- a/src/SixLabors.Fonts/Tables/AdvancedTypographic/GPos/LookupType1SubTable.cs +++ b/src/SixLabors.Fonts/Tables/AdvancedTypographic/GPos/LookupType1SubTable.cs @@ -56,9 +56,9 @@ public static LookupType1Format1SubTable Load(BigEndianBinaryReader reader, long // +-------------+----------------+-----------------------------------------------+ ushort coverageOffset = reader.ReadOffset16(); ValueFormat valueFormat = reader.ReadUInt16(); - var valueRecord = new ValueRecord(reader, valueFormat); + ValueRecord valueRecord = new(reader, valueFormat); - var coverageTable = CoverageTable.Load(reader, offset + coverageOffset); + CoverageTable coverageTable = CoverageTable.Load(reader, offset + coverageOffset); return new LookupType1Format1SubTable(valueRecord, coverageTable, lookupFlags); } @@ -123,13 +123,13 @@ public static LookupType1Format2SubTable Load(BigEndianBinaryReader reader, long ushort coverageOffset = reader.ReadOffset16(); ValueFormat valueFormat = reader.ReadUInt16(); ushort valueCount = reader.ReadUInt16(); - var valueRecords = new ValueRecord[valueCount]; + ValueRecord[] valueRecords = new ValueRecord[valueCount]; for (int i = 0; i < valueCount; i++) { valueRecords[i] = new ValueRecord(reader, valueFormat); } - var coverageTable = CoverageTable.Load(reader, offset + coverageOffset); + CoverageTable coverageTable = CoverageTable.Load(reader, offset + coverageOffset); return new LookupType1Format2SubTable(valueRecords, coverageTable, lookupFlags); } diff --git a/src/SixLabors.Fonts/Tables/AdvancedTypographic/GPos/LookupType2SubTable.cs b/src/SixLabors.Fonts/Tables/AdvancedTypographic/GPos/LookupType2SubTable.cs index ecf296a74..b626c6f6b 100644 --- a/src/SixLabors.Fonts/Tables/AdvancedTypographic/GPos/LookupType2SubTable.cs +++ b/src/SixLabors.Fonts/Tables/AdvancedTypographic/GPos/LookupType2SubTable.cs @@ -73,14 +73,14 @@ public static LookupType2Format1SubTable Load(BigEndianBinaryReader reader, long Span pairSetOffsets = pairSetOffsetsBuffer.GetSpan(); reader.ReadUInt16Array(pairSetOffsets); - var pairSets = new PairSetTable[pairSetCount]; + PairSetTable[] pairSets = new PairSetTable[pairSetCount]; for (int i = 0; i < pairSetCount; i++) { reader.Seek(offset + pairSetOffsets[i], SeekOrigin.Begin); pairSets[i] = PairSetTable.Load(reader, offset + pairSetOffsets[i], valueFormat1, valueFormat2); } - var coverageTable = CoverageTable.Load(reader, offset + coverageOffset); + CoverageTable coverageTable = CoverageTable.Load(reader, offset + coverageOffset); return new LookupType2Format1SubTable(coverageTable, pairSets, lookupFlags); } @@ -148,7 +148,7 @@ public static PairSetTable Load(BigEndianBinaryReader reader, long offset, Value // +-----------------+----------------------------------+---------------------------------------+ reader.Seek(offset, SeekOrigin.Begin); ushort pairValueCount = reader.ReadUInt16(); - var pairValueRecords = new PairValueRecord[pairValueCount]; + PairValueRecord[] pairValueRecords = new PairValueRecord[pairValueCount]; for (int i = 0; i < pairValueRecords.Length; i++) { pairValueRecords[i] = new PairValueRecord(reader, valueFormat1, valueFormat2); @@ -237,15 +237,15 @@ public static LookupType2Format2SubTable Load(BigEndianBinaryReader reader, long ushort class1Count = reader.ReadUInt16(); ushort class2Count = reader.ReadUInt16(); - var class1Records = new Class1Record[class1Count]; + Class1Record[] class1Records = new Class1Record[class1Count]; for (int i = 0; i < class1Records.Length; i++) { class1Records[i] = Class1Record.Load(reader, class2Count, valueFormat1, valueFormat2); } - var coverageTable = CoverageTable.Load(reader, offset + coverageOffset); - var classDefTable1 = ClassDefinitionTable.Load(reader, offset + classDef1Offset); - var classDefTable2 = ClassDefinitionTable.Load(reader, offset + classDef2Offset); + CoverageTable coverageTable = CoverageTable.Load(reader, offset + coverageOffset); + ClassDefinitionTable classDefTable1 = ClassDefinitionTable.Load(reader, offset + classDef1Offset); + ClassDefinitionTable classDefTable2 = ClassDefinitionTable.Load(reader, offset + classDef2Offset); return new LookupType2Format2SubTable(coverageTable, class1Records, classDefTable1, classDefTable2, lookupFlags); } diff --git a/src/SixLabors.Fonts/Tables/AdvancedTypographic/GPos/LookupType3SubTable.cs b/src/SixLabors.Fonts/Tables/AdvancedTypographic/GPos/LookupType3SubTable.cs index 8909bfbab..e30896dbd 100644 --- a/src/SixLabors.Fonts/Tables/AdvancedTypographic/GPos/LookupType3SubTable.cs +++ b/src/SixLabors.Fonts/Tables/AdvancedTypographic/GPos/LookupType3SubTable.cs @@ -53,19 +53,19 @@ public static LookupType3Format1SubTable Load(BigEndianBinaryReader reader, long // +--------------------+---------------------------------+------------------------------------------------------+ ushort coverageOffset = reader.ReadOffset16(); ushort entryExitCount = reader.ReadUInt16(); - var entryExitRecords = new EntryExitRecord[entryExitCount]; + EntryExitRecord[] entryExitRecords = new EntryExitRecord[entryExitCount]; for (int i = 0; i < entryExitCount; i++) { entryExitRecords[i] = new EntryExitRecord(reader, offset); } - var entryExitAnchors = new EntryExitAnchors[entryExitCount]; + EntryExitAnchors[] entryExitAnchors = new EntryExitAnchors[entryExitCount]; for (int i = 0; i < entryExitCount; i++) { entryExitAnchors[i] = new EntryExitAnchors(reader, offset, entryExitRecords[i]); } - var coverageTable = CoverageTable.Load(reader, offset + coverageOffset); + CoverageTable coverageTable = CoverageTable.Load(reader, offset + coverageOffset); return new LookupType3Format1SubTable(coverageTable, entryExitAnchors, lookupFlags); } diff --git a/src/SixLabors.Fonts/Tables/AdvancedTypographic/GPos/LookupType4SubTable.cs b/src/SixLabors.Fonts/Tables/AdvancedTypographic/GPos/LookupType4SubTable.cs index 24a05cb39..b7b8d3fae 100644 --- a/src/SixLabors.Fonts/Tables/AdvancedTypographic/GPos/LookupType4SubTable.cs +++ b/src/SixLabors.Fonts/Tables/AdvancedTypographic/GPos/LookupType4SubTable.cs @@ -71,10 +71,10 @@ public static LookupType4Format1SubTable Load(BigEndianBinaryReader reader, long ushort markArrayOffset = reader.ReadOffset16(); ushort baseArrayOffset = reader.ReadOffset16(); - var markCoverage = CoverageTable.Load(reader, offset + markCoverageOffset); - var baseCoverage = CoverageTable.Load(reader, offset + baseCoverageOffset); - var markArrayTable = new MarkArrayTable(reader, offset + markArrayOffset); - var baseArrayTable = new BaseArrayTable(reader, offset + baseArrayOffset, markClassCount); + CoverageTable markCoverage = CoverageTable.Load(reader, offset + markCoverageOffset); + CoverageTable baseCoverage = CoverageTable.Load(reader, offset + baseCoverageOffset); + MarkArrayTable markArrayTable = new(reader, offset + markArrayOffset); + BaseArrayTable baseArrayTable = new(reader, offset + baseArrayOffset, markClassCount); return new LookupType4Format1SubTable(markCoverage, baseCoverage, markArrayTable, baseArrayTable, lookupFlags); } diff --git a/src/SixLabors.Fonts/Tables/AdvancedTypographic/GPos/LookupType5SubTable.cs b/src/SixLabors.Fonts/Tables/AdvancedTypographic/GPos/LookupType5SubTable.cs index 4db3872e6..925cf79c1 100644 --- a/src/SixLabors.Fonts/Tables/AdvancedTypographic/GPos/LookupType5SubTable.cs +++ b/src/SixLabors.Fonts/Tables/AdvancedTypographic/GPos/LookupType5SubTable.cs @@ -74,10 +74,10 @@ public static LookupType5Format1SubTable Load(BigEndianBinaryReader reader, long ushort markArrayOffset = reader.ReadOffset16(); ushort ligatureArrayOffset = reader.ReadOffset16(); - var markCoverage = CoverageTable.Load(reader, offset + markCoverageOffset); - var ligatureCoverage = CoverageTable.Load(reader, offset + ligatureCoverageOffset); - var markArrayTable = new MarkArrayTable(reader, offset + markArrayOffset); - var ligatureArrayTable = new LigatureArrayTable(reader, offset + ligatureArrayOffset, markClassCount); + CoverageTable markCoverage = CoverageTable.Load(reader, offset + markCoverageOffset); + CoverageTable ligatureCoverage = CoverageTable.Load(reader, offset + ligatureCoverageOffset); + MarkArrayTable markArrayTable = new(reader, offset + markArrayOffset); + LigatureArrayTable ligatureArrayTable = new(reader, offset + ligatureArrayOffset, markClassCount); return new LookupType5Format1SubTable(markCoverage, ligatureCoverage, markArrayTable, ligatureArrayTable, lookupFlags); } diff --git a/src/SixLabors.Fonts/Tables/AdvancedTypographic/GPos/LookupType6SubTable.cs b/src/SixLabors.Fonts/Tables/AdvancedTypographic/GPos/LookupType6SubTable.cs index 2bc1f6d6e..1bfab19ce 100644 --- a/src/SixLabors.Fonts/Tables/AdvancedTypographic/GPos/LookupType6SubTable.cs +++ b/src/SixLabors.Fonts/Tables/AdvancedTypographic/GPos/LookupType6SubTable.cs @@ -73,10 +73,10 @@ public static LookupType6Format1SubTable Load(BigEndianBinaryReader reader, long ushort mark1ArrayOffset = reader.ReadOffset16(); ushort mark2ArrayOffset = reader.ReadOffset16(); - var mark1Coverage = CoverageTable.Load(reader, offset + mark1CoverageOffset); - var mark2Coverage = CoverageTable.Load(reader, offset + mark2CoverageOffset); - var mark1ArrayTable = new MarkArrayTable(reader, offset + mark1ArrayOffset); - var mark2ArrayTable = new Mark2ArrayTable(reader, markClassCount, offset + mark2ArrayOffset); + CoverageTable mark1Coverage = CoverageTable.Load(reader, offset + mark1CoverageOffset); + CoverageTable mark2Coverage = CoverageTable.Load(reader, offset + mark2CoverageOffset); + MarkArrayTable mark1ArrayTable = new(reader, offset + mark1ArrayOffset); + Mark2ArrayTable mark2ArrayTable = new(reader, markClassCount, offset + mark2ArrayOffset); return new LookupType6Format1SubTable(mark1Coverage, mark2Coverage, mark1ArrayTable, mark2ArrayTable, lookupFlags); } diff --git a/src/SixLabors.Fonts/Tables/AdvancedTypographic/GPosTable.cs b/src/SixLabors.Fonts/Tables/AdvancedTypographic/GPosTable.cs index 7a2759b7e..c3cad8411 100644 --- a/src/SixLabors.Fonts/Tables/AdvancedTypographic/GPosTable.cs +++ b/src/SixLabors.Fonts/Tables/AdvancedTypographic/GPosTable.cs @@ -89,11 +89,11 @@ internal static GPosTable Load(BigEndianBinaryReader reader) uint featureVariationsOffset = (minorVersion == 1) ? reader.ReadOffset32() : 0; // TODO: Optimization. Allow only reading the scriptList. - var scriptList = ScriptList.Load(reader, scriptListOffset); + ScriptList? scriptList = ScriptList.Load(reader, scriptListOffset); - var featureList = FeatureListTable.Load(reader, featureListOffset); + FeatureListTable featureList = FeatureListTable.Load(reader, featureListOffset); - var lookupList = LookupListTable.Load(reader, lookupListOffset); + LookupListTable lookupList = LookupListTable.Load(reader, lookupListOffset); // TODO: Feature Variations. return new GPosTable(scriptList, featureList, lookupList); @@ -272,7 +272,7 @@ private Tag GetUnicodeScriptTag(ScriptClass script) private List<(Tag Feature, ushort Index, LookupTable LookupTable)> GetFeatureLookups(in Tag stageFeature, params LangSysTable[] langSysTables) { - List<(Tag Feature, ushort Index, LookupTable LookupTable)> lookups = new(); + List<(Tag Feature, ushort Index, LookupTable LookupTable)> lookups = []; for (int i = 0; i < langSysTables.Length; i++) { ushort[] featureIndices = langSysTables[i].FeatureIndices; @@ -291,7 +291,7 @@ private Tag GetUnicodeScriptTag(ScriptClass script) { ushort lookupIndex = lookupListIndices[k]; LookupTable lookupTable = this.LookupList.LookupTables[lookupIndex]; - lookups.Add(new(feature, lookupIndex, lookupTable)); + lookups.Add(new ValueTuple(feature, lookupIndex, lookupTable)); } } } diff --git a/src/SixLabors.Fonts/Tables/AdvancedTypographic/GSub/LookupListTable.cs b/src/SixLabors.Fonts/Tables/AdvancedTypographic/GSub/LookupListTable.cs index f924aa2df..d4e3a94a3 100644 --- a/src/SixLabors.Fonts/Tables/AdvancedTypographic/GSub/LookupListTable.cs +++ b/src/SixLabors.Fonts/Tables/AdvancedTypographic/GSub/LookupListTable.cs @@ -38,7 +38,7 @@ public static LookupListTable Load(BigEndianBinaryReader reader, long offset) Span lookupOffsets = lookupOffsetsBuffer.GetSpan(); reader.ReadUInt16Array(lookupOffsets); - var lookupTables = new LookupTable[lookupCount]; + LookupTable[] lookupTables = new LookupTable[lookupCount]; for (int i = 0; i < lookupTables.Length; i++) { @@ -111,7 +111,7 @@ public static LookupTable Load(BigEndianBinaryReader reader, long offset) ? reader.ReadUInt16() : (ushort)0; - var lookupSubTables = new LookupSubTable[subTableCount]; + LookupSubTable[] lookupSubTables = new LookupSubTable[subTableCount]; for (int i = 0; i < lookupSubTables.Length; i++) { diff --git a/src/SixLabors.Fonts/Tables/AdvancedTypographic/GSub/LookupType1SubTable.cs b/src/SixLabors.Fonts/Tables/AdvancedTypographic/GSub/LookupType1SubTable.cs index 81ebdf260..01442e336 100644 --- a/src/SixLabors.Fonts/Tables/AdvancedTypographic/GSub/LookupType1SubTable.cs +++ b/src/SixLabors.Fonts/Tables/AdvancedTypographic/GSub/LookupType1SubTable.cs @@ -53,7 +53,7 @@ public static LookupType1Format1SubTable Load(BigEndianBinaryReader reader, long // +----------+----------------+----------------------------------------------------------+ ushort coverageOffset = reader.ReadOffset16(); ushort deltaGlyphId = reader.ReadUInt16(); - var coverageTable = CoverageTable.Load(reader, offset + coverageOffset); + CoverageTable coverageTable = CoverageTable.Load(reader, offset + coverageOffset); return new LookupType1Format1SubTable(deltaGlyphId, coverageTable, lookupFlags); } @@ -112,7 +112,7 @@ public static LookupType1Format2SubTable Load(BigEndianBinaryReader reader, long ushort coverageOffset = reader.ReadOffset16(); ushort glyphCount = reader.ReadUInt16(); ushort[] substituteGlyphIds = reader.ReadUInt16Array(glyphCount); - var coverageTable = CoverageTable.Load(reader, offset + coverageOffset); + CoverageTable coverageTable = CoverageTable.Load(reader, offset + coverageOffset); return new LookupType1Format2SubTable(substituteGlyphIds, coverageTable, lookupFlags); } diff --git a/src/SixLabors.Fonts/Tables/AdvancedTypographic/GSub/LookupType2SubTable.cs b/src/SixLabors.Fonts/Tables/AdvancedTypographic/GSub/LookupType2SubTable.cs index d01b076ae..633c21f06 100644 --- a/src/SixLabors.Fonts/Tables/AdvancedTypographic/GSub/LookupType2SubTable.cs +++ b/src/SixLabors.Fonts/Tables/AdvancedTypographic/GSub/LookupType2SubTable.cs @@ -58,7 +58,7 @@ public static LookupType2Format1SubTable Load(BigEndianBinaryReader reader, long Span sequenceOffsets = sequenceOffsetsBuffer.GetSpan(); reader.ReadUInt16Array(sequenceOffsets); - var sequenceTables = new SequenceTable[sequenceCount]; + SequenceTable[] sequenceTables = new SequenceTable[sequenceCount]; for (int i = 0; i < sequenceTables.Length; i++) { // Sequence Table @@ -75,7 +75,7 @@ public static LookupType2Format1SubTable Load(BigEndianBinaryReader reader, long sequenceTables[i] = new SequenceTable(reader.ReadUInt16Array(glyphCount)); } - var coverageTable = CoverageTable.Load(reader, offset + coverageOffset); + CoverageTable coverageTable = CoverageTable.Load(reader, offset + coverageOffset); return new LookupType2Format1SubTable(sequenceTables, coverageTable, lookupFlags); } diff --git a/src/SixLabors.Fonts/Tables/AdvancedTypographic/GSub/LookupType3SubTable.cs b/src/SixLabors.Fonts/Tables/AdvancedTypographic/GSub/LookupType3SubTable.cs index 60c79d998..7ce27008f 100644 --- a/src/SixLabors.Fonts/Tables/AdvancedTypographic/GSub/LookupType3SubTable.cs +++ b/src/SixLabors.Fonts/Tables/AdvancedTypographic/GSub/LookupType3SubTable.cs @@ -58,7 +58,7 @@ public static LookupType3Format1SubTable Load(BigEndianBinaryReader reader, long Span alternateSetOffsets = alternateSetOffsetsBuffer.GetSpan(); reader.ReadUInt16Array(alternateSetOffsets); - var alternateTables = new AlternateSetTable[alternateSetCount]; + AlternateSetTable[] alternateTables = new AlternateSetTable[alternateSetCount]; for (int i = 0; i < alternateTables.Length; i++) { // AlternateSet Table @@ -74,7 +74,7 @@ public static LookupType3Format1SubTable Load(BigEndianBinaryReader reader, long alternateTables[i] = new AlternateSetTable(reader.ReadUInt16Array(glyphCount)); } - var coverageTable = CoverageTable.Load(reader, offset + coverageOffset); + CoverageTable coverageTable = CoverageTable.Load(reader, offset + coverageOffset); return new LookupType3Format1SubTable(alternateTables, coverageTable, lookupFlags); } diff --git a/src/SixLabors.Fonts/Tables/AdvancedTypographic/GSub/LookupType4SubTable.cs b/src/SixLabors.Fonts/Tables/AdvancedTypographic/GSub/LookupType4SubTable.cs index 896c74eb4..4dc278aff 100644 --- a/src/SixLabors.Fonts/Tables/AdvancedTypographic/GSub/LookupType4SubTable.cs +++ b/src/SixLabors.Fonts/Tables/AdvancedTypographic/GSub/LookupType4SubTable.cs @@ -59,7 +59,7 @@ public static LookupType4Format1SubTable Load(BigEndianBinaryReader reader, long Span ligatureSetOffsets = ligatureSetOffsetsBuffer.GetSpan(); reader.ReadUInt16Array(ligatureSetOffsets); - var ligatureSetTables = new LigatureSetTable[ligatureSetCount]; + LigatureSetTable[] ligatureSetTables = new LigatureSetTable[ligatureSetCount]; for (int i = 0; i < ligatureSetTables.Length; i++) { // LigatureSet Table @@ -79,7 +79,7 @@ public static LookupType4Format1SubTable Load(BigEndianBinaryReader reader, long Span ligatureOffsets = ligatureOffsetsBuffer.GetSpan(); reader.ReadUInt16Array(ligatureOffsets); - var ligatureTables = new LigatureTable[ligatureCount]; + LigatureTable[] ligatureTables = new LigatureTable[ligatureCount]; // Ligature Table // +--------+---------------------------------------+------------------------------------------------------+ @@ -104,7 +104,7 @@ public static LookupType4Format1SubTable Load(BigEndianBinaryReader reader, long ligatureSetTables[i] = new LigatureSetTable(ligatureTables); } - var coverageTable = CoverageTable.Load(reader, offset + coverageOffset); + CoverageTable coverageTable = CoverageTable.Load(reader, offset + coverageOffset); return new LookupType4Format1SubTable(ligatureSetTables, coverageTable, lookupFlags); } diff --git a/src/SixLabors.Fonts/Tables/AdvancedTypographic/GSub/LookupType8SubTable.cs b/src/SixLabors.Fonts/Tables/AdvancedTypographic/GSub/LookupType8SubTable.cs index ec009404b..24c66adc1 100644 --- a/src/SixLabors.Fonts/Tables/AdvancedTypographic/GSub/LookupType8SubTable.cs +++ b/src/SixLabors.Fonts/Tables/AdvancedTypographic/GSub/LookupType8SubTable.cs @@ -88,7 +88,7 @@ public static LookupType8Format1SubTable Load(BigEndianBinaryReader reader, long ushort glyphCount = reader.ReadUInt16(); ushort[] substituteGlyphIds = reader.ReadUInt16Array(glyphCount); - var coverageTable = CoverageTable.Load(reader, offset + coverageOffset); + CoverageTable coverageTable = CoverageTable.Load(reader, offset + coverageOffset); CoverageTable[] backtrackCoverageTables = CoverageTable.LoadArray(reader, offset, backtrackCoverageOffsets); CoverageTable[] lookaheadCoverageTables = CoverageTable.LoadArray(reader, offset, lookaheadCoverageOffsets); diff --git a/src/SixLabors.Fonts/Tables/AdvancedTypographic/GSubTable.cs b/src/SixLabors.Fonts/Tables/AdvancedTypographic/GSubTable.cs index 590f5ccd0..79c9be776 100644 --- a/src/SixLabors.Fonts/Tables/AdvancedTypographic/GSubTable.cs +++ b/src/SixLabors.Fonts/Tables/AdvancedTypographic/GSubTable.cs @@ -85,11 +85,11 @@ internal static GSubTable Load(BigEndianBinaryReader reader) uint featureVariationsOffset = (minorVersion == 1) ? reader.ReadOffset32() : 0; // TODO: Optimization. Allow only reading the scriptList. - var scriptList = ScriptList.Load(reader, scriptListOffset); + ScriptList? scriptList = ScriptList.Load(reader, scriptListOffset); - var featureList = FeatureListTable.Load(reader, featureListOffset); + FeatureListTable featureList = FeatureListTable.Load(reader, featureListOffset); - var lookupList = LookupListTable.Load(reader, lookupListOffset); + LookupListTable lookupList = LookupListTable.Load(reader, lookupListOffset); // TODO: Feature Variations. return new GSubTable(scriptList, featureList, lookupList); @@ -291,7 +291,7 @@ private Tag GetUnicodeScriptTag(ScriptClass script) private List<(Tag Feature, ushort Index, LookupTable LookupTable)> GetFeatureLookups(in Tag stageFeature, params LangSysTable[] langSysTables) { - List<(Tag Feature, ushort Index, LookupTable LookupTable)> lookups = new(); + List<(Tag Feature, ushort Index, LookupTable LookupTable)> lookups = []; for (int i = 0; i < langSysTables.Length; i++) { ushort[] featureIndices = langSysTables[i].FeatureIndices; @@ -310,7 +310,7 @@ private Tag GetUnicodeScriptTag(ScriptClass script) { ushort lookupIndex = lookupListIndices[k]; LookupTable lookupTable = this.LookupList.LookupTables[lookupIndex]; - lookups.Add(new(feature, lookupIndex, lookupTable)); + lookups.Add(new ValueTuple(feature, lookupIndex, lookupTable)); } } } diff --git a/src/SixLabors.Fonts/Tables/AdvancedTypographic/LigatureCaretList.cs b/src/SixLabors.Fonts/Tables/AdvancedTypographic/LigatureCaretList.cs index 4d064947f..ed1538863 100644 --- a/src/SixLabors.Fonts/Tables/AdvancedTypographic/LigatureCaretList.cs +++ b/src/SixLabors.Fonts/Tables/AdvancedTypographic/LigatureCaretList.cs @@ -29,7 +29,7 @@ public static LigatureCaretList Load(BigEndianBinaryReader reader, long offset) Span ligGlyphOffsets = ligGlyphOffsetsBuffer.GetSpan(); reader.ReadUInt16Array(ligGlyphOffsets); - var ligatureCaretList = new LigatureCaretList() + LigatureCaretList ligatureCaretList = new() { CoverageTable = CoverageTable.Load(reader, offset + coverageOffset) }; diff --git a/src/SixLabors.Fonts/Tables/AdvancedTypographic/LigatureGlyph.cs b/src/SixLabors.Fonts/Tables/AdvancedTypographic/LigatureGlyph.cs index 6d7ffae2f..79aca439e 100644 --- a/src/SixLabors.Fonts/Tables/AdvancedTypographic/LigatureGlyph.cs +++ b/src/SixLabors.Fonts/Tables/AdvancedTypographic/LigatureGlyph.cs @@ -12,7 +12,7 @@ public static LigatureGlyph Load(BigEndianBinaryReader reader, long offset) reader.Seek(offset, SeekOrigin.Begin); ushort caretCount = reader.ReadUInt16(); - var ligatureGlyph = new LigatureGlyph() + LigatureGlyph ligatureGlyph = new() { CaretValueOffsets = reader.ReadUInt16Array(caretCount) }; diff --git a/src/SixLabors.Fonts/Tables/AdvancedTypographic/ScriptList.cs b/src/SixLabors.Fonts/Tables/AdvancedTypographic/ScriptList.cs index da8348ba1..9f147c7ef 100644 --- a/src/SixLabors.Fonts/Tables/AdvancedTypographic/ScriptList.cs +++ b/src/SixLabors.Fonts/Tables/AdvancedTypographic/ScriptList.cs @@ -30,7 +30,7 @@ internal sealed class ScriptList : Dictionary ushort scriptCount = reader.ReadUInt16(); // Read records (tags and table offsets) - var scriptTags = new Tag[scriptCount]; + Tag[] scriptTags = new Tag[scriptCount]; ushort[] scriptOffsets = new ushort[scriptCount]; for (int i = 0; i < scriptTags.Length; i++) @@ -49,7 +49,7 @@ internal sealed class ScriptList : Dictionary scriptList = new ScriptList(scriptTag); } - var scriptTable = ScriptListTable.Load(scriptTag, reader, offset + scriptOffsets[i]); + ScriptListTable scriptTable = ScriptListTable.Load(scriptTag, reader, offset + scriptOffsets[i]); scriptList!.Add(scriptTag, scriptTable); } @@ -92,7 +92,7 @@ public static ScriptListTable Load(Tag scriptTag, BigEndianBinaryReader reader, ushort defaultLangSysOffset = reader.ReadOffset16(); ushort langSysCount = reader.ReadUInt16(); - var langSysRecords = new LangSysRecord[langSysCount]; + LangSysRecord[] langSysRecords = new LangSysRecord[langSysCount]; for (int i = 0; i < langSysRecords.Length; i++) { // LangSysRecord @@ -117,7 +117,7 @@ public static ScriptListTable Load(Tag scriptTag, BigEndianBinaryReader reader, // Load the other table features. // We do this last to avoid excessive seeking. - var langSysTables = new LangSysTable[langSysCount]; + LangSysTable[] langSysTables = new LangSysTable[langSysCount]; for (int i = 0; i < langSysTables.Length; i++) { LangSysRecord langSysRecord = langSysRecords[i]; @@ -154,7 +154,7 @@ private LangSysTable(uint langSysTag, ushort requiredFeatureIndex, ushort[] feat public ushort RequiredFeatureIndex { get; } - public ushort[] FeatureIndices { get; } = Array.Empty(); + public ushort[] FeatureIndices { get; } = []; public static LangSysTable Load(uint langSysTag, BigEndianBinaryReader reader, long offset) { diff --git a/src/SixLabors.Fonts/Tables/AdvancedTypographic/SequenceLookupRecord.cs b/src/SixLabors.Fonts/Tables/AdvancedTypographic/SequenceLookupRecord.cs index e4d444a09..845f600ab 100644 --- a/src/SixLabors.Fonts/Tables/AdvancedTypographic/SequenceLookupRecord.cs +++ b/src/SixLabors.Fonts/Tables/AdvancedTypographic/SequenceLookupRecord.cs @@ -33,7 +33,7 @@ public static SequenceLookupRecord[] LoadArray(BigEndianBinaryReader reader, int // +--------+-----------------+---------------------------------------------------+ // | uint16 | LookupListIndex | Lookup to apply to that position-zero-based. | // +--------+-----------------+---------------------------------------------------+ - var records = new SequenceLookupRecord[count]; + SequenceLookupRecord[] records = new SequenceLookupRecord[count]; for (int i = 0; i < records.Length; i++) { records[i] = new SequenceLookupRecord(reader.ReadUInt16(), reader.ReadUInt16()); diff --git a/src/SixLabors.Fonts/Tables/AdvancedTypographic/SequenceRuleSetTable.cs b/src/SixLabors.Fonts/Tables/AdvancedTypographic/SequenceRuleSetTable.cs index 2abb3f085..11c902cc3 100644 --- a/src/SixLabors.Fonts/Tables/AdvancedTypographic/SequenceRuleSetTable.cs +++ b/src/SixLabors.Fonts/Tables/AdvancedTypographic/SequenceRuleSetTable.cs @@ -28,7 +28,7 @@ public static SequenceRuleSetTable Load(BigEndianBinaryReader reader, long offse Span seqRuleOffsets = seqRuleOffsetsBuffer.GetSpan(); reader.ReadUInt16Array(seqRuleOffsets); - var sequenceRuleTables = new SequenceRuleTable[seqRuleCount]; + SequenceRuleTable[] sequenceRuleTables = new SequenceRuleTable[seqRuleCount]; for (int i = 0; i < sequenceRuleTables.Length; i++) { sequenceRuleTables[i] = SequenceRuleTable.Load(reader, offset + seqRuleOffsets[i]); diff --git a/src/SixLabors.Fonts/Tables/AdvancedTypographic/Shapers/ArabicShaper.cs b/src/SixLabors.Fonts/Tables/AdvancedTypographic/Shapers/ArabicShaper.cs index 52de0fe9b..c428ea8be 100644 --- a/src/SixLabors.Fonts/Tables/AdvancedTypographic/Shapers/ArabicShaper.cs +++ b/src/SixLabors.Fonts/Tables/AdvancedTypographic/Shapers/ArabicShaper.cs @@ -49,25 +49,25 @@ internal sealed class ArabicShaper : DefaultShaper { // # NonJoining, LeftJoining, RightJoining, DualJoining, ALAPH, DALATH RISH // State 0: prev was U, not willing to join. - { new byte[] { None, None, 0 }, new byte[] { None, Isol, 2 }, new byte[] { None, Isol, 1 }, new byte[] { None, Isol, 2 }, new byte[] { None, Isol, 1 }, new byte[] { None, Isol, 6 } }, + { [None, None, 0], [None, Isol, 2], [None, Isol, 1], [None, Isol, 2], [None, Isol, 1], [None, Isol, 6] }, // State 1: prev was R or ISOL/ALAPH, not willing to join. - { new byte[] { None, None, 0 }, new byte[] { None, Isol, 2 }, new byte[] { None, Isol, 1 }, new byte[] { None, Isol, 2 }, new byte[] { None, Fin2, 5 }, new byte[] { None, Isol, 6 } }, + { [None, None, 0], [None, Isol, 2], [None, Isol, 1], [None, Isol, 2], [None, Fin2, 5], [None, Isol, 6] }, // State 2: prev was D/L in ISOL form, willing to join. - { new byte[] { None, None, 0 }, new byte[] { None, Isol, 2 }, new byte[] { Init, Fina, 1 }, new byte[] { Init, Fina, 3 }, new byte[] { Init, Fina, 4 }, new byte[] { Init, Fina, 6 } }, + { [None, None, 0], [None, Isol, 2], [Init, Fina, 1], [Init, Fina, 3], [Init, Fina, 4], [Init, Fina, 6] }, // State 3: prev was D in FINA form, willing to join. - { new byte[] { None, None, 0 }, new byte[] { None, Isol, 2 }, new byte[] { Medi, Fina, 1 }, new byte[] { Medi, Fina, 3 }, new byte[] { Medi, Fina, 4 }, new byte[] { Medi, Fina, 6 } }, + { [None, None, 0], [None, Isol, 2], [Medi, Fina, 1], [Medi, Fina, 3], [Medi, Fina, 4], [Medi, Fina, 6] }, // State 4: prev was FINA ALAPH, not willing to join. - { new byte[] { None, None, 0 }, new byte[] { None, Isol, 2 }, new byte[] { Med2, Isol, 1 }, new byte[] { Med2, Isol, 2 }, new byte[] { Med2, Fin2, 5 }, new byte[] { Med2, Isol, 6 } }, + { [None, None, 0], [None, Isol, 2], [Med2, Isol, 1], [Med2, Isol, 2], [Med2, Fin2, 5], [Med2, Isol, 6] }, // State 5: prev was FIN2/FIN3 ALAPH, not willing to join. - { new byte[] { None, None, 0 }, new byte[] { None, Isol, 2 }, new byte[] { Isol, Isol, 1 }, new byte[] { Isol, Isol, 2 }, new byte[] { Isol, Fin2, 5 }, new byte[] { Isol, Isol, 6 } }, + { [None, None, 0], [None, Isol, 2], [Isol, Isol, 1], [Isol, Isol, 2], [Isol, Fin2, 5], [Isol, Isol, 6] }, // State 6: prev was DALATH/RISH, not willing to join. - { new byte[] { None, None, 0 }, new byte[] { None, Isol, 2 }, new byte[] { None, Isol, 1 }, new byte[] { None, Isol, 2 }, new byte[] { None, Fin3, 5 }, new byte[] { None, Isol, 6 } }, + { [None, None, 0], [None, Isol, 2], [None, Isol, 1], [None, Isol, 2], [None, Fin3, 5], [None, Isol, 6] }, }; public ArabicShaper(ScriptClass script, TextOptions textOptions) diff --git a/src/SixLabors.Fonts/Tables/AdvancedTypographic/Shapers/DefaultShaper.cs b/src/SixLabors.Fonts/Tables/AdvancedTypographic/Shapers/DefaultShaper.cs index 2bc857cfa..8a0f1c3c7 100644 --- a/src/SixLabors.Fonts/Tables/AdvancedTypographic/Shapers/DefaultShaper.cs +++ b/src/SixLabors.Fonts/Tables/AdvancedTypographic/Shapers/DefaultShaper.cs @@ -57,7 +57,7 @@ internal class DefaultShaper : BaseShaper private static readonly CodePoint Slash = new(0x002F); - private readonly HashSet shapingStages = new(); + private readonly HashSet shapingStages = []; private readonly KerningMode kerningMode; diff --git a/src/SixLabors.Fonts/Tables/AdvancedTypographic/Shapers/HangulShaper.cs b/src/SixLabors.Fonts/Tables/AdvancedTypographic/Shapers/HangulShaper.cs index 32dec1314..f74192433 100644 --- a/src/SixLabors.Fonts/Tables/AdvancedTypographic/Shapers/HangulShaper.cs +++ b/src/SixLabors.Fonts/Tables/AdvancedTypographic/Shapers/HangulShaper.cs @@ -52,16 +52,16 @@ internal sealed class HangulShaper : DefaultShaper { // # X L V T LV LVT M // State 0: start state - { new byte[] { None, 0 }, new byte[] { None, 1 }, new byte[] { None, 0 }, new byte[] { None, 0 }, new byte[] { Decompose, 2 }, new byte[] { Decompose, 3 }, new byte[] { Invalid, 0 } }, + { [None, 0], [None, 1], [None, 0], [None, 0], [Decompose, 2], [Decompose, 3], [Invalid, 0] }, // State 1: - { new byte[] { None, 0 }, new byte[] { None, 1 }, new byte[] { Compose, 2 }, new byte[] { None, 0 }, new byte[] { Decompose, 2 }, new byte[] { Decompose, 3 }, new byte[] { Invalid, 0 } }, + { [None, 0], [None, 1], [Compose, 2], [None, 0], [Decompose, 2], [Decompose, 3], [Invalid, 0] }, // State 2: or - { new byte[] { None, 0 }, new byte[] { None, 1 }, new byte[] { None, 0 }, new byte[] { Compose, 3 }, new byte[] { Decompose, 2 }, new byte[] { Decompose, 3 }, new byte[] { ToneMark, 0 } }, + { [None, 0], [None, 1], [None, 0], [Compose, 3], [Decompose, 2], [Decompose, 3], [ToneMark, 0] }, // State 3: or - { new byte[] { None, 0 }, new byte[] { None, 1 }, new byte[] { None, 0 }, new byte[] { None, 0 }, new byte[] { Decompose, 2 }, new byte[] { Decompose, 3 }, new byte[] { ToneMark, 0 } }, + { [None, 0], [None, 1], [None, 0], [None, 0], [Decompose, 2], [Decompose, 3], [ToneMark, 0] }, }; public HangulShaper(ScriptClass script, TextOptions textOptions) @@ -219,9 +219,9 @@ private int DecomposeGlyph(GlyphSubstitutionCollection collection, GlyphShapingD FontMetrics metrics = data.TextRun.Font!.FontMetrics; // Don't decompose if all of the components are not available - if (!metrics.TryGetGlyphId(new(l), out ushort ljmo) || - !metrics.TryGetGlyphId(new(v), out ushort vjmo) || - (!metrics.TryGetGlyphId(new(t), out ushort tjmo) && t != TBase)) + if (!metrics.TryGetGlyphId(new CodePoint(l), out ushort ljmo) || + !metrics.TryGetGlyphId(new CodePoint(v), out ushort vjmo) || + (!metrics.TryGetGlyphId(new CodePoint(t), out ushort tjmo) && t != TBase)) { return index; } @@ -378,7 +378,7 @@ private int InsertDottedCircle(GlyphSubstitutionCollection collection, GlyphShap bool after = false; FontMetrics fontMetrics = data.TextRun.Font!.FontMetrics; - if (fontMetrics.TryGetGlyphId(new(DottedCircle), out ushort id)) + if (fontMetrics.TryGetGlyphId(new CodePoint(DottedCircle), out ushort id)) { TextAttributes textAttributes = data.TextRun.TextAttributes; TextDecorations textDecorations = data.TextRun.TextDecorations; diff --git a/src/SixLabors.Fonts/Tables/AdvancedTypographic/Shapers/IndicShaper.cs b/src/SixLabors.Fonts/Tables/AdvancedTypographic/Shapers/IndicShaper.cs index 5f4a0c4ef..54fbd99ba 100644 --- a/src/SixLabors.Fonts/Tables/AdvancedTypographic/Shapers/IndicShaper.cs +++ b/src/SixLabors.Fonts/Tables/AdvancedTypographic/Shapers/IndicShaper.cs @@ -124,7 +124,7 @@ protected override void AssignFeatures(IGlyphShapingCollection collection, int i substitutionCollection.Replace(i, ids, FeatureTags.GlyphCompositionDecomposition); for (int j = 0; j < decompositions.Length; j++) { - substitutionCollection[i + j].CodePoint = new(decompositions[j]); + substitutionCollection[i + j].CodePoint = new CodePoint(decompositions[j]); } } } @@ -155,7 +155,7 @@ private static void SetupSyllables(IGlyphShapingCollection collection, int index for (int i = last; i < match.StartIndex; i++) { GlyphShapingData data = substitutionCollection[i + index]; - data.IndicShapingEngineInfo = new(Categories.X, Positions.End, "non_indic_cluster", syllable); + data.IndicShapingEngineInfo = new IndicShapingEngineInfo(Categories.X, Positions.End, "non_indic_cluster", syllable); } } @@ -167,7 +167,7 @@ private static void SetupSyllables(IGlyphShapingCollection collection, int index GlyphShapingData data = substitutionCollection[i + index]; CodePoint codePoint = data.CodePoint; - data.IndicShapingEngineInfo = new( + data.IndicShapingEngineInfo = new IndicShapingEngineInfo( (Categories)(1 << IndicShapingCategory(codePoint)), (Positions)IndicShapingPosition(codePoint), match.Tags[0], @@ -183,7 +183,7 @@ private static void SetupSyllables(IGlyphShapingCollection collection, int index for (int i = last; i < count; i++) { GlyphShapingData data = substitutionCollection[i + index]; - data.IndicShapingEngineInfo = new(Categories.X, Positions.End, "non_indic_cluster", syllable); + data.IndicShapingEngineInfo = new IndicShapingEngineInfo(Categories.X, Positions.End, "non_indic_cluster", syllable); } } } @@ -212,7 +212,7 @@ private void InitialReorder(IGlyphShapingCollection collection, int index, int c GlyphShapingData data = substitutionCollection[i + index]; FontMetrics fontMetrics = data.TextRun.Font!.FontMetrics; - fontMetrics.TryGetGlyphId(new(0x0020), out ushort spc); + fontMetrics.TryGetGlyphId(new CodePoint(0x0020), out ushort spc); IndicShapingEngineInfo? info = data.IndicShapingEngineInfo; if (info?.Position == Positions.Base_C) @@ -256,7 +256,7 @@ private void InitialReorder(IGlyphShapingCollection collection, int index, int c break; } - if (dataInfo != null && type == "broken_cluster" && fontMetrics.TryGetGlyphId(new(DottedCircle), out ushort id)) + if (dataInfo != null && type == "broken_cluster" && fontMetrics.TryGetGlyphId(new CodePoint(DottedCircle), out ushort id)) { // Insert after possible Repha. int i = start; @@ -280,7 +280,7 @@ private void InitialReorder(IGlyphShapingCollection collection, int index, int c GlyphShapingData dotted = substitutionCollection[i + 1]; Categories dottedCategory = (Categories)(1 << IndicShapingCategory(dotted.CodePoint)); Positions dottedPosition = (Positions)IndicShapingPosition(dotted.CodePoint); - dotted.IndicShapingEngineInfo = new(dottedCategory, dottedPosition, dataInfo.SyllableType, dataInfo.Syllable); + dotted.IndicShapingEngineInfo = new IndicShapingEngineInfo(dottedCategory, dottedPosition, dataInfo.SyllableType, dataInfo.Syllable); end++; max++; diff --git a/src/SixLabors.Fonts/Tables/AdvancedTypographic/Shapers/UniversalShaper.cs b/src/SixLabors.Fonts/Tables/AdvancedTypographic/Shapers/UniversalShaper.cs index b5edbb1c9..4536d997e 100644 --- a/src/SixLabors.Fonts/Tables/AdvancedTypographic/Shapers/UniversalShaper.cs +++ b/src/SixLabors.Fonts/Tables/AdvancedTypographic/Shapers/UniversalShaper.cs @@ -107,7 +107,7 @@ private static void DecomposeSplitVowels(IGlyphShapingCollection collection, int substitutionCollection.Replace(i, ids, FeatureTags.GlyphCompositionDecomposition); for (int j = 0; j < decompositions.Length; j++) { - substitutionCollection[i + j].CodePoint = new(decompositions[j]); + substitutionCollection[i + j].CodePoint = new CodePoint(decompositions[j]); } } } @@ -139,7 +139,7 @@ private static void SetupSyllables(IGlyphShapingCollection collection, int index CodePoint codePoint = data.CodePoint; string category = UniversalShapingData.Categories[UnicodeData.GetUniversalShapingSymbolCount((uint)codePoint.Value)]; - data.UniversalShapingEngineInfo = new(category, match.Tags[0], syllable); + data.UniversalShapingEngineInfo = new UniversalShapingEngineInfo(category, match.Tags[0], syllable); } // Assign rphf feature @@ -238,7 +238,7 @@ private static void Reorder(IGlyphShapingCollection collection, int index, int c } FontMetrics fontMetrics = data.TextRun.Font!.FontMetrics; - if (type == "broken_cluster" && fontMetrics.TryGetGlyphId(new(DottedCircle), out ushort id)) + if (type == "broken_cluster" && fontMetrics.TryGetGlyphId(new CodePoint(DottedCircle), out ushort id)) { // Insert after possible Repha. int i = start; diff --git a/src/SixLabors.Fonts/Tables/AdvancedTypographic/TableLoadingUtils.cs b/src/SixLabors.Fonts/Tables/AdvancedTypographic/TableLoadingUtils.cs index 18d739468..f43541f05 100644 --- a/src/SixLabors.Fonts/Tables/AdvancedTypographic/TableLoadingUtils.cs +++ b/src/SixLabors.Fonts/Tables/AdvancedTypographic/TableLoadingUtils.cs @@ -29,7 +29,7 @@ internal static SequenceRuleSetTable[] LoadSequenceContextFormat1(BigEndianBinar Span seqRuleSetOffsets = seqRuleSetOffsetsBuffer.GetSpan(); reader.ReadUInt16Array(seqRuleSetOffsets); - var seqRuleSets = new SequenceRuleSetTable[seqRuleSetCount]; + SequenceRuleSetTable[] seqRuleSets = new SequenceRuleSetTable[seqRuleSetCount]; for (int i = 0; i < seqRuleSets.Length; i++) { @@ -68,7 +68,7 @@ internal static CoverageTable LoadSequenceContextFormat2(BigEndianBinaryReader r Span classSeqRuleSetOffsets = classSeqRuleSetOffsetsBuffer.GetSpan(); reader.ReadUInt16Array(classSeqRuleSetOffsets); - var coverageTable = CoverageTable.Load(reader, offset + coverageOffset); + CoverageTable coverageTable = CoverageTable.Load(reader, offset + coverageOffset); classDefTable = ClassDefinitionTable.Load(reader, offset + classDefOffset); classSeqRuleSets = new ClassSequenceRuleSetTable[classSeqRuleSetCount]; @@ -143,7 +143,7 @@ internal static ChainedSequenceRuleSetTable[] LoadChainedSequenceContextFormat1( Span chainedSeqRuleSetOffsets = chainedSeqRuleSetOffsetsBuffer.GetSpan(); reader.ReadUInt16Array(chainedSeqRuleSetOffsets); - var seqRuleSets = new ChainedSequenceRuleSetTable[chainedSeqRuleSetCount]; + ChainedSequenceRuleSetTable[] seqRuleSets = new ChainedSequenceRuleSetTable[chainedSeqRuleSetCount]; for (int i = 0; i < seqRuleSets.Length; i++) { @@ -197,7 +197,7 @@ internal static ChainedClassSequenceRuleSetTable[] LoadChainedSequenceContextFor ushort inputClassDefOffset = reader.ReadOffset16(); ushort lookaheadClassDefOffset = reader.ReadOffset16(); ushort chainedClassSeqRuleSetCount = reader.ReadUInt16(); - ChainedClassSequenceRuleSetTable[] seqRuleSets = Array.Empty(); + ChainedClassSequenceRuleSetTable[] seqRuleSets = []; if (chainedClassSeqRuleSetCount != 0) { ushort[] chainedClassSeqRuleSetOffsets = new ushort[chainedClassSeqRuleSetCount]; diff --git a/src/SixLabors.Fonts/Tables/AdvancedTypographic/UnicodeScriptTagMap.cs b/src/SixLabors.Fonts/Tables/AdvancedTypographic/UnicodeScriptTagMap.cs index affbdd5c7..5c29a5153 100644 --- a/src/SixLabors.Fonts/Tables/AdvancedTypographic/UnicodeScriptTagMap.cs +++ b/src/SixLabors.Fonts/Tables/AdvancedTypographic/UnicodeScriptTagMap.cs @@ -27,168 +27,168 @@ private UnicodeScriptTagMap() private static UnicodeScriptTagMap CreateMap() => new() { - { ScriptClass.Unknown, new[] { Tag.Parse("zzzz") } }, - { ScriptClass.Common, new[] { Tag.Parse("zyyy") } }, - { ScriptClass.Inherited, new[] { Tag.Parse("zinh") } }, - { ScriptClass.Adlam, new[] { Tag.Parse("adlm") } }, - { ScriptClass.CaucasianAlbanian, new[] { Tag.Parse("aghb") } }, - { ScriptClass.Ahom, new[] { Tag.Parse("ahom") } }, - { ScriptClass.Arabic, new[] { Tag.Parse("arab") } }, - { ScriptClass.ImperialAramaic, new[] { Tag.Parse("armi") } }, - { ScriptClass.Armenian, new[] { Tag.Parse("armn") } }, - { ScriptClass.Avestan, new[] { Tag.Parse("avst") } }, - { ScriptClass.Balinese, new[] { Tag.Parse("bali") } }, - { ScriptClass.Bamum, new[] { Tag.Parse("bamu") } }, - { ScriptClass.BassaVah, new[] { Tag.Parse("bass") } }, - { ScriptClass.Batak, new[] { Tag.Parse("batk") } }, - { ScriptClass.Bengali, new[] { Tag.Parse("bng2"), Tag.Parse("beng") } }, - { ScriptClass.Bhaiksuki, new[] { Tag.Parse("bhks") } }, - { ScriptClass.Bopomofo, new[] { Tag.Parse("bopo") } }, - { ScriptClass.Brahmi, new[] { Tag.Parse("brah") } }, - { ScriptClass.Braille, new[] { Tag.Parse("brai") } }, - { ScriptClass.Buginese, new[] { Tag.Parse("bugi") } }, - { ScriptClass.Buhid, new[] { Tag.Parse("buhd") } }, - { ScriptClass.Chakma, new[] { Tag.Parse("cakm") } }, - { ScriptClass.CanadianAboriginal, new[] { Tag.Parse("cans") } }, - { ScriptClass.Carian, new[] { Tag.Parse("cari") } }, - { ScriptClass.Cham, new[] { Tag.Parse("cham") } }, - { ScriptClass.Cherokee, new[] { Tag.Parse("cher") } }, - { ScriptClass.Chorasmian, new[] { Tag.Parse("chrs") } }, - { ScriptClass.Coptic, new[] { Tag.Parse("copt") } }, - { ScriptClass.CyproMinoan, new[] { Tag.Parse("cpmn") } }, - { ScriptClass.Cypriot, new[] { Tag.Parse("cprt") } }, - { ScriptClass.Cyrillic, new[] { Tag.Parse("cyrl") } }, - { ScriptClass.Devanagari, new[] { Tag.Parse("dev2"), Tag.Parse("deva") } }, - { ScriptClass.DivesAkuru, new[] { Tag.Parse("diak") } }, - { ScriptClass.Dogra, new[] { Tag.Parse("dogr") } }, - { ScriptClass.Deseret, new[] { Tag.Parse("dsrt") } }, - { ScriptClass.Duployan, new[] { Tag.Parse("dupl") } }, - { ScriptClass.EgyptianHieroglyphs, new[] { Tag.Parse("egyp") } }, - { ScriptClass.Elbasan, new[] { Tag.Parse("elba") } }, - { ScriptClass.Elymaic, new[] { Tag.Parse("elym") } }, - { ScriptClass.Ethiopic, new[] { Tag.Parse("ethi") } }, - { ScriptClass.Georgian, new[] { Tag.Parse("geor") } }, - { ScriptClass.Glagolitic, new[] { Tag.Parse("glag") } }, - { ScriptClass.GunjalaGondi, new[] { Tag.Parse("gong") } }, - { ScriptClass.MasaramGondi, new[] { Tag.Parse("gonm") } }, - { ScriptClass.Gothic, new[] { Tag.Parse("goth") } }, - { ScriptClass.Grantha, new[] { Tag.Parse("gran") } }, - { ScriptClass.Greek, new[] { Tag.Parse("grek") } }, - { ScriptClass.Gujarati, new[] { Tag.Parse("gjr2"), Tag.Parse("gujr") } }, - { ScriptClass.Gurmukhi, new[] { Tag.Parse("gur2"), Tag.Parse("guru") } }, - { ScriptClass.Hangul, new[] { Tag.Parse("hang") } }, - { ScriptClass.Han, new[] { Tag.Parse("hani") } }, - { ScriptClass.Hanunoo, new[] { Tag.Parse("hano") } }, - { ScriptClass.Hatran, new[] { Tag.Parse("hatr") } }, - { ScriptClass.Hebrew, new[] { Tag.Parse("hebr") } }, - { ScriptClass.Hiragana, new[] { Tag.Parse("hira") } }, - { ScriptClass.AnatolianHieroglyphs, new[] { Tag.Parse("hluw") } }, - { ScriptClass.PahawhHmong, new[] { Tag.Parse("hmng") } }, - { ScriptClass.NyiakengPuachueHmong, new[] { Tag.Parse("hmnp") } }, - { ScriptClass.KatakanaOrHiragana, new[] { Tag.Parse("hrkt") } }, - { ScriptClass.OldHungarian, new[] { Tag.Parse("hung") } }, - { ScriptClass.OldItalic, new[] { Tag.Parse("ital") } }, - { ScriptClass.Javanese, new[] { Tag.Parse("java") } }, - { ScriptClass.KayahLi, new[] { Tag.Parse("kali") } }, - { ScriptClass.Katakana, new[] { Tag.Parse("kana") } }, - { ScriptClass.Kharoshthi, new[] { Tag.Parse("khar") } }, - { ScriptClass.Khmer, new[] { Tag.Parse("khmr") } }, - { ScriptClass.Khojki, new[] { Tag.Parse("khoj") } }, - { ScriptClass.KhitanSmallScript, new[] { Tag.Parse("kits") } }, - { ScriptClass.Kannada, new[] { Tag.Parse("knd2"), Tag.Parse("knda") } }, - { ScriptClass.Kaithi, new[] { Tag.Parse("kthi") } }, - { ScriptClass.TaiTham, new[] { Tag.Parse("lana") } }, - { ScriptClass.Lao, new[] { Tag.Parse("laoo") } }, - { ScriptClass.Latin, new[] { Tag.Parse("latn") } }, - { ScriptClass.Lepcha, new[] { Tag.Parse("lepc") } }, - { ScriptClass.Limbu, new[] { Tag.Parse("limb") } }, - { ScriptClass.LinearA, new[] { Tag.Parse("lina") } }, - { ScriptClass.LinearB, new[] { Tag.Parse("linb") } }, - { ScriptClass.Lisu, new[] { Tag.Parse("lisu") } }, - { ScriptClass.Lycian, new[] { Tag.Parse("lyci") } }, - { ScriptClass.Lydian, new[] { Tag.Parse("lydi") } }, - { ScriptClass.Mahajani, new[] { Tag.Parse("mahj") } }, - { ScriptClass.Makasar, new[] { Tag.Parse("maka") } }, - { ScriptClass.Mandaic, new[] { Tag.Parse("mand") } }, - { ScriptClass.Manichaean, new[] { Tag.Parse("mani") } }, - { ScriptClass.Marchen, new[] { Tag.Parse("marc") } }, - { ScriptClass.Medefaidrin, new[] { Tag.Parse("medf") } }, - { ScriptClass.MendeKikakui, new[] { Tag.Parse("mend") } }, - { ScriptClass.MeroiticCursive, new[] { Tag.Parse("merc") } }, - { ScriptClass.MeroiticHieroglyphs, new[] { Tag.Parse("mero") } }, - { ScriptClass.Malayalam, new[] { Tag.Parse("mlm2"), Tag.Parse("mlym") } }, - { ScriptClass.Modi, new[] { Tag.Parse("modi") } }, - { ScriptClass.Mongolian, new[] { Tag.Parse("mong") } }, - { ScriptClass.Mro, new[] { Tag.Parse("mroo") } }, - { ScriptClass.MeeteiMayek, new[] { Tag.Parse("mtei") } }, - { ScriptClass.Multani, new[] { Tag.Parse("mult") } }, - { ScriptClass.Myanmar, new[] { Tag.Parse("mym2"), Tag.Parse("mymr") } }, - { ScriptClass.Nandinagari, new[] { Tag.Parse("nand") } }, - { ScriptClass.OldNorthArabian, new[] { Tag.Parse("narb") } }, - { ScriptClass.Nabataean, new[] { Tag.Parse("nbat") } }, - { ScriptClass.Newa, new[] { Tag.Parse("newa") } }, - { ScriptClass.Nko, new[] { Tag.Parse("nkoo") } }, - { ScriptClass.Nushu, new[] { Tag.Parse("nshu") } }, - { ScriptClass.Ogham, new[] { Tag.Parse("ogam") } }, - { ScriptClass.OlChiki, new[] { Tag.Parse("olck") } }, - { ScriptClass.OldTurkic, new[] { Tag.Parse("orkh") } }, - { ScriptClass.Oriya, new[] { Tag.Parse("ory2"), Tag.Parse("orya") } }, - { ScriptClass.Osage, new[] { Tag.Parse("osge") } }, - { ScriptClass.Osmanya, new[] { Tag.Parse("osma") } }, - { ScriptClass.OldUyghur, new[] { Tag.Parse("ougr") } }, - { ScriptClass.Palmyrene, new[] { Tag.Parse("palm") } }, - { ScriptClass.PauCinHau, new[] { Tag.Parse("pauc") } }, - { ScriptClass.OldPermic, new[] { Tag.Parse("perm") } }, - { ScriptClass.PhagsPa, new[] { Tag.Parse("phag") } }, - { ScriptClass.InscriptionalPahlavi, new[] { Tag.Parse("phli") } }, - { ScriptClass.PsalterPahlavi, new[] { Tag.Parse("phlp") } }, - { ScriptClass.Phoenician, new[] { Tag.Parse("phnx") } }, - { ScriptClass.Miao, new[] { Tag.Parse("plrd") } }, - { ScriptClass.InscriptionalParthian, new[] { Tag.Parse("prti") } }, - { ScriptClass.Rejang, new[] { Tag.Parse("rjng") } }, - { ScriptClass.HanifiRohingya, new[] { Tag.Parse("rohg") } }, - { ScriptClass.Runic, new[] { Tag.Parse("runr") } }, - { ScriptClass.Samaritan, new[] { Tag.Parse("samr") } }, - { ScriptClass.OldSouthArabian, new[] { Tag.Parse("sarb") } }, - { ScriptClass.Saurashtra, new[] { Tag.Parse("saur") } }, - { ScriptClass.SignWriting, new[] { Tag.Parse("sgnw") } }, - { ScriptClass.Shavian, new[] { Tag.Parse("shaw") } }, - { ScriptClass.Sharada, new[] { Tag.Parse("shrd") } }, - { ScriptClass.Siddham, new[] { Tag.Parse("sidd") } }, - { ScriptClass.Khudawadi, new[] { Tag.Parse("sind") } }, - { ScriptClass.Sinhala, new[] { Tag.Parse("sinh") } }, - { ScriptClass.Sogdian, new[] { Tag.Parse("sogd") } }, - { ScriptClass.OldSogdian, new[] { Tag.Parse("sogo") } }, - { ScriptClass.SoraSompeng, new[] { Tag.Parse("sora") } }, - { ScriptClass.Soyombo, new[] { Tag.Parse("soyo") } }, - { ScriptClass.Sundanese, new[] { Tag.Parse("sund") } }, - { ScriptClass.SylotiNagri, new[] { Tag.Parse("sylo") } }, - { ScriptClass.Syriac, new[] { Tag.Parse("syrc") } }, - { ScriptClass.Tagbanwa, new[] { Tag.Parse("tagb") } }, - { ScriptClass.Takri, new[] { Tag.Parse("takr") } }, - { ScriptClass.TaiLe, new[] { Tag.Parse("tale") } }, - { ScriptClass.NewTaiLue, new[] { Tag.Parse("talu") } }, - { ScriptClass.Tamil, new[] { Tag.Parse("tml2"), Tag.Parse("taml") } }, - { ScriptClass.Tangut, new[] { Tag.Parse("tang") } }, - { ScriptClass.TaiViet, new[] { Tag.Parse("tavt") } }, - { ScriptClass.Telugu, new[] { Tag.Parse("tel2"), Tag.Parse("telu") } }, - { ScriptClass.Tifinagh, new[] { Tag.Parse("tfng") } }, - { ScriptClass.Tagalog, new[] { Tag.Parse("tglg") } }, - { ScriptClass.Thaana, new[] { Tag.Parse("thaa") } }, - { ScriptClass.Thai, new[] { Tag.Parse("thai") } }, - { ScriptClass.Tibetan, new[] { Tag.Parse("tibt") } }, - { ScriptClass.Tirhuta, new[] { Tag.Parse("tirh") } }, - { ScriptClass.Tangsa, new[] { Tag.Parse("tnsa") } }, - { ScriptClass.Toto, new[] { Tag.Parse("toto") } }, - { ScriptClass.Ugaritic, new[] { Tag.Parse("ugar") } }, - { ScriptClass.Vai, new[] { Tag.Parse("vaii") } }, - { ScriptClass.Vithkuqi, new[] { Tag.Parse("vith") } }, - { ScriptClass.WarangCiti, new[] { Tag.Parse("wara") } }, - { ScriptClass.Wancho, new[] { Tag.Parse("wcho") } }, - { ScriptClass.OldPersian, new[] { Tag.Parse("xpeo") } }, - { ScriptClass.Cuneiform, new[] { Tag.Parse("xsux") } }, - { ScriptClass.Yezidi, new[] { Tag.Parse("yezi") } }, - { ScriptClass.Yi, new[] { Tag.Parse("yiii") } }, - { ScriptClass.ZanabazarSquare, new[] { Tag.Parse("zanb") } }, + { ScriptClass.Unknown, [Tag.Parse("zzzz")] }, + { ScriptClass.Common, [Tag.Parse("zyyy")] }, + { ScriptClass.Inherited, [Tag.Parse("zinh")] }, + { ScriptClass.Adlam, [Tag.Parse("adlm")] }, + { ScriptClass.CaucasianAlbanian, [Tag.Parse("aghb")] }, + { ScriptClass.Ahom, [Tag.Parse("ahom")] }, + { ScriptClass.Arabic, [Tag.Parse("arab")] }, + { ScriptClass.ImperialAramaic, [Tag.Parse("armi")] }, + { ScriptClass.Armenian, [Tag.Parse("armn")] }, + { ScriptClass.Avestan, [Tag.Parse("avst")] }, + { ScriptClass.Balinese, [Tag.Parse("bali")] }, + { ScriptClass.Bamum, [Tag.Parse("bamu")] }, + { ScriptClass.BassaVah, [Tag.Parse("bass")] }, + { ScriptClass.Batak, [Tag.Parse("batk")] }, + { ScriptClass.Bengali, [Tag.Parse("bng2"), Tag.Parse("beng")] }, + { ScriptClass.Bhaiksuki, [Tag.Parse("bhks")] }, + { ScriptClass.Bopomofo, [Tag.Parse("bopo")] }, + { ScriptClass.Brahmi, [Tag.Parse("brah")] }, + { ScriptClass.Braille, [Tag.Parse("brai")] }, + { ScriptClass.Buginese, [Tag.Parse("bugi")] }, + { ScriptClass.Buhid, [Tag.Parse("buhd")] }, + { ScriptClass.Chakma, [Tag.Parse("cakm")] }, + { ScriptClass.CanadianAboriginal, [Tag.Parse("cans")] }, + { ScriptClass.Carian, [Tag.Parse("cari")] }, + { ScriptClass.Cham, [Tag.Parse("cham")] }, + { ScriptClass.Cherokee, [Tag.Parse("cher")] }, + { ScriptClass.Chorasmian, [Tag.Parse("chrs")] }, + { ScriptClass.Coptic, [Tag.Parse("copt")] }, + { ScriptClass.CyproMinoan, [Tag.Parse("cpmn")] }, + { ScriptClass.Cypriot, [Tag.Parse("cprt")] }, + { ScriptClass.Cyrillic, [Tag.Parse("cyrl")] }, + { ScriptClass.Devanagari, [Tag.Parse("dev2"), Tag.Parse("deva")] }, + { ScriptClass.DivesAkuru, [Tag.Parse("diak")] }, + { ScriptClass.Dogra, [Tag.Parse("dogr")] }, + { ScriptClass.Deseret, [Tag.Parse("dsrt")] }, + { ScriptClass.Duployan, [Tag.Parse("dupl")] }, + { ScriptClass.EgyptianHieroglyphs, [Tag.Parse("egyp")] }, + { ScriptClass.Elbasan, [Tag.Parse("elba")] }, + { ScriptClass.Elymaic, [Tag.Parse("elym")] }, + { ScriptClass.Ethiopic, [Tag.Parse("ethi")] }, + { ScriptClass.Georgian, [Tag.Parse("geor")] }, + { ScriptClass.Glagolitic, [Tag.Parse("glag")] }, + { ScriptClass.GunjalaGondi, [Tag.Parse("gong")] }, + { ScriptClass.MasaramGondi, [Tag.Parse("gonm")] }, + { ScriptClass.Gothic, [Tag.Parse("goth")] }, + { ScriptClass.Grantha, [Tag.Parse("gran")] }, + { ScriptClass.Greek, [Tag.Parse("grek")] }, + { ScriptClass.Gujarati, [Tag.Parse("gjr2"), Tag.Parse("gujr")] }, + { ScriptClass.Gurmukhi, [Tag.Parse("gur2"), Tag.Parse("guru")] }, + { ScriptClass.Hangul, [Tag.Parse("hang")] }, + { ScriptClass.Han, [Tag.Parse("hani")] }, + { ScriptClass.Hanunoo, [Tag.Parse("hano")] }, + { ScriptClass.Hatran, [Tag.Parse("hatr")] }, + { ScriptClass.Hebrew, [Tag.Parse("hebr")] }, + { ScriptClass.Hiragana, [Tag.Parse("hira")] }, + { ScriptClass.AnatolianHieroglyphs, [Tag.Parse("hluw")] }, + { ScriptClass.PahawhHmong, [Tag.Parse("hmng")] }, + { ScriptClass.NyiakengPuachueHmong, [Tag.Parse("hmnp")] }, + { ScriptClass.KatakanaOrHiragana, [Tag.Parse("hrkt")] }, + { ScriptClass.OldHungarian, [Tag.Parse("hung")] }, + { ScriptClass.OldItalic, [Tag.Parse("ital")] }, + { ScriptClass.Javanese, [Tag.Parse("java")] }, + { ScriptClass.KayahLi, [Tag.Parse("kali")] }, + { ScriptClass.Katakana, [Tag.Parse("kana")] }, + { ScriptClass.Kharoshthi, [Tag.Parse("khar")] }, + { ScriptClass.Khmer, [Tag.Parse("khmr")] }, + { ScriptClass.Khojki, [Tag.Parse("khoj")] }, + { ScriptClass.KhitanSmallScript, [Tag.Parse("kits")] }, + { ScriptClass.Kannada, [Tag.Parse("knd2"), Tag.Parse("knda")] }, + { ScriptClass.Kaithi, [Tag.Parse("kthi")] }, + { ScriptClass.TaiTham, [Tag.Parse("lana")] }, + { ScriptClass.Lao, [Tag.Parse("laoo")] }, + { ScriptClass.Latin, [Tag.Parse("latn")] }, + { ScriptClass.Lepcha, [Tag.Parse("lepc")] }, + { ScriptClass.Limbu, [Tag.Parse("limb")] }, + { ScriptClass.LinearA, [Tag.Parse("lina")] }, + { ScriptClass.LinearB, [Tag.Parse("linb")] }, + { ScriptClass.Lisu, [Tag.Parse("lisu")] }, + { ScriptClass.Lycian, [Tag.Parse("lyci")] }, + { ScriptClass.Lydian, [Tag.Parse("lydi")] }, + { ScriptClass.Mahajani, [Tag.Parse("mahj")] }, + { ScriptClass.Makasar, [Tag.Parse("maka")] }, + { ScriptClass.Mandaic, [Tag.Parse("mand")] }, + { ScriptClass.Manichaean, [Tag.Parse("mani")] }, + { ScriptClass.Marchen, [Tag.Parse("marc")] }, + { ScriptClass.Medefaidrin, [Tag.Parse("medf")] }, + { ScriptClass.MendeKikakui, [Tag.Parse("mend")] }, + { ScriptClass.MeroiticCursive, [Tag.Parse("merc")] }, + { ScriptClass.MeroiticHieroglyphs, [Tag.Parse("mero")] }, + { ScriptClass.Malayalam, [Tag.Parse("mlm2"), Tag.Parse("mlym")] }, + { ScriptClass.Modi, [Tag.Parse("modi")] }, + { ScriptClass.Mongolian, [Tag.Parse("mong")] }, + { ScriptClass.Mro, [Tag.Parse("mroo")] }, + { ScriptClass.MeeteiMayek, [Tag.Parse("mtei")] }, + { ScriptClass.Multani, [Tag.Parse("mult")] }, + { ScriptClass.Myanmar, [Tag.Parse("mym2"), Tag.Parse("mymr")] }, + { ScriptClass.Nandinagari, [Tag.Parse("nand")] }, + { ScriptClass.OldNorthArabian, [Tag.Parse("narb")] }, + { ScriptClass.Nabataean, [Tag.Parse("nbat")] }, + { ScriptClass.Newa, [Tag.Parse("newa")] }, + { ScriptClass.Nko, [Tag.Parse("nkoo")] }, + { ScriptClass.Nushu, [Tag.Parse("nshu")] }, + { ScriptClass.Ogham, [Tag.Parse("ogam")] }, + { ScriptClass.OlChiki, [Tag.Parse("olck")] }, + { ScriptClass.OldTurkic, [Tag.Parse("orkh")] }, + { ScriptClass.Oriya, [Tag.Parse("ory2"), Tag.Parse("orya")] }, + { ScriptClass.Osage, [Tag.Parse("osge")] }, + { ScriptClass.Osmanya, [Tag.Parse("osma")] }, + { ScriptClass.OldUyghur, [Tag.Parse("ougr")] }, + { ScriptClass.Palmyrene, [Tag.Parse("palm")] }, + { ScriptClass.PauCinHau, [Tag.Parse("pauc")] }, + { ScriptClass.OldPermic, [Tag.Parse("perm")] }, + { ScriptClass.PhagsPa, [Tag.Parse("phag")] }, + { ScriptClass.InscriptionalPahlavi, [Tag.Parse("phli")] }, + { ScriptClass.PsalterPahlavi, [Tag.Parse("phlp")] }, + { ScriptClass.Phoenician, [Tag.Parse("phnx")] }, + { ScriptClass.Miao, [Tag.Parse("plrd")] }, + { ScriptClass.InscriptionalParthian, [Tag.Parse("prti")] }, + { ScriptClass.Rejang, [Tag.Parse("rjng")] }, + { ScriptClass.HanifiRohingya, [Tag.Parse("rohg")] }, + { ScriptClass.Runic, [Tag.Parse("runr")] }, + { ScriptClass.Samaritan, [Tag.Parse("samr")] }, + { ScriptClass.OldSouthArabian, [Tag.Parse("sarb")] }, + { ScriptClass.Saurashtra, [Tag.Parse("saur")] }, + { ScriptClass.SignWriting, [Tag.Parse("sgnw")] }, + { ScriptClass.Shavian, [Tag.Parse("shaw")] }, + { ScriptClass.Sharada, [Tag.Parse("shrd")] }, + { ScriptClass.Siddham, [Tag.Parse("sidd")] }, + { ScriptClass.Khudawadi, [Tag.Parse("sind")] }, + { ScriptClass.Sinhala, [Tag.Parse("sinh")] }, + { ScriptClass.Sogdian, [Tag.Parse("sogd")] }, + { ScriptClass.OldSogdian, [Tag.Parse("sogo")] }, + { ScriptClass.SoraSompeng, [Tag.Parse("sora")] }, + { ScriptClass.Soyombo, [Tag.Parse("soyo")] }, + { ScriptClass.Sundanese, [Tag.Parse("sund")] }, + { ScriptClass.SylotiNagri, [Tag.Parse("sylo")] }, + { ScriptClass.Syriac, [Tag.Parse("syrc")] }, + { ScriptClass.Tagbanwa, [Tag.Parse("tagb")] }, + { ScriptClass.Takri, [Tag.Parse("takr")] }, + { ScriptClass.TaiLe, [Tag.Parse("tale")] }, + { ScriptClass.NewTaiLue, [Tag.Parse("talu")] }, + { ScriptClass.Tamil, [Tag.Parse("tml2"), Tag.Parse("taml")] }, + { ScriptClass.Tangut, [Tag.Parse("tang")] }, + { ScriptClass.TaiViet, [Tag.Parse("tavt")] }, + { ScriptClass.Telugu, [Tag.Parse("tel2"), Tag.Parse("telu")] }, + { ScriptClass.Tifinagh, [Tag.Parse("tfng")] }, + { ScriptClass.Tagalog, [Tag.Parse("tglg")] }, + { ScriptClass.Thaana, [Tag.Parse("thaa")] }, + { ScriptClass.Thai, [Tag.Parse("thai")] }, + { ScriptClass.Tibetan, [Tag.Parse("tibt")] }, + { ScriptClass.Tirhuta, [Tag.Parse("tirh")] }, + { ScriptClass.Tangsa, [Tag.Parse("tnsa")] }, + { ScriptClass.Toto, [Tag.Parse("toto")] }, + { ScriptClass.Ugaritic, [Tag.Parse("ugar")] }, + { ScriptClass.Vai, [Tag.Parse("vaii")] }, + { ScriptClass.Vithkuqi, [Tag.Parse("vith")] }, + { ScriptClass.WarangCiti, [Tag.Parse("wara")] }, + { ScriptClass.Wancho, [Tag.Parse("wcho")] }, + { ScriptClass.OldPersian, [Tag.Parse("xpeo")] }, + { ScriptClass.Cuneiform, [Tag.Parse("xsux")] }, + { ScriptClass.Yezidi, [Tag.Parse("yezi")] }, + { ScriptClass.Yi, [Tag.Parse("yiii")] }, + { ScriptClass.ZanabazarSquare, [Tag.Parse("zanb")] }, }; } diff --git a/src/SixLabors.Fonts/Tables/Cff/Cff1Table.cs b/src/SixLabors.Fonts/Tables/Cff/Cff1Table.cs index 8fd4f8f9a..9803fde7c 100644 --- a/src/SixLabors.Fonts/Tables/Cff/Cff1Table.cs +++ b/src/SixLabors.Fonts/Tables/Cff/Cff1Table.cs @@ -53,7 +53,7 @@ public static Cff1Table Load(BigEndianBinaryReader reader) { case 1: CffParser parser = new(); - return new(parser.Load(reader, position)); + return new Cff1Table(parser.Load(reader, position)); default: throw new NotSupportedException(); diff --git a/src/SixLabors.Fonts/Tables/Cff/CffEvaluationEngine.cs b/src/SixLabors.Fonts/Tables/Cff/CffEvaluationEngine.cs index dabdda4ce..3af63607f 100644 --- a/src/SixLabors.Fonts/Tables/Cff/CffEvaluationEngine.cs +++ b/src/SixLabors.Fonts/Tables/Cff/CffEvaluationEngine.cs @@ -48,13 +48,13 @@ public CffEvaluationEngine( this.globalBias = CalculateBias(this.globalSubrBuffers.Length); this.localBias = CalculateBias(this.localSubrBuffers.Length); - this.trans = new(); + this.trans = new Dictionary(); this.x = 0; this.y = 0; this.width = null; this.nStems = 0; - this.stack = new(50); + this.stack = new RefStack(50); this.isDisposed = false; } @@ -66,7 +66,7 @@ public Bounds GetBounds() CffBoundsFinder finder = new(); // Note: scale is passed with negative Y to flip the Y axis. - this.transforming = new(finder, Vector2.Zero, new Vector2(1, -1), Vector2.Zero, Matrix3x2.Identity); + this.transforming = new TransformingGlyphRenderer(finder, Vector2.Zero, new Vector2(1, -1), Vector2.Zero, Matrix3x2.Identity); // Boolean IGlyphRenderer.BeginGlyph(..) is handled by the caller. this.Parse(this.charStrings); @@ -84,7 +84,7 @@ public void RenderTo(IGlyphRenderer renderer, Vector2 origin, Vector2 scale, Vec { this.Reset(); - this.transforming = new(renderer, origin, scale, offset, transform); + this.transforming = new TransformingGlyphRenderer(renderer, origin, scale, offset, transform); // Boolean IGlyphRenderer.BeginGlyph(..) is handled by the caller. this.Parse(this.charStrings); @@ -113,7 +113,7 @@ private void Parse(ReadOnlySpan buffer) float c2x; float c2y; - var oneByteOperator = (Type2Operator1)b0; + Type2Operator1 oneByteOperator = (Type2Operator1)b0; switch (oneByteOperator) { case Type2Operator1.Hstem: diff --git a/src/SixLabors.Fonts/Tables/Cff/CffGlyphData.cs b/src/SixLabors.Fonts/Tables/Cff/CffGlyphData.cs index 1bb5bc54e..398751ac8 100644 --- a/src/SixLabors.Fonts/Tables/Cff/CffGlyphData.cs +++ b/src/SixLabors.Fonts/Tables/Cff/CffGlyphData.cs @@ -35,7 +35,7 @@ public CffGlyphData( public readonly Bounds GetBounds() { - using var engine = new CffEvaluationEngine( + using CffEvaluationEngine engine = new( this.charStrings, this.globalSubrBuffers, this.localSubrBuffers, @@ -46,7 +46,7 @@ public readonly Bounds GetBounds() public readonly void RenderTo(IGlyphRenderer renderer, Vector2 origin, Vector2 scale, Vector2 offset, Matrix3x2 transform) { - using var engine = new CffEvaluationEngine( + using CffEvaluationEngine engine = new( this.charStrings, this.globalSubrBuffers, this.localSubrBuffers, diff --git a/src/SixLabors.Fonts/Tables/Cff/CffParser.cs b/src/SixLabors.Fonts/Tables/Cff/CffParser.cs index d0701d8b9..718f02aca 100644 --- a/src/SixLabors.Fonts/Tables/Cff/CffParser.cs +++ b/src/SixLabors.Fonts/Tables/Cff/CffParser.cs @@ -48,7 +48,7 @@ public CffFont Load(BigEndianBinaryReader reader, long offset) this.ReadCharsets(reader, stringIndex, glyphs); this.ReadEncodings(reader); - return new(fontName, topDictionary, glyphs); + return new CffFont(fontName, topDictionary, glyphs); } private static string ReadNameIndex(BigEndianBinaryReader reader) @@ -95,13 +95,13 @@ private static string[] ReadStringIndex(BigEndianBinaryReader reader) { if (!TryReadIndexDataOffsets(reader, out CffIndexOffset[]? offsets)) { - return Array.Empty(); + return []; } string[] stringIndex = new string[offsets.Length]; // Allow reusing the same buffer for shorter reads. - using Buffer buffer = new Buffer(512); + using Buffer buffer = new(512); Span bufferSpan = buffer.GetSpan(); for (int i = 0; i < offsets.Length; ++i) @@ -184,13 +184,13 @@ private CffTopDictionary ResolveTopDictInfo(List entries, strin metrics.UnderlineThickness = entry.Operands[0].RealNumValue; break; case "FontBBox": - metrics.FontBBox = new double[] - { + metrics.FontBBox = + [ entry.Operands[0].RealNumValue, entry.Operands[1].RealNumValue, entry.Operands[2].RealNumValue, entry.Operands[3].RealNumValue - }; + ]; break; case "CharStrings": this.charStringsOffset = (int)entry.Operands[0].RealNumValue; @@ -464,14 +464,14 @@ private FontDict[] ReadFDArray(BigEndianBinaryReader reader, CidFontInfo cidFont { if (cidFontInfo.FDArray == 0) { - return Array.Empty(); + return []; } reader.BaseStream.Position = this.offset + cidFontInfo.FDArray; if (!TryReadIndexDataOffsets(reader, out CffIndexOffset[]? offsets)) { - return Array.Empty(); + return []; } FontDict[] fontDicts = new FontDict[offsets.Length]; @@ -601,7 +601,7 @@ private CffGlyphData[] ReadCharStringsIndex( glyphs[i] = new CffGlyphData( (ushort)i, globalSubrBuffers, - localSubBuffer ?? Array.Empty(), + localSubBuffer ?? [], privateDictionary?.NominalWidthX ?? 0, charstringsBuffer); } @@ -678,7 +678,7 @@ private static void ReadFormat1Encoding(BigEndianBinaryReader reader) reader.BaseStream.Position = this.offset + this.privateDICTOffset; List dicData = this.ReadDICTData(reader, this.privateDICTLength); - byte[][] localSubrRawBuffers = Array.Empty(); + byte[][] localSubrRawBuffers = []; int defaultWidthX = 0; int nominalWidthX = 0; @@ -713,7 +713,7 @@ private static byte[][] ReadSubrBuffer(BigEndianBinaryReader reader) { if (!TryReadIndexDataOffsets(reader, out CffIndexOffset[]? offsets)) { - return Array.Empty(); + return []; } byte[][] rawBufferList = new byte[offsets.Length][]; @@ -743,7 +743,7 @@ private List ReadDICTData(BigEndianBinaryReader reader, int len // A DICT is simply a sequence of // operand(s)/operator bytes concatenated together. int maxIndex = (int)(reader.BaseStream.Position + length); - List dicData = new(); + List dicData = []; while (reader.BaseStream.Position < maxIndex) { CffDataDicEntry dicEntry = this.ReadEntry(reader); @@ -755,7 +755,7 @@ private List ReadDICTData(BigEndianBinaryReader reader, int len private CffDataDicEntry ReadEntry(BigEndianBinaryReader reader) { - List operands = new(); + List operands = []; //----------------------------- // An operator is preceded by the operand(s) that diff --git a/src/SixLabors.Fonts/Tables/Cff/CffStandardStrings.cs b/src/SixLabors.Fonts/Tables/Cff/CffStandardStrings.cs index 1d9b59cfd..f0ef581ae 100644 --- a/src/SixLabors.Fonts/Tables/Cff/CffStandardStrings.cs +++ b/src/SixLabors.Fonts/Tables/Cff/CffStandardStrings.cs @@ -11,7 +11,7 @@ namespace SixLabors.Fonts.Tables.Cff; internal static class CffStandardStrings { private static readonly string[] StringIdentifierToString = - { + [ ".notdef", "space", "exclam", @@ -403,7 +403,7 @@ internal static class CffStandardStrings "Regular", "Roman", "Semibold" - }; + ]; public static int Count { get; } = StringIdentifierToString.Length; diff --git a/src/SixLabors.Fonts/Tables/Cff/CffTopDictionary.cs b/src/SixLabors.Fonts/Tables/Cff/CffTopDictionary.cs index dd6dba73b..cbb318a02 100644 --- a/src/SixLabors.Fonts/Tables/Cff/CffTopDictionary.cs +++ b/src/SixLabors.Fonts/Tables/Cff/CffTopDictionary.cs @@ -5,7 +5,7 @@ namespace SixLabors.Fonts.Tables.Cff; internal class CffTopDictionary { - public CffTopDictionary() => this.CidFontInfo = new(); + public CffTopDictionary() => this.CidFontInfo = new CidFontInfo(); public string? Version { get; set; } @@ -23,7 +23,7 @@ internal class CffTopDictionary public double UnderlineThickness { get; set; } - public double[] FontBBox { get; set; } = Array.Empty(); + public double[] FontBBox { get; set; } = []; public CidFontInfo CidFontInfo { get; set; } } diff --git a/src/SixLabors.Fonts/Tables/Cff/CidFontInfo.cs b/src/SixLabors.Fonts/Tables/Cff/CidFontInfo.cs index bb2576319..83e9d7fd2 100644 --- a/src/SixLabors.Fonts/Tables/Cff/CidFontInfo.cs +++ b/src/SixLabors.Fonts/Tables/Cff/CidFontInfo.cs @@ -21,7 +21,7 @@ internal class CidFontInfo public int FdSelectFormat { get; set; } - public FDRange3[] FdRanges { get; set; } = Array.Empty(); + public FDRange3[] FdRanges { get; set; } = []; /// /// Gets or sets the fd select map, which maps glyph # to font #. diff --git a/src/SixLabors.Fonts/Tables/Cff/RefStack{T}.cs b/src/SixLabors.Fonts/Tables/Cff/RefStack{T}.cs index 66dc27dbf..813f58c8e 100644 --- a/src/SixLabors.Fonts/Tables/Cff/RefStack{T}.cs +++ b/src/SixLabors.Fonts/Tables/Cff/RefStack{T}.cs @@ -74,7 +74,7 @@ public void Push(T value) capacity = MaxLength; } - var newBuffer = new Buffer(capacity); + Buffer newBuffer = new(capacity); Span newStack = newBuffer.GetSpan(); this.stack.CopyTo(newStack); diff --git a/src/SixLabors.Fonts/Tables/General/CMap/EncodingRecord.cs b/src/SixLabors.Fonts/Tables/General/CMap/EncodingRecord.cs index a96036d3c..7eadc2214 100644 --- a/src/SixLabors.Fonts/Tables/General/CMap/EncodingRecord.cs +++ b/src/SixLabors.Fonts/Tables/General/CMap/EncodingRecord.cs @@ -22,7 +22,7 @@ public EncodingRecord(PlatformIDs platformID, ushort encodingID, uint offset) public static EncodingRecord Read(BigEndianBinaryReader reader) { - var platform = (PlatformIDs)reader.ReadUInt16(); + PlatformIDs platform = (PlatformIDs)reader.ReadUInt16(); ushort encoding = reader.ReadUInt16(); uint offset = reader.ReadOffset32(); diff --git a/src/SixLabors.Fonts/Tables/General/CMap/Format12SubTable.cs b/src/SixLabors.Fonts/Tables/General/CMap/Format12SubTable.cs index b4ad0cb5f..568db2560 100644 --- a/src/SixLabors.Fonts/Tables/General/CMap/Format12SubTable.cs +++ b/src/SixLabors.Fonts/Tables/General/CMap/Format12SubTable.cs @@ -83,8 +83,8 @@ public static IEnumerable Load(IEnumerable enc uint language = reader.ReadUInt32(); uint numGroups = reader.ReadUInt32(); - var groups = new SequentialMapGroup[numGroups]; - for (var i = 0; i < numGroups; i++) + SequentialMapGroup[] groups = new SequentialMapGroup[numGroups]; + for (int i = 0; i < numGroups; i++) { groups[i] = SequentialMapGroup.Load(reader); } @@ -110,9 +110,9 @@ public SequentialMapGroup(uint startCodePoint, uint endCodePoint, uint startGlyp public static SequentialMapGroup Load(BigEndianBinaryReader reader) { - var startCodePoint = reader.ReadUInt32(); - var endCodePoint = reader.ReadUInt32(); - var startGlyph = reader.ReadUInt32(); + uint startCodePoint = reader.ReadUInt32(); + uint endCodePoint = reader.ReadUInt32(); + uint startGlyph = reader.ReadUInt32(); return new SequentialMapGroup(startCodePoint, endCodePoint, startGlyph); } } diff --git a/src/SixLabors.Fonts/Tables/General/CMap/Format14SubTable.cs b/src/SixLabors.Fonts/Tables/General/CMap/Format14SubTable.cs index 10f1a436b..856f105ff 100644 --- a/src/SixLabors.Fonts/Tables/General/CMap/Format14SubTable.cs +++ b/src/SixLabors.Fonts/Tables/General/CMap/Format14SubTable.cs @@ -38,7 +38,7 @@ public static IEnumerable Load( uint length = reader.ReadUInt32(); uint numVarSelectorRecords = reader.ReadUInt32(); - var variationSelectors = new Dictionary(); + Dictionary variationSelectors = new(); uint[] varSelectors = new uint[numVarSelectorRecords]; uint[] defaultUVSOffsets = new uint[numVarSelectorRecords]; uint[] nonDefaultUVSOffsets = new uint[numVarSelectorRecords]; @@ -62,7 +62,7 @@ public static IEnumerable Load( for (int i = 0; i < numVarSelectorRecords; ++i) { - var selector = new VariationSelector(); + VariationSelector selector = new(); if (defaultUVSOffsets[i] != 0) { // Default UVS table diff --git a/src/SixLabors.Fonts/Tables/General/CMap/Format4SubTable.cs b/src/SixLabors.Fonts/Tables/General/CMap/Format4SubTable.cs index 9f89774fe..f6b3c0c28 100644 --- a/src/SixLabors.Fonts/Tables/General/CMap/Format4SubTable.cs +++ b/src/SixLabors.Fonts/Tables/General/CMap/Format4SubTable.cs @@ -148,7 +148,7 @@ public static IEnumerable Load(IEnumerable enco Segment[] segments = Segment.Create(endCounts, startCounts, idDelta, idRangeOffset); - List table = new(); + List table = []; foreach (EncodingRecord encoding in encodings) { table.Add(new Format4SubTable(language, encoding.PlatformID, encoding.EncodingID, segments, glyphIds)); @@ -181,7 +181,7 @@ public Segment(ushort index, ushort end, ushort start, short delta, ushort offse public static Segment[] Create(ReadOnlySpan endCounts, ReadOnlySpan startCode, ReadOnlySpan idDelta, ReadOnlySpan idRangeOffset) { int count = endCounts.Length; - var segments = new Segment[count]; + Segment[] segments = new Segment[count]; for (ushort i = 0; i < count; i++) { ushort start = startCode[i]; diff --git a/src/SixLabors.Fonts/Tables/General/CMapTable.cs b/src/SixLabors.Fonts/Tables/General/CMapTable.cs index 8bca9c38c..d911d5f48 100644 --- a/src/SixLabors.Fonts/Tables/General/CMapTable.cs +++ b/src/SixLabors.Fonts/Tables/General/CMapTable.cs @@ -11,7 +11,7 @@ internal sealed class CMapTable : Table { internal const string TableName = "cmap"; - private readonly Format14SubTable[] format14SubTables = Array.Empty(); + private readonly Format14SubTable[] format14SubTables = []; private CodePoint[]? codepoints; public CMapTable(IEnumerable tables) @@ -102,7 +102,7 @@ public IReadOnlyList GetAvailableCodePoints() return this.codepoints; } - HashSet values = new(); + HashSet values = []; foreach (int v in this.Tables.SelectMany(subtable => subtable.GetAvailableCodePoints())) { @@ -123,14 +123,14 @@ public static CMapTable Load(BigEndianBinaryReader reader) ushort version = reader.ReadUInt16(); ushort numTables = reader.ReadUInt16(); - var encodings = new EncodingRecord[numTables]; + EncodingRecord[] encodings = new EncodingRecord[numTables]; for (int i = 0; i < numTables; i++) { encodings[i] = EncodingRecord.Read(reader); } // foreach encoding we move forward looking for the subtables - var tables = new List(numTables); + List tables = new(numTables); foreach (IGrouping encoding in encodings.GroupBy(x => x.Offset)) { long offset = encoding.Key; diff --git a/src/SixLabors.Fonts/Tables/General/HeadTable.cs b/src/SixLabors.Fonts/Tables/General/HeadTable.cs index 178643c6c..97d588aa1 100644 --- a/src/SixLabors.Fonts/Tables/General/HeadTable.cs +++ b/src/SixLabors.Fonts/Tables/General/HeadTable.cs @@ -175,7 +175,7 @@ public static HeadTable Load(BigEndianBinaryReader reader) throw new InvalidFontFileException($"invalid units per em expected value between 16 and 16384 but found {unitsPerEm} in 'head'"); } - var startDate = new DateTime(1904, 01, 01, 0, 0, 0, DateTimeKind.Utc); + DateTime startDate = new(1904, 01, 01, 0, 0, 0, DateTimeKind.Utc); long seconds = reader.ReadInt64(); DateTime created = startDate; if (seconds > 0) @@ -196,7 +196,7 @@ public static HeadTable Load(BigEndianBinaryReader reader) modified = startDate.AddSeconds(seconds); } - var bounds = Bounds.Load(reader); // xMin, yMin, xMax, yMax + Bounds bounds = Bounds.Load(reader); // xMin, yMin, xMax, yMax HeadMacStyle macStyle = reader.ReadUInt16(); ushort lowestRecPPEM = reader.ReadUInt16(); diff --git a/src/SixLabors.Fonts/Tables/General/Kern/Format0SubTable.cs b/src/SixLabors.Fonts/Tables/General/Kern/Format0SubTable.cs index 7e89fe8bc..216b2e310 100644 --- a/src/SixLabors.Fonts/Tables/General/Kern/Format0SubTable.cs +++ b/src/SixLabors.Fonts/Tables/General/Kern/Format0SubTable.cs @@ -24,7 +24,7 @@ public static Format0SubTable Load(BigEndianBinaryReader reader, in KerningCover ushort entrySelector = reader.ReadUInt16(); ushort rangeShift = reader.ReadUInt16(); - var pairs = new KerningPair[pairCount]; + KerningPair[] pairs = new KerningPair[pairCount]; for (int i = 0; i < pairCount; i++) { pairs[i] = KerningPair.Read(reader); diff --git a/src/SixLabors.Fonts/Tables/General/Kern/KerningPair.cs b/src/SixLabors.Fonts/Tables/General/Kern/KerningPair.cs index bfe875b23..4ea1597ff 100644 --- a/src/SixLabors.Fonts/Tables/General/Kern/KerningPair.cs +++ b/src/SixLabors.Fonts/Tables/General/Kern/KerningPair.cs @@ -29,12 +29,13 @@ public static uint CalculateKey(ushort left, ushort right) public static KerningPair Read(BigEndianBinaryReader reader) - // Type | Field | Description - // -------|-------|------------------------------- - // uint16 | left | The glyph index for the left-hand glyph in the kerning pair. - // uint16 | right | The glyph index for the right-hand glyph in the kerning pair. - // FWORD | value | The kerning value for the above pair, in FUnits.If this value is greater than zero, the characters will be moved apart.If this value is less than zero, the character will be moved closer together. - => new KerningPair(reader.ReadUInt16(), reader.ReadUInt16(), reader.ReadFWORD()); + // Type | Field | Description + // -------|-------|------------------------------- + // uint16 | left | The glyph index for the left-hand glyph in the kerning pair. + // uint16 | right | The glyph index for the right-hand glyph in the kerning pair. + // FWORD | value | The kerning value for the above pair, in FUnits.If this value is greater than zero, the characters will be moved apart.If this value is less than zero, the character will be moved closer together. + => + new(reader.ReadUInt16(), reader.ReadUInt16(), reader.ReadFWORD()); public int CompareTo(KerningPair other) => this.Key.CompareTo(other.Key); diff --git a/src/SixLabors.Fonts/Tables/General/Kern/KerningSubTable.cs b/src/SixLabors.Fonts/Tables/General/Kern/KerningSubTable.cs index e7a7ce8c4..d5076e846 100644 --- a/src/SixLabors.Fonts/Tables/General/Kern/KerningSubTable.cs +++ b/src/SixLabors.Fonts/Tables/General/Kern/KerningSubTable.cs @@ -27,7 +27,7 @@ public KerningSubTable(KerningCoverage coverage) // +--------+----------+----------------------------------------------------------+ ushort subVersion = reader.ReadUInt16(); ushort length = reader.ReadUInt16(); - var coverage = KerningCoverage.Read(reader); + KerningCoverage coverage = KerningCoverage.Read(reader); if (coverage.Format == 0) { return Format0SubTable.Load(reader, coverage); diff --git a/src/SixLabors.Fonts/Tables/General/Kern/KerningTable.cs b/src/SixLabors.Fonts/Tables/General/Kern/KerningTable.cs index 266541720..df8fae762 100644 --- a/src/SixLabors.Fonts/Tables/General/Kern/KerningTable.cs +++ b/src/SixLabors.Fonts/Tables/General/Kern/KerningTable.cs @@ -20,7 +20,7 @@ public static KerningTable Load(FontReader fontReader) if (!fontReader.TryGetReaderAtTablePosition(TableName, out BigEndianBinaryReader? binaryReader)) { // this table is optional. - return new KerningTable(Array.Empty()); + return new KerningTable([]); } using (binaryReader) diff --git a/src/SixLabors.Fonts/Tables/General/Name/NameRecord.cs b/src/SixLabors.Fonts/Tables/General/Name/NameRecord.cs index 133981f5f..a2cef1cda 100644 --- a/src/SixLabors.Fonts/Tables/General/Name/NameRecord.cs +++ b/src/SixLabors.Fonts/Tables/General/Name/NameRecord.cs @@ -37,7 +37,7 @@ public static NameRecord Read(BigEndianBinaryReader reader) ushort languageID = reader.ReadUInt16(); KnownNameIds nameID = reader.ReadUInt16(); - var stringReader = StringLoader.Create(reader, encoding); + StringLoader stringReader = StringLoader.Create(reader, encoding); return new NameRecord(platform, languageID, nameID, string.Empty) { diff --git a/src/SixLabors.Fonts/Tables/General/Name/NameTable.cs b/src/SixLabors.Fonts/Tables/General/Name/NameTable.cs index b1ff269ad..f21e017e4 100644 --- a/src/SixLabors.Fonts/Tables/General/Name/NameTable.cs +++ b/src/SixLabors.Fonts/Tables/General/Name/NameTable.cs @@ -107,12 +107,12 @@ public string GetNameById(CultureInfo culture, ushort nameId) public static NameTable Load(BigEndianBinaryReader reader) { - var strings = new List(); + List strings = []; ushort format = reader.ReadUInt16(); ushort nameCount = reader.ReadUInt16(); ushort stringOffset = reader.ReadUInt16(); - var names = new NameRecord[nameCount]; + NameRecord[] names = new NameRecord[nameCount]; for (int i = 0; i < nameCount; i++) { @@ -124,7 +124,7 @@ public static NameTable Load(BigEndianBinaryReader reader) } } - StringLoader[]? langs = Array.Empty(); + StringLoader[]? langs = []; if (format == 1) { // Format 1 adds language data. @@ -147,7 +147,7 @@ public static NameTable Load(BigEndianBinaryReader reader) readable.LoadValue(reader); } - string[] langNames = langs?.Select(x => x.Value).ToArray() ?? Array.Empty(); + string[] langNames = langs?.Select(x => x.Value).ToArray() ?? []; return new NameTable(names, langNames); } diff --git a/src/SixLabors.Fonts/Tables/General/OS2Table.cs b/src/SixLabors.Fonts/Tables/General/OS2Table.cs index 1c4f49faf..1ea58752a 100644 --- a/src/SixLabors.Fonts/Tables/General/OS2Table.cs +++ b/src/SixLabors.Fonts/Tables/General/OS2Table.cs @@ -316,7 +316,7 @@ public static OS2Table Load(BigEndianBinaryReader reader) ushort winAscent = reader.ReadUInt16(); ushort winDescent = reader.ReadUInt16(); - var version0Table = new OS2Table( + OS2Table version0Table = new( averageCharWidth, weightClass, widthClass, @@ -372,7 +372,7 @@ public static OS2Table Load(BigEndianBinaryReader reader) maxContext = reader.ReadUInt16(); } - var versionLessThan5Table = new OS2Table( + OS2Table versionLessThan5Table = new( version0Table, codePageRange1, codePageRange2, diff --git a/src/SixLabors.Fonts/Tables/General/Post/PostTable.cs b/src/SixLabors.Fonts/Tables/General/Post/PostTable.cs index 517112b0f..f99810624 100644 --- a/src/SixLabors.Fonts/Tables/General/Post/PostTable.cs +++ b/src/SixLabors.Fonts/Tables/General/Post/PostTable.cs @@ -9,9 +9,9 @@ internal class PostTable : Table { internal const string TableName = "post"; private static readonly string[] AppleGlyphNameMap - = new[] - { - ".notdef", ".null", "nonmarkingreturn", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quotesingle", "parenleft", "parenright", + = + [ + ".notdef", ".null", "nonmarkingreturn", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quotesingle", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "grave", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", @@ -27,7 +27,7 @@ private static readonly string[] AppleGlyphNameMap "Uacute", "Ucircumflex", "Ugrave", "dotlessi", "circumflex", "tilde", "macron", "breve", "dotaccent", "ring", "cedilla", "hungarumlaut", "ogonek", "caron", "Lslash", "lslash", "Scaron", "scaron", "Zcaron", "zcaron", "brokenbar", "Eth", "eth", "Yacute", "yacute", "Thorn", "thorn", "minus", "multiply", "onesuperior", "twosuperior", "threesuperior", "onehalf", "onequarter", "threequarters", "franc", "Gbreve", "gbreve", "Idotaccent", "Scedilla", "scedilla", "Cacute", "cacute", "Ccaron", "ccaron", "dcroat" - }; + ]; public PostTable( ushort formatMajor, @@ -122,7 +122,7 @@ public static PostTable Load(BigEndianBinaryReader reader) uint minMemType1 = reader.ReadUInt32(); uint maxMemType1 = reader.ReadUInt32(); - PostNameRecord[] records = Array.Empty(); + PostNameRecord[] records = []; if (formatMajor == 1) { diff --git a/src/SixLabors.Fonts/Tables/Svg/SvgGlyphSource.cs b/src/SixLabors.Fonts/Tables/Svg/SvgGlyphSource.cs index 5b8140a5e..ed43ef927 100644 --- a/src/SixLabors.Fonts/Tables/Svg/SvgGlyphSource.cs +++ b/src/SixLabors.Fonts/Tables/Svg/SvgGlyphSource.cs @@ -230,7 +230,7 @@ private static void Walk( if (cmds.Count > 0) { Paint? layerPaint = ApplyOpacityToPaint(paint, opacityMul); - outputLayers.Add(new(layerPaint, fillRule, localTransform, null, cmds)); + outputLayers.Add(new PaintedLayer(layerPaint, fillRule, localTransform, null, cmds)); } break; @@ -253,7 +253,7 @@ private static void Walk( if (cmds.Count > 0) { Paint? layerPaint = ApplyOpacityToPaint(paint, opacityMul); - outputLayers.Add(new(layerPaint, fillRule, localTransform, null, cmds)); + outputLayers.Add(new PaintedLayer(layerPaint, fillRule, localTransform, null, cmds)); } } @@ -287,7 +287,7 @@ private static void Walk( if (cmds.Count > 0) { Paint? layerPaint = ApplyOpacityToPaint(paint, opacityMul); - outputLayers.Add(new(layerPaint, fillRule, localTransform, null, cmds)); + outputLayers.Add(new PaintedLayer(layerPaint, fillRule, localTransform, null, cmds)); } } @@ -310,7 +310,7 @@ private static void Walk( if (cmds.Count > 0) { Paint? layerPaint = ApplyOpacityToPaint(paint, opacityMul); - outputLayers.Add(new(layerPaint, fillRule, localTransform, null, cmds)); + outputLayers.Add(new PaintedLayer(layerPaint, fillRule, localTransform, null, cmds)); } } @@ -334,7 +334,7 @@ private static void Walk( if (cmds.Count > 0) { Paint? layerPaint = ApplyOpacityToPaint(paint, opacityMul); - outputLayers.Add(new(layerPaint, fillRule, localTransform, null, cmds)); + outputLayers.Add(new PaintedLayer(layerPaint, fillRule, localTransform, null, cmds)); } } diff --git a/src/SixLabors.Fonts/Tables/TableHeader.cs b/src/SixLabors.Fonts/Tables/TableHeader.cs index 2633ee13e..06d0ab63c 100644 --- a/src/SixLabors.Fonts/Tables/TableHeader.cs +++ b/src/SixLabors.Fonts/Tables/TableHeader.cs @@ -21,7 +21,7 @@ public TableHeader(string tag, uint checkSum, uint offset, uint len) public uint Length { get; } - public static TableHeader Read(BigEndianBinaryReader reader) => new TableHeader( + public static TableHeader Read(BigEndianBinaryReader reader) => new( reader.ReadTag(), reader.ReadUInt32(), reader.ReadOffset32(), diff --git a/src/SixLabors.Fonts/Tables/TripleEncodingTable.cs b/src/SixLabors.Fonts/Tables/TripleEncodingTable.cs index 985a90a10..b794b2f61 100644 --- a/src/SixLabors.Fonts/Tables/TripleEncodingTable.cs +++ b/src/SixLabors.Fonts/Tables/TripleEncodingTable.cs @@ -7,8 +7,8 @@ namespace SixLabors.Fonts.Tables; // see https://github.com/LayoutFarm/Typography/blob/master/Typography.OpenFont/WebFont/Woff2Reader.cs internal class TripleEncodingTable { - public static readonly TripleEncodingTable EncTable = new TripleEncodingTable(); - private readonly List records = new List(); + public static readonly TripleEncodingTable EncTable = new(); + private readonly List records = []; private TripleEncodingTable() => this.BuildTable(); @@ -42,7 +42,7 @@ private void BuildTable() // 7 768 + // 8 1024 - // 9 1024 + - this.BuildRecords(2, 0, 8, Array.Empty(), new ushort[] { 0, 256, 512, 768, 1024 }); + this.BuildRecords(2, 0, 8, [], [0, 256, 512, 768, 1024]); // Index ByteCount Xbits Ybits DeltaX DeltaY Xsign Ysign // (set 1.2) @@ -56,7 +56,7 @@ private void BuildTable() // 17 768 + // 18 1024 - // 19 1024 + - this.BuildRecords(2, 8, 0, new ushort[] { 0, 256, 512, 768, 1024 }, Array.Empty()); + this.BuildRecords(2, 8, 0, [0, 256, 512, 768, 1024], []); // Index ByteCount Xbits Ybits DeltaX DeltaY Xsign Ysign // (set 2.1) @@ -76,7 +76,7 @@ private void BuildTable() // 33 49 + - // 34 49 - + // 35 49 + + - this.BuildRecords(2, 4, 4, new ushort[] { 1 }, new ushort[] { 1, 17, 33, 49 }); + this.BuildRecords(2, 4, 4, [1], [1, 17, 33, 49]); // Index ByteCount Xbits Ybits DeltaX DeltaY Xsign Ysign // (set 2.2) @@ -96,7 +96,7 @@ private void BuildTable() // 49 49 + - // 50 49 - + // 51 49 + + - this.BuildRecords(2, 4, 4, new ushort[] { 17 }, new ushort[] { 1, 17, 33, 49 }); + this.BuildRecords(2, 4, 4, [17], [1, 17, 33, 49]); // Index ByteCount Xbits Ybits DeltaX DeltaY Xsign Ysign // (set 2.3) @@ -116,7 +116,7 @@ private void BuildTable() // 65 49 + - // 66 49 - + // 67 49 + + - this.BuildRecords(2, 4, 4, new ushort[] { 33 }, new ushort[] { 1, 17, 33, 49 }); + this.BuildRecords(2, 4, 4, [33], [1, 17, 33, 49]); // Index ByteCount Xbits Ybits DeltaX DeltaY Xsign Ysign // (set 2.4) @@ -136,7 +136,7 @@ private void BuildTable() // 81 49 + - // 82 49 - + // 83 49 + + - this.BuildRecords(2, 4, 4, new ushort[] { 49 }, new ushort[] { 1, 17, 33, 49 }); + this.BuildRecords(2, 4, 4, [49], [1, 17, 33, 49]); // Index ByteCount Xbits Ybits DeltaX DeltaY Xsign Ysign // (set 3.1) @@ -152,7 +152,7 @@ private void BuildTable() // 93 513 + - // 94 513 - + // 95 513 + + - this.BuildRecords(3, 8, 8, new ushort[] { 1 }, new ushort[] { 1, 257, 513 }); + this.BuildRecords(3, 8, 8, [1], [1, 257, 513]); // Index ByteCount Xbits Ybits DeltaX DeltaY Xsign Ysign // (set 3.2) @@ -168,7 +168,7 @@ private void BuildTable() // 105 513 + - // 106 513 - + // 107 513 + + - this.BuildRecords(3, 8, 8, new ushort[] { 257 }, new ushort[] { 1, 257, 513 }); + this.BuildRecords(3, 8, 8, [257], [1, 257, 513]); // Index ByteCount Xbits Ybits DeltaX DeltaY Xsign Ysign // (set 3.3) @@ -184,7 +184,7 @@ private void BuildTable() // 117 513 + - // 118 513 - + // 119 513 + + - this.BuildRecords(3, 8, 8, new ushort[] { 513 }, new ushort[] { 1, 257, 513 }); + this.BuildRecords(3, 8, 8, [513], [1, 257, 513]); // Index ByteCount Xbits Ybits DeltaX DeltaY Xsign Ysign // (set 4) @@ -192,7 +192,7 @@ private void BuildTable() // 121 + - // 122 - + // 123 + + - this.BuildRecords(4, 12, 12, new ushort[] { 0 }, new ushort[] { 0 }); + this.BuildRecords(4, 12, 12, [0], [0]); // Index ByteCount Xbits Ybits DeltaX DeltaY Xsign Ysign // (set 5) @@ -200,7 +200,7 @@ private void BuildTable() // 125 + - // 126 - + // 127 + + - this.BuildRecords(5, 16, 16, new ushort[] { 0 }, new ushort[] { 0 }); + this.BuildRecords(5, 16, 16, [0], [0]); } private void BuildRecords(byte byteCount, byte xbits, byte ybits, ushort[] deltaXs, ushort[] deltaYs) @@ -245,7 +245,7 @@ private void BuildRecords(byte byteCount, byte xbits, byte ybits, ushort[] delta private void AddRecord(byte byteCount, byte xbits, byte ybits, ushort deltaX, ushort deltaY, sbyte xsign, sbyte ysign) { - var rec = new TripleEncodingRecord(byteCount, xbits, ybits, deltaX, deltaY, xsign, ysign); + TripleEncodingRecord rec = new(byteCount, xbits, ybits, deltaX, deltaY, xsign, ysign); this.records.Add(rec); } } diff --git a/src/SixLabors.Fonts/Tables/TrueType/Glyphs/CompositeGlyphLoader.cs b/src/SixLabors.Fonts/Tables/TrueType/Glyphs/CompositeGlyphLoader.cs index 1c414c258..4272365e3 100644 --- a/src/SixLabors.Fonts/Tables/TrueType/Glyphs/CompositeGlyphLoader.cs +++ b/src/SixLabors.Fonts/Tables/TrueType/Glyphs/CompositeGlyphLoader.cs @@ -20,12 +20,12 @@ public CompositeGlyphLoader(IEnumerable composites, Bounds bounds, Re public override GlyphVector CreateGlyph(GlyphTable table) { - List controlPoints = new(); - List endPoints = new(); + List controlPoints = []; + List endPoints = []; for (int i = 0; i < this.composites.Length; i++) { Composite composite = this.composites[i]; - var clone = GlyphVector.DeepClone(table.GetGlyph(composite.GlyphIndex)); + GlyphVector clone = GlyphVector.DeepClone(table.GetGlyph(composite.GlyphIndex)); GlyphVector.TransformInPlace(ref clone, composite.Transformation); ushort endPointOffset = (ushort)controlPoints.Count; @@ -36,12 +36,12 @@ public override GlyphVector CreateGlyph(GlyphTable table) } } - return new(controlPoints, endPoints, this.bounds, this.instructions, true); + return new GlyphVector(controlPoints, endPoints, this.bounds, this.instructions, true); } public static CompositeGlyphLoader LoadCompositeGlyph(BigEndianBinaryReader reader, in Bounds bounds) { - List composites = new(); + List composites = []; CompositeGlyphFlags flags; do { @@ -76,7 +76,7 @@ public static CompositeGlyphLoader LoadCompositeGlyph(BigEndianBinaryReader read } while ((flags & CompositeGlyphFlags.MoreComponents) != 0); - byte[] instructions = Array.Empty(); + byte[] instructions = []; if ((flags & CompositeGlyphFlags.WeHaveInstructions) != 0) { // Read the instructions if they exist. diff --git a/src/SixLabors.Fonts/Tables/TrueType/Glyphs/GlyphLoader.cs b/src/SixLabors.Fonts/Tables/TrueType/Glyphs/GlyphLoader.cs index 3175284c4..1630bf216 100644 --- a/src/SixLabors.Fonts/Tables/TrueType/Glyphs/GlyphLoader.cs +++ b/src/SixLabors.Fonts/Tables/TrueType/Glyphs/GlyphLoader.cs @@ -10,7 +10,7 @@ internal abstract class GlyphLoader public static GlyphLoader Load(BigEndianBinaryReader reader) { short contoursCount = reader.ReadInt16(); - var bounds = Bounds.Load(reader); + Bounds bounds = Bounds.Load(reader); if (contoursCount >= 0) { diff --git a/src/SixLabors.Fonts/Tables/TrueType/Glyphs/GlyphTable.cs b/src/SixLabors.Fonts/Tables/TrueType/Glyphs/GlyphTable.cs index d9b2a805a..6e4f2cbf6 100644 --- a/src/SixLabors.Fonts/Tables/TrueType/Glyphs/GlyphTable.cs +++ b/src/SixLabors.Fonts/Tables/TrueType/Glyphs/GlyphTable.cs @@ -14,7 +14,7 @@ internal class GlyphTable : Table public GlyphTable(GlyphLoader[] glyphLoaders) { this.loaders = glyphLoaders; - this.glyphCache = new(glyphLoaders.Length); + this.glyphCache = new Dictionary(glyphLoaders.Length); } public int GlyphCount => this.loaders.Length; diff --git a/src/SixLabors.Fonts/Tables/TrueType/Glyphs/GlyphVector.cs b/src/SixLabors.Fonts/Tables/TrueType/Glyphs/GlyphVector.cs index 5fd363188..3bb3eef55 100644 --- a/src/SixLabors.Fonts/Tables/TrueType/Glyphs/GlyphVector.cs +++ b/src/SixLabors.Fonts/Tables/TrueType/Glyphs/GlyphVector.cs @@ -81,7 +81,7 @@ public static void Hint( return; } - var controlPoints = new ControlPoint[glyph.ControlPoints.Count + 4]; + ControlPoint[] controlPoints = new ControlPoint[glyph.ControlPoints.Count + 4]; controlPoints[controlPoints.Length - 4].Point = pp1; controlPoints[controlPoints.Length - 3].Point = pp2; controlPoints[controlPoints.Length - 2].Point = pp3; @@ -110,7 +110,7 @@ public static GlyphVector DeepClone(GlyphVector src) List controlPoints = new(src.ControlPoints); List endPoints = new(src.EndPoints); - return new(controlPoints, endPoints, src.Bounds, src.Instructions, src.IsComposite); + return new GlyphVector(controlPoints, endPoints, src.Bounds, src.Instructions, src.IsComposite); } /// diff --git a/src/SixLabors.Fonts/Tables/TrueType/Glyphs/SimpleGlyphLoader.cs b/src/SixLabors.Fonts/Tables/TrueType/Glyphs/SimpleGlyphLoader.cs index 3031155c2..1555101dc 100644 --- a/src/SixLabors.Fonts/Tables/TrueType/Glyphs/SimpleGlyphLoader.cs +++ b/src/SixLabors.Fonts/Tables/TrueType/Glyphs/SimpleGlyphLoader.cs @@ -22,9 +22,9 @@ public SimpleGlyphLoader(ControlPoint[] controlPoints, ushort[] endPoints, Bound public SimpleGlyphLoader(Bounds bounds) { - this.controlPoints = Array.Empty(); - this.endPoints = Array.Empty(); - this.instructions = Array.Empty(); + this.controlPoints = []; + this.endPoints = []; + this.instructions = []; this.bounds = bounds; } @@ -72,10 +72,10 @@ public static GlyphLoader LoadSimpleGlyph(BigEndianBinaryReader reader, short co short[] xs = ReadCoordinates(reader, pointCount, flags, Flags.XByte, Flags.XSignOrSame); short[] ys = ReadCoordinates(reader, pointCount, flags, Flags.YByte, Flags.YSignOrSame); - var controlPoints = new ControlPoint[xs.Length]; + ControlPoint[] controlPoints = new ControlPoint[xs.Length]; for (int i = 0; i < flags.Length; i++) { - controlPoints[i] = new(new Vector2(xs[i], ys[i]), (flags[i] & Flags.OnCurve) == Flags.OnCurve); + controlPoints[i] = new ControlPoint(new Vector2(xs[i], ys[i]), (flags[i] & Flags.OnCurve) == Flags.OnCurve); } return new SimpleGlyphLoader(controlPoints, endPoints, bounds, instructions); @@ -83,7 +83,7 @@ public static GlyphLoader LoadSimpleGlyph(BigEndianBinaryReader reader, short co private static Flags[] ReadFlags(BigEndianBinaryReader reader, int flagCount) { - var result = new Flags[flagCount]; + Flags[] result = new Flags[flagCount]; int c = 0; int repeatCount = 0; Flags flag = default; diff --git a/src/SixLabors.Fonts/Tables/TrueType/Hinting/TrueTypeInterpreter.cs b/src/SixLabors.Fonts/Tables/TrueType/Hinting/TrueTypeInterpreter.cs index 5ab0499bd..ca5b0a017 100644 --- a/src/SixLabors.Fonts/Tables/TrueType/Hinting/TrueTypeInterpreter.cs +++ b/src/SixLabors.Fonts/Tables/TrueType/Hinting/TrueTypeInterpreter.cs @@ -45,7 +45,7 @@ internal class TrueTypeInterpreter private const int MaxCallStack = 128; private const float Epsilon = 0.000001F; - private readonly List debugList = new(); + private readonly List debugList = []; public TrueTypeInterpreter(int maxStack, int maxStorage, int maxFunctions, int maxInstructionDefs, int maxTwilightPoints) { @@ -56,7 +56,7 @@ public TrueTypeInterpreter(int maxStack, int maxStorage, int maxFunctions, int m this.state = default; this.cvtState = default; this.twilight = new Zone(maxTwilightPoints, isTwilight: true); - this.controlValueTable = Array.Empty(); + this.controlValueTable = []; this.contours = Array.Empty(); } @@ -294,7 +294,7 @@ private void Execute(StackInstructionStream stream, bool inFunction, bool allowF { int y = this.stack.Pop(); int x = this.stack.Pop(); - var vec = Vector2.Normalize(new Vector2(F2Dot14ToFloat(x), F2Dot14ToFloat(y))); + Vector2 vec = Vector2.Normalize(new Vector2(F2Dot14ToFloat(x), F2Dot14ToFloat(y))); if (opcode == OpCode.SFVFS) { this.state.Freedom = vec; @@ -2321,7 +2321,7 @@ public Zone(ControlPoint[] controlPoints, bool isTwilight) this.IsTwilight = isTwilight; this.Current = controlPoints; - var original = new ControlPoint[controlPoints.Length]; + ControlPoint[] original = new ControlPoint[controlPoints.Length]; controlPoints.AsSpan().CopyTo(original); this.Original = original; this.TouchState = new TouchState[controlPoints.Length]; diff --git a/src/SixLabors.Fonts/Tables/Woff/Woff2Utils.cs b/src/SixLabors.Fonts/Tables/Woff/Woff2Utils.cs index c742acc8f..cc97322cb 100644 --- a/src/SixLabors.Fonts/Tables/Woff/Woff2Utils.cs +++ b/src/SixLabors.Fonts/Tables/Woff/Woff2Utils.cs @@ -14,7 +14,7 @@ internal static class Woff2Utils { // We don't reuse the const tag headers from our table types for clarity. private static readonly string[] KnownTableTags = - { + [ "cmap", "head", "hhea", "hmtx", "maxp", "name", "OS/2", "post", "cvt ", "fpgm", "glyf", "loca", "prep", "CFF ", "VORG", "EBDT", "EBLC", "gasp", "hdmx", "kern", "LTSH", "PCLT", "VDMX", "vhea", "vmtx", "BASE", "GDEF", @@ -22,7 +22,7 @@ internal static class Woff2Utils "SVG ", "sbix", "acnt", "avar", "bdat", "bloc", "bsln", "cvar", "fdsc", "feat", "fmtx", "fvar", "gvar", "hsty", "just", "lcar", "mort", "morx", "opbd", "prop", "trak", "Zapf", "Silf", "Glat", "Gloc", "Feat", "Sill" - }; + ]; private const byte OneMoreByteCode1 = 255; private const byte OneMoreByteCode2 = 254; @@ -32,7 +32,7 @@ internal static class Woff2Utils public static ReadOnlyDictionary ReadWoff2Headers(BigEndianBinaryReader reader, int tableCount) { uint expectedTableStartAt = 0; - var headers = new Dictionary(tableCount); + Dictionary headers = new(tableCount); for (int i = 0; i < tableCount; i++) { Woff2TableHeader woffTableHeader = Read(reader, expectedTableStartAt, out uint nextExpectedTableStartAt); @@ -162,10 +162,10 @@ public static GlyphLoader[] LoadAllGlyphs(BigEndianBinaryReader reader, EmptyGly long bboxStreamOffset = compositeStreamOffset + compositeStreamSize; long instructionStreamOffset = bboxStreamOffset + bboxStreamSize; - var glyphs = new GlyphVector[numGlyphs]; - var allGlyphs = new GlyphData[numGlyphs]; - var glyphLoaders = new GlyphLoader[numGlyphs]; - var compositeGlyphs = new List(); + GlyphVector[] glyphs = new GlyphVector[numGlyphs]; + GlyphData[] allGlyphs = new GlyphData[numGlyphs]; + GlyphLoader[] glyphLoaders = new GlyphLoader[numGlyphs]; + List compositeGlyphs = []; int contourCount = 0; for (ushort i = 0; i < numGlyphs; i++) { @@ -323,7 +323,7 @@ private static GlyphVector ReadSimpleGlyphData( endPoints[i] = (ushort)(pointCount - 1); } - var controlPoints = new ControlPoint[pointCount]; + ControlPoint[] controlPoints = new ControlPoint[pointCount]; int n = 0; for (int i = 0; i < numContour; i++) { @@ -370,7 +370,7 @@ private static GlyphVector ReadSimpleGlyphData( } // Most significant 1 bit -> on/off curve. - controlPoints[n] = new(new Vector2(curX += x, curY += y), f >> 7 == 0); + controlPoints[n] = new ControlPoint(new Vector2(curX += x, curY += y), f >> 7 == 0); } } @@ -420,8 +420,8 @@ private static bool CompositeHasInstructions(BigEndianBinaryReader reader) private static GlyphVector ReadCompositeGlyphData(GlyphVector[] createdGlyphs, BigEndianBinaryReader reader) { - List controlPoints = new(); - List endPoints = new(); + List controlPoints = []; + List endPoints = []; CompositeGlyphFlags flags; do { @@ -459,7 +459,7 @@ private static GlyphVector ReadCompositeGlyphData(GlyphVector[] createdGlyphs, B transform.M22 = reader.ReadF2Dot14(); } - var clone = GlyphVector.DeepClone(createdGlyphs[glyphIndex]); + GlyphVector clone = GlyphVector.DeepClone(createdGlyphs[glyphIndex]); GlyphVector.TransformInPlace(ref clone, transform); ushort endPointOffset = (ushort)controlPoints.Count; diff --git a/src/SixLabors.Fonts/Tables/Woff/WoffTableHeader.cs b/src/SixLabors.Fonts/Tables/Woff/WoffTableHeader.cs index 5aac24484..097692e70 100644 --- a/src/SixLabors.Fonts/Tables/Woff/WoffTableHeader.cs +++ b/src/SixLabors.Fonts/Tables/Woff/WoffTableHeader.cs @@ -1,6 +1,8 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. +using SixLabors.Fonts.IO; + namespace SixLabors.Fonts.Tables.Woff; internal sealed class WoffTableHeader : TableHeader @@ -21,7 +23,7 @@ public override BigEndianBinaryReader CreateReader(Stream stream) // Read all data from the compressed stream. stream.Seek(this.Offset, SeekOrigin.Begin); - using var compressedStream = new IO.ZlibInflateStream(stream); + using ZlibInflateStream compressedStream = new(stream); byte[] uncompressedBytes = new byte[this.Length]; int totalBytesRead = 0; int bytesLeftToRead = uncompressedBytes.Length; @@ -37,7 +39,7 @@ public override BigEndianBinaryReader CreateReader(Stream stream) bytesLeftToRead -= bytesRead; } - var memoryStream = new MemoryStream(uncompressedBytes); + MemoryStream memoryStream = new(uncompressedBytes); return new BigEndianBinaryReader(memoryStream, false); } @@ -48,7 +50,7 @@ public override BigEndianBinaryReader CreateReader(Stream stream) // UInt32 | origLength | Length of the uncompressed table, excluding padding. // UInt32 | origChecksum | Checksum of the uncompressed table. public static new WoffTableHeader Read(BigEndianBinaryReader reader) => - new WoffTableHeader( + new( reader.ReadTag(), reader.ReadUInt32(), reader.ReadUInt32(), diff --git a/src/SixLabors.Fonts/TextLayout.cs b/src/SixLabors.Fonts/TextLayout.cs index a192a2d9a..1691eb49f 100644 --- a/src/SixLabors.Fonts/TextLayout.cs +++ b/src/SixLabors.Fonts/TextLayout.cs @@ -48,7 +48,7 @@ public static IReadOnlyList BuildTextRuns(ReadOnlySpan text, Text // Fill gaps within runs. if (textRun.Start > start) { - textRuns.Add(new() + textRuns.Add(new TextRun { Start = start, End = textRun.Start, @@ -74,7 +74,7 @@ public static IReadOnlyList BuildTextRuns(ReadOnlySpan text, Text // Add a final run if required. if (start < end) { - textRuns.Add(new() + textRuns.Add(new TextRun { Start = start, End = end, @@ -1357,9 +1357,9 @@ internal sealed class TextLine private readonly List data; private readonly Dictionary advances = []; - public TextLine() => this.data = new(16); + public TextLine() => this.data = new List(16); - public TextLine(int capacity) => this.data = new(capacity); + public TextLine(int capacity) => this.data = new List(capacity); public int Count => this.data.Count; @@ -1399,7 +1399,7 @@ public void Add( this.ScaledMaxAscender = MathF.Max(this.ScaledMaxAscender, scaledAscender); this.ScaledMaxDescender = MathF.Max(this.ScaledMaxDescender, scaledDescender); - this.data.Add(new( + this.data.Add(new GlyphLayoutData( metrics, pointSize, scaledAdvance, @@ -1469,7 +1469,7 @@ public bool TrySplitAt(float length, [NotNullWhen(true)] out TextLine? result) if (advance >= length) { int count = this.data.Count - i; - result = new(count); + result = new TextLine(count); result.data.AddRange(this.data.GetRange(i, count)); RecalculateLineMetrics(result); @@ -1524,7 +1524,7 @@ public bool TrySplitAt(LineBreak lineBreak, bool keepAll, [NotNullWhen(true)] ou // Create a new line ensuring we capture the initial metrics. int count = this.data.Count - index; - result = new(count); + result = new TextLine(count); result.data.AddRange(this.data.GetRange(index, count)); RecalculateLineMetrics(result); @@ -1652,7 +1652,7 @@ public void BidiReOrder() if (run != g.BidiRun) { run = g.BidiRun; - current.Next = new(run.Level); + current.Next = new OrderedBidiRun(run.Level); current = current.Next; } diff --git a/src/SixLabors.Fonts/TextMeasurer.cs b/src/SixLabors.Fonts/TextMeasurer.cs index 5a0b18be6..3088962ee 100644 --- a/src/SixLabors.Fonts/TextMeasurer.cs +++ b/src/SixLabors.Fonts/TextMeasurer.cs @@ -287,7 +287,7 @@ internal static bool TryGetCharacterSizes(IReadOnlyList glyphLayout { GlyphLayout g = glyphLayouts[i]; FontRectangle bounds = g.BoundingBox(dpi); - bounds = new(0, 0, bounds.Width, bounds.Height); + bounds = new FontRectangle(0, 0, bounds.Width, bounds.Height); hasSize |= bounds.Width > 0 || bounds.Height > 0; characterBoundsList[i] = new GlyphBounds(g.Glyph.GlyphMetrics.CodePoint, in bounds, g.GraphemeIndex, g.StringIndex); diff --git a/src/SixLabors.Fonts/Unicode/ArabicJoiningClass.cs b/src/SixLabors.Fonts/Unicode/ArabicJoiningClass.cs index e9cdab1e4..11aeafe86 100644 --- a/src/SixLabors.Fonts/Unicode/ArabicJoiningClass.cs +++ b/src/SixLabors.Fonts/Unicode/ArabicJoiningClass.cs @@ -37,7 +37,7 @@ public ArabicJoiningClass(CodePoint codePoint) [MethodImpl(MethodImplOptions.AggressiveInlining)] private static ArabicJoiningType GetJoiningType(CodePoint codePoint, uint value, UnicodeCategory category) { - var type = (ArabicJoiningType)(value & 0xFF); + ArabicJoiningType type = (ArabicJoiningType)(value & 0xFF); // All others not explicitly listed have joining type U if (type == ArabicJoiningType.NonJoining) diff --git a/src/SixLabors.Fonts/Unicode/BidiAlgorithm.cs b/src/SixLabors.Fonts/Unicode/BidiAlgorithm.cs index 832543fc5..783685228 100644 --- a/src/SixLabors.Fonts/Unicode/BidiAlgorithm.cs +++ b/src/SixLabors.Fonts/Unicode/BidiAlgorithm.cs @@ -97,7 +97,7 @@ internal sealed class BidiAlgorithm /// /// Re-usable list of level runs /// - private readonly List levelRuns = new(); + private readonly List levelRuns = []; /// /// Mapping for the current isolating sequence, built @@ -164,12 +164,12 @@ internal sealed class BidiAlgorithm /// Reusable list of pending opening brackets used by the /// LocatePairedBrackets method /// - private readonly List pendingOpeningBrackets = new(); + private readonly List pendingOpeningBrackets = []; /// /// Resolved list of paired brackets /// - private readonly List pairedBrackets = new(); + private readonly List pairedBrackets = []; /// /// Initializes a new instance of the class. @@ -182,7 +182,7 @@ public BidiAlgorithm() /// Gets a per-thread instance that can be re-used as often /// as necessary. /// - public static ThreadLocal Instance { get; } = new ThreadLocal(() => new BidiAlgorithm()); + public static ThreadLocal Instance { get; } = new(() => new BidiAlgorithm()); /// /// Gets the resolved levels. diff --git a/src/SixLabors.Fonts/Unicode/BidiData.cs b/src/SixLabors.Fonts/Unicode/BidiData.cs index 6133a6889..311d9398f 100644 --- a/src/SixLabors.Fonts/Unicode/BidiData.cs +++ b/src/SixLabors.Fonts/Unicode/BidiData.cs @@ -15,7 +15,7 @@ internal class BidiData private ArrayBuilder savedTypes; private ArrayBuilder savedPairedBracketTypes; private ArrayBuilder tempLevelBuffer; - private readonly List paragraphPositions = new(); + private readonly List paragraphPositions = []; public sbyte ParagraphEmbeddingLevel { get; private set; } @@ -76,7 +76,7 @@ public void Init(ReadOnlySpan text, sbyte paragraphEmbeddingLevel) this.HasIsolates = false; int i = 0; - var codePointEnumerator = new SpanCodePointEnumerator(text); + SpanCodePointEnumerator codePointEnumerator = new(text); while (codePointEnumerator.MoveNext()) { CodePoint codePoint = codePointEnumerator.Current; diff --git a/src/SixLabors.Fonts/Unicode/BidiDictionary{T1,T2}.cs b/src/SixLabors.Fonts/Unicode/BidiDictionary{T1,T2}.cs index cde400054..9d24f6fd4 100644 --- a/src/SixLabors.Fonts/Unicode/BidiDictionary{T1,T2}.cs +++ b/src/SixLabors.Fonts/Unicode/BidiDictionary{T1,T2}.cs @@ -12,9 +12,9 @@ internal sealed class BidiDictionary where T1 : struct where T2 : struct { - public Dictionary Forward { get; } = new Dictionary(); + public Dictionary Forward { get; } = new(); - public Dictionary Reverse { get; } = new Dictionary(); + public Dictionary Reverse { get; } = new(); public void Clear() { diff --git a/src/SixLabors.Fonts/Unicode/CodePoint.cs b/src/SixLabors.Fonts/Unicode/CodePoint.cs index e5057f779..f5c1eb427 100644 --- a/src/SixLabors.Fonts/Unicode/CodePoint.cs +++ b/src/SixLabors.Fonts/Unicode/CodePoint.cs @@ -105,8 +105,8 @@ private CodePoint(uint scalarValue, bool unused) // - 0x40 bit if set means 'is letter or digit' // - 0x20 bit is reserved for future use // - bottom 5 bits are the UnicodeCategory of the character - private static ReadOnlySpan AsciiCharInfo => new byte[] - { + private static ReadOnlySpan AsciiCharInfo => + [ 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x0E, 0x0E, // U+0000..U+000F 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, // U+0010..U+001F 0x8B, 0x18, 0x18, 0x18, 0x1A, 0x18, 0x18, 0x18, 0x14, 0x15, 0x18, 0x19, 0x18, 0x13, 0x18, 0x18, // U+0020..U+002F @@ -114,8 +114,8 @@ private CodePoint(uint scalarValue, bool unused) 0x18, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, // U+0040..U+004F 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x14, 0x18, 0x15, 0x1B, 0x12, // U+0050..U+005F 0x1B, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, // U+0060..U+006F - 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x14, 0x19, 0x15, 0x19, 0x0E, // U+0070..U+007F - }; + 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x14, 0x19, 0x15, 0x19, 0x0E // U+0070..U+007F + ]; /// /// Gets a value indicating whether this value is ASCII ([ U+0000..U+007F ]) @@ -179,7 +179,7 @@ public int Utf8SequenceLength /// /// Gets a instance that represents the Unicode replacement character U+FFFD. /// - public static CodePoint ReplacementChar { get; } = new CodePoint(0xFFFD); + public static CodePoint ReplacementChar { get; } = new(0xFFFD); #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member @@ -460,7 +460,7 @@ public static int GetCodePointCount(ReadOnlySpan source) } int count = 0; - var enumerator = new SpanCodePointEnumerator(source); + SpanCodePointEnumerator enumerator = new(source); while (enumerator.MoveNext()) { count++; diff --git a/src/SixLabors.Fonts/Unicode/LineBreakPairTable.cs b/src/SixLabors.Fonts/Unicode/LineBreakPairTable.cs index 00515d632..844601919 100644 --- a/src/SixLabors.Fonts/Unicode/LineBreakPairTable.cs +++ b/src/SixLabors.Fonts/Unicode/LineBreakPairTable.cs @@ -36,38 +36,71 @@ internal static class LineBreakPairTable public static byte[][] Table { get; } = new byte[][] { // . OP CL CP QU GL NS EX SY IS PR PO NU AL HL ID IN HY BA BB B2 ZW CM WJ H2 H3 JL JV JT RI EB EM ZWJ CB - new byte[] { PRBRK, PRBRK, PRBRK, PRBRK, PRBRK, PRBRK, PRBRK, PRBRK, PRBRK, PRBRK, PRBRK, PRBRK, PRBRK, PRBRK, PRBRK, PRBRK, PRBRK, PRBRK, PRBRK, PRBRK, PRBRK, CPBRK, PRBRK, PRBRK, PRBRK, PRBRK, PRBRK, PRBRK, PRBRK, PRBRK, PRBRK, PRBRK, PRBRK }, // OP - new byte[] { DIBRK, PRBRK, PRBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, PRBRK, INBRK, INBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, INBRK, DIBRK, DIBRK, PRBRK, CIBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, DIBRK }, // CL - new byte[] { DIBRK, PRBRK, PRBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, INBRK, INBRK, DIBRK, DIBRK, INBRK, INBRK, DIBRK, DIBRK, PRBRK, CIBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, DIBRK }, // CP - new byte[] { PRBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, PRBRK, CIBRK, PRBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK }, // QU - new byte[] { INBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, PRBRK, CIBRK, PRBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK }, // GL - new byte[] { DIBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, INBRK, DIBRK, DIBRK, PRBRK, CIBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, DIBRK }, // NS - new byte[] { DIBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, INBRK, INBRK, DIBRK, DIBRK, PRBRK, CIBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, DIBRK }, // EX - new byte[] { DIBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, DIBRK, DIBRK, INBRK, DIBRK, INBRK, DIBRK, DIBRK, INBRK, INBRK, DIBRK, DIBRK, PRBRK, CIBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, DIBRK }, // SY - new byte[] { DIBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, DIBRK, DIBRK, INBRK, INBRK, INBRK, DIBRK, DIBRK, INBRK, INBRK, DIBRK, DIBRK, PRBRK, CIBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, DIBRK }, // IS - new byte[] { INBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, DIBRK, DIBRK, INBRK, INBRK, INBRK, INBRK, DIBRK, INBRK, INBRK, DIBRK, DIBRK, PRBRK, CIBRK, PRBRK, INBRK, INBRK, INBRK, INBRK, INBRK, DIBRK, INBRK, INBRK, INBRK, DIBRK }, // PR - new byte[] { INBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, DIBRK, DIBRK, INBRK, INBRK, INBRK, DIBRK, DIBRK, INBRK, INBRK, DIBRK, DIBRK, PRBRK, CIBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, DIBRK }, // PO - new byte[] { INBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, INBRK, INBRK, DIBRK, INBRK, INBRK, INBRK, DIBRK, DIBRK, PRBRK, CIBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, DIBRK }, // NU - new byte[] { INBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, INBRK, INBRK, DIBRK, INBRK, INBRK, INBRK, DIBRK, DIBRK, PRBRK, CIBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, DIBRK }, // AL - new byte[] { INBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, INBRK, INBRK, DIBRK, INBRK, INBRK, INBRK, DIBRK, DIBRK, PRBRK, CIBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, DIBRK }, // HL - new byte[] { DIBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, DIBRK, INBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, INBRK, INBRK, DIBRK, DIBRK, PRBRK, CIBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, DIBRK }, // ID - new byte[] { DIBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, INBRK, INBRK, DIBRK, DIBRK, PRBRK, CIBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, DIBRK }, // IN - new byte[] { DIBRK, PRBRK, PRBRK, INBRK, DIBRK, INBRK, PRBRK, PRBRK, PRBRK, DIBRK, DIBRK, INBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, INBRK, DIBRK, DIBRK, PRBRK, CIBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, DIBRK }, // HY - new byte[] { DIBRK, PRBRK, PRBRK, INBRK, DIBRK, INBRK, PRBRK, PRBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, INBRK, DIBRK, DIBRK, PRBRK, CIBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, DIBRK }, // BA - new byte[] { INBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, PRBRK, CIBRK, PRBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, DIBRK }, // BB - new byte[] { DIBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, INBRK, DIBRK, PRBRK, PRBRK, CIBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, DIBRK }, // B2 - new byte[] { DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK }, // ZW - new byte[] { INBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, INBRK, INBRK, DIBRK, INBRK, INBRK, INBRK, DIBRK, DIBRK, PRBRK, CIBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, DIBRK }, // CM - new byte[] { INBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, PRBRK, CIBRK, PRBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK }, // WJ - new byte[] { DIBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, DIBRK, INBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, INBRK, INBRK, DIBRK, DIBRK, PRBRK, CIBRK, PRBRK, DIBRK, DIBRK, DIBRK, INBRK, INBRK, DIBRK, DIBRK, DIBRK, INBRK, DIBRK }, // H2 - new byte[] { DIBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, DIBRK, INBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, INBRK, INBRK, DIBRK, DIBRK, PRBRK, CIBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, DIBRK, DIBRK, DIBRK, INBRK, DIBRK }, // H3 - new byte[] { DIBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, DIBRK, INBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, INBRK, INBRK, DIBRK, DIBRK, PRBRK, CIBRK, PRBRK, INBRK, INBRK, INBRK, INBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, DIBRK }, // JL - new byte[] { DIBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, DIBRK, INBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, INBRK, INBRK, DIBRK, DIBRK, PRBRK, CIBRK, PRBRK, DIBRK, DIBRK, DIBRK, INBRK, INBRK, DIBRK, DIBRK, DIBRK, INBRK, DIBRK }, // JV - new byte[] { DIBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, DIBRK, INBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, INBRK, INBRK, DIBRK, DIBRK, PRBRK, CIBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, DIBRK, DIBRK, DIBRK, INBRK, DIBRK }, // JT - new byte[] { DIBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, INBRK, DIBRK, DIBRK, PRBRK, CIBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, DIBRK, DIBRK, INBRK, DIBRK }, // RI - new byte[] { DIBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, DIBRK, INBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, INBRK, INBRK, DIBRK, DIBRK, PRBRK, CIBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, INBRK, DIBRK }, // EB - new byte[] { DIBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, DIBRK, INBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, INBRK, INBRK, DIBRK, DIBRK, PRBRK, CIBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, DIBRK }, // EM - new byte[] { INBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, INBRK, INBRK, DIBRK, INBRK, INBRK, INBRK, DIBRK, DIBRK, PRBRK, CIBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, DIBRK }, // ZWJ - new byte[] { DIBRK, PRBRK, PRBRK, INBRK, INBRK, DIBRK, PRBRK, PRBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, PRBRK, CIBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, DIBRK } // CB + [PRBRK, PRBRK, PRBRK, PRBRK, PRBRK, PRBRK, PRBRK, PRBRK, PRBRK, PRBRK, PRBRK, PRBRK, PRBRK, PRBRK, PRBRK, PRBRK, PRBRK, PRBRK, PRBRK, PRBRK, PRBRK, CPBRK, PRBRK, PRBRK, PRBRK, PRBRK, PRBRK, PRBRK, PRBRK, PRBRK, PRBRK, PRBRK, PRBRK + ], // OP + [DIBRK, PRBRK, PRBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, PRBRK, INBRK, INBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, INBRK, DIBRK, DIBRK, PRBRK, CIBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, DIBRK + ], // CL + [DIBRK, PRBRK, PRBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, INBRK, INBRK, DIBRK, DIBRK, INBRK, INBRK, DIBRK, DIBRK, PRBRK, CIBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, DIBRK + ], // CP + [PRBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, PRBRK, CIBRK, PRBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK + ], // QU + [INBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, PRBRK, CIBRK, PRBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK + ], // GL + [DIBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, INBRK, DIBRK, DIBRK, PRBRK, CIBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, DIBRK + ], // NS + [DIBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, INBRK, INBRK, DIBRK, DIBRK, PRBRK, CIBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, DIBRK + ], // EX + [DIBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, DIBRK, DIBRK, INBRK, DIBRK, INBRK, DIBRK, DIBRK, INBRK, INBRK, DIBRK, DIBRK, PRBRK, CIBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, DIBRK + ], // SY + [DIBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, DIBRK, DIBRK, INBRK, INBRK, INBRK, DIBRK, DIBRK, INBRK, INBRK, DIBRK, DIBRK, PRBRK, CIBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, DIBRK + ], // IS + [INBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, DIBRK, DIBRK, INBRK, INBRK, INBRK, INBRK, DIBRK, INBRK, INBRK, DIBRK, DIBRK, PRBRK, CIBRK, PRBRK, INBRK, INBRK, INBRK, INBRK, INBRK, DIBRK, INBRK, INBRK, INBRK, DIBRK + ], // PR + [INBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, DIBRK, DIBRK, INBRK, INBRK, INBRK, DIBRK, DIBRK, INBRK, INBRK, DIBRK, DIBRK, PRBRK, CIBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, DIBRK + ], // PO + [INBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, INBRK, INBRK, DIBRK, INBRK, INBRK, INBRK, DIBRK, DIBRK, PRBRK, CIBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, DIBRK + ], // NU + [INBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, INBRK, INBRK, DIBRK, INBRK, INBRK, INBRK, DIBRK, DIBRK, PRBRK, CIBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, DIBRK + ], // AL + [INBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, INBRK, INBRK, DIBRK, INBRK, INBRK, INBRK, DIBRK, DIBRK, PRBRK, CIBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, DIBRK + ], // HL + [DIBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, DIBRK, INBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, INBRK, INBRK, DIBRK, DIBRK, PRBRK, CIBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, DIBRK + ], // ID + [DIBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, INBRK, INBRK, DIBRK, DIBRK, PRBRK, CIBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, DIBRK + ], // IN + [DIBRK, PRBRK, PRBRK, INBRK, DIBRK, INBRK, PRBRK, PRBRK, PRBRK, DIBRK, DIBRK, INBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, INBRK, DIBRK, DIBRK, PRBRK, CIBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, DIBRK + ], // HY + [DIBRK, PRBRK, PRBRK, INBRK, DIBRK, INBRK, PRBRK, PRBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, INBRK, DIBRK, DIBRK, PRBRK, CIBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, DIBRK + ], // BA + [INBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, PRBRK, CIBRK, PRBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, DIBRK + ], // BB + [DIBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, INBRK, DIBRK, PRBRK, PRBRK, CIBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, DIBRK + ], // B2 + [DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK + ], // ZW + [INBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, INBRK, INBRK, DIBRK, INBRK, INBRK, INBRK, DIBRK, DIBRK, PRBRK, CIBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, DIBRK + ], // CM + [INBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, PRBRK, CIBRK, PRBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK, INBRK + ], // WJ + [DIBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, DIBRK, INBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, INBRK, INBRK, DIBRK, DIBRK, PRBRK, CIBRK, PRBRK, DIBRK, DIBRK, DIBRK, INBRK, INBRK, DIBRK, DIBRK, DIBRK, INBRK, DIBRK + ], // H2 + [DIBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, DIBRK, INBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, INBRK, INBRK, DIBRK, DIBRK, PRBRK, CIBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, DIBRK, DIBRK, DIBRK, INBRK, DIBRK + ], // H3 + [DIBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, DIBRK, INBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, INBRK, INBRK, DIBRK, DIBRK, PRBRK, CIBRK, PRBRK, INBRK, INBRK, INBRK, INBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, DIBRK + ], // JL + [DIBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, DIBRK, INBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, INBRK, INBRK, DIBRK, DIBRK, PRBRK, CIBRK, PRBRK, DIBRK, DIBRK, DIBRK, INBRK, INBRK, DIBRK, DIBRK, DIBRK, INBRK, DIBRK + ], // JV + [DIBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, DIBRK, INBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, INBRK, INBRK, DIBRK, DIBRK, PRBRK, CIBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, DIBRK, DIBRK, DIBRK, INBRK, DIBRK + ], // JT + [DIBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, INBRK, DIBRK, DIBRK, PRBRK, CIBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, DIBRK, DIBRK, INBRK, DIBRK + ], // RI + [DIBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, DIBRK, INBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, INBRK, INBRK, DIBRK, DIBRK, PRBRK, CIBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, INBRK, DIBRK + ], // EB + [DIBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, DIBRK, INBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, INBRK, INBRK, DIBRK, DIBRK, PRBRK, CIBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, DIBRK + ], // EM + [INBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, PRBRK, PRBRK, PRBRK, INBRK, INBRK, INBRK, INBRK, INBRK, DIBRK, INBRK, INBRK, INBRK, DIBRK, DIBRK, PRBRK, CIBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, DIBRK + ], // ZWJ + [DIBRK, PRBRK, PRBRK, INBRK, INBRK, DIBRK, PRBRK, PRBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, PRBRK, CIBRK, PRBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, DIBRK, INBRK, DIBRK + ] // CB }; } diff --git a/src/SixLabors.Fonts/Unicode/MemoryExtensions.cs b/src/SixLabors.Fonts/Unicode/MemoryExtensions.cs index 21d78d19b..eff3198ba 100644 --- a/src/SixLabors.Fonts/Unicode/MemoryExtensions.cs +++ b/src/SixLabors.Fonts/Unicode/MemoryExtensions.cs @@ -88,7 +88,7 @@ public static SpanGraphemeEnumerator EnumerateGraphemes(this Span span) public static int GetGraphemeCount(this ReadOnlySpan span) { int count = 0; - var enumerator = new SpanGraphemeEnumerator(span); + SpanGraphemeEnumerator enumerator = new(span); while (enumerator.MoveNext()) { count++; @@ -105,7 +105,7 @@ public static int GetGraphemeCount(this ReadOnlySpan span) public static int GetGraphemeCount(this Span span) { int count = 0; - var enumerator = new SpanGraphemeEnumerator(span); + SpanGraphemeEnumerator enumerator = new(span); while (enumerator.MoveNext()) { count++; diff --git a/src/SixLabors.Fonts/Unicode/Resources/IndicShapingData.cs b/src/SixLabors.Fonts/Unicode/Resources/IndicShapingData.cs index 1fb945390..043bf6953 100644 --- a/src/SixLabors.Fonts/Unicode/Resources/IndicShapingData.cs +++ b/src/SixLabors.Fonts/Unicode/Resources/IndicShapingData.cs @@ -105,7 +105,7 @@ public enum BlwfMode { { ScriptClass.Devanagari, - new() + new ShapingConfiguration { HasOldSpec = true, Virama = 0x094D, @@ -117,7 +117,7 @@ public enum BlwfMode }, { ScriptClass.Bengali, - new() + new ShapingConfiguration { HasOldSpec = true, Virama = 0x09CD, @@ -129,7 +129,7 @@ public enum BlwfMode }, { ScriptClass.Gurmukhi, - new() + new ShapingConfiguration { HasOldSpec = true, Virama = 0x0A4D, @@ -141,7 +141,7 @@ public enum BlwfMode }, { ScriptClass.Gujarati, - new() + new ShapingConfiguration { HasOldSpec = true, Virama = 0x0ACD, @@ -153,7 +153,7 @@ public enum BlwfMode }, { ScriptClass.Oriya, - new() + new ShapingConfiguration { HasOldSpec = true, Virama = 0x0B4D, @@ -165,7 +165,7 @@ public enum BlwfMode }, { ScriptClass.Tamil, - new() + new ShapingConfiguration { HasOldSpec = true, Virama = 0x0BCD, @@ -177,7 +177,7 @@ public enum BlwfMode }, { ScriptClass.Telugu, - new() + new ShapingConfiguration { HasOldSpec = true, Virama = 0x0C4D, @@ -189,7 +189,7 @@ public enum BlwfMode }, { ScriptClass.Kannada, - new() + new ShapingConfiguration { HasOldSpec = true, Virama = 0x0CCD, @@ -201,7 +201,7 @@ public enum BlwfMode }, { ScriptClass.Malayalam, - new() + new ShapingConfiguration { HasOldSpec = true, Virama = 0x0D4D, @@ -213,7 +213,7 @@ public enum BlwfMode }, { ScriptClass.Khmer, - new() + new ShapingConfiguration { HasOldSpec = true, Virama = 0x17D2, @@ -228,11 +228,11 @@ public enum BlwfMode public static Dictionary Decompositions { get; } = new() { // Khmer - { 0x17BE, new int[] { 0x17C1, 0x17BE } }, - { 0x17BF, new int[] { 0x17C1, 0x17BF } }, - { 0x17C0, new int[] { 0x17C1, 0x17C0 } }, - { 0x17C4, new int[] { 0x17C1, 0x17C4 } }, - { 0x17C5, new int[] { 0x17C1, 0x17C5 } } + { 0x17BE, [0x17C1, 0x17BE] }, + { 0x17BF, [0x17C1, 0x17BF] }, + { 0x17C0, [0x17C1, 0x17C0] }, + { 0x17C4, [0x17C1, 0x17C4] }, + { 0x17C5, [0x17C1, 0x17C5] } }; internal struct ShapingConfiguration diff --git a/src/SixLabors.Fonts/Unicode/SpanGraphemeEnumerator.cs b/src/SixLabors.Fonts/Unicode/SpanGraphemeEnumerator.cs index 4256e144f..7ee3832a6 100644 --- a/src/SixLabors.Fonts/Unicode/SpanGraphemeEnumerator.cs +++ b/src/SixLabors.Fonts/Unicode/SpanGraphemeEnumerator.cs @@ -51,7 +51,7 @@ public bool MoveNext() } // Algorithm given at https://www.unicode.org/reports/tr29/#Grapheme_Cluster_Boundary_Rules. - var processor = new Processor(this.source); + Processor processor = new(this.source); processor.MoveNext(); @@ -220,7 +220,7 @@ public Processor(ReadOnlySpan source) public void MoveNext() { this.CharsConsumed += this.charsConsumed; - var codePoint = CodePoint.DecodeFromUtf16At(this.source, this.CharsConsumed, out this.charsConsumed); + CodePoint codePoint = CodePoint.DecodeFromUtf16At(this.source, this.CharsConsumed, out this.charsConsumed); this.CurrentType = CodePoint.GetGraphemeClusterClass(codePoint); } } diff --git a/src/SixLabors.Fonts/Unicode/UnicodeTrie.cs b/src/SixLabors.Fonts/Unicode/UnicodeTrie.cs index 57920bf06..9bcec1773 100644 --- a/src/SixLabors.Fonts/Unicode/UnicodeTrie.cs +++ b/src/SixLabors.Fonts/Unicode/UnicodeTrie.cs @@ -55,7 +55,7 @@ public UnicodeTrie(ReadOnlySpan rawData) public UnicodeTrie(Stream stream) { // Read the header info - using (var br = new BinaryReader(stream, Encoding.UTF8, true)) + using (BinaryReader br = new(stream, Encoding.UTF8, true)) { this.highStart = br.ReadInt32(); this.errorValue = br.ReadUInt32(); @@ -63,7 +63,7 @@ public UnicodeTrie(Stream stream) } // Read the data in compressed format. - using (var br = new BinaryReader(stream, Encoding.UTF8, true)) + using (BinaryReader br = new(stream, Encoding.UTF8, true)) { for (int i = 0; i < this.data.Length; i++) { @@ -146,7 +146,7 @@ public uint Get(uint codePoint) public void Save(Stream stream) { // Write the header info - using (var bw = new BinaryWriter(stream, Encoding.UTF8, true)) + using (BinaryWriter bw = new(stream, Encoding.UTF8, true)) { bw.Write(this.highStart); bw.Write(this.errorValue); @@ -154,7 +154,7 @@ public void Save(Stream stream) } // Write the data. - using (var bw = new BinaryWriter(stream, Encoding.UTF8, true)) + using (BinaryWriter bw = new(stream, Encoding.UTF8, true)) { for (int i = 0; i < this.data.Length; i++) { diff --git a/src/SixLabors.Fonts/Utilities/StringLoader.cs b/src/SixLabors.Fonts/Utilities/StringLoader.cs index 164af47ab..ea60fd142 100644 --- a/src/SixLabors.Fonts/Utilities/StringLoader.cs +++ b/src/SixLabors.Fonts/Utilities/StringLoader.cs @@ -28,8 +28,8 @@ public StringLoader(ushort length, ushort offset, Encoding encoding) public static StringLoader Create(BigEndianBinaryReader reader) => Create(reader, Encoding.BigEndianUnicode); - public static StringLoader Create(BigEndianBinaryReader reader, Encoding encoding) - => new StringLoader(reader.ReadUInt16(), reader.ReadUInt16(), encoding); + public static StringLoader Create(BigEndianBinaryReader reader, Encoding encoding) => + new(reader.ReadUInt16(), reader.ReadUInt16(), encoding); public void LoadValue(BigEndianBinaryReader reader) => this.Value = reader.ReadString(this.Length, this.Encoding).Replace("\0", string.Empty); diff --git a/src/UnicodeTrieGenerator/Generator.UniversalShapingEngine.cs b/src/UnicodeTrieGenerator/Generator.UniversalShapingEngine.cs index b5c389c95..24e350781 100644 --- a/src/UnicodeTrieGenerator/Generator.UniversalShapingEngine.cs +++ b/src/UnicodeTrieGenerator/Generator.UniversalShapingEngine.cs @@ -20,8 +20,7 @@ public static partial class Generator private static readonly Dictionary> UniversalCategories = new() { { - "B", new List - { + "B", [ new Dictionary { { "UISC", ISC.Number } }, new Dictionary { { "UISC", ISC.Avagraha }, { "UGC", GC.OtherLetter } }, new Dictionary { { "UISC", ISC.Bindu }, { "UGC", GC.OtherLetter } }, @@ -34,31 +33,32 @@ public static partial class Generator new Dictionary { { "UISC", ISC.Vowel }, { "UGC", GC.OtherLetter } }, new Dictionary { { "UISC", ISC.VowelIndependent } }, new Dictionary { { "UISC", ISC.VowelDependent }, { "UGC", GC.OtherLetter } } - } + ] }, { - "CGJ", new List { 0x034f } + "CGJ", [0x034f] }, { - "CM", new List - { + "CM", [ ISC.Nukta, ISC.GeminationMark, ISC.ConsonantKiller - } + ] }, - { "CS", new List { ISC.ConsonantWithStacker } }, + { "CS", [ISC.ConsonantWithStacker] }, { - "F", new List - { - new Dictionary { { "UISC", ISC.ConsonantFinal }, { "UGC", new Dictionary { { "not", GC.OtherLetter } } } }, + "F", [ + new Dictionary + { + { "UISC", ISC.ConsonantFinal }, + { "UGC", new Dictionary { { "not", GC.OtherLetter } } } + }, new Dictionary { { "UISC", ISC.ConsonantSucceedingRepha } } - } + ] }, - { "FM", new List { ISC.SyllableModifier } }, + { "FM", [ISC.SyllableModifier] }, { - "GB", new List - { + "GB", [ ISC.ConsonantPlaceholder, 0x2015, 0x2022, @@ -66,50 +66,55 @@ public static partial class Generator 0x25fc, 0x25fd, 0x25fe - } + ] }, { - "H", new List - { + "H", [ ISC.Virama, ISC.InvisibleStacker - } + ] }, - { "HN", new List { ISC.NumberJoiner } }, + { "HN", [ISC.NumberJoiner] }, { - "IND", new List - { + "IND", [ ISC.ConsonantDead, ISC.ModifyingLetter, - new Dictionary { { "UGC", GC.OtherPunctuation }, { "U", new Dictionary { { "not", new List { 0x104e, 0x2022 } } } } } - } + new Dictionary + { + { "UGC", GC.OtherPunctuation }, + { "U", new Dictionary { { "not", new List { 0x104e, 0x2022 } } } } + } + ] }, { - "M", new List - { - new Dictionary { { "UISC", ISC.ConsonantMedial }, { "UGC", new Dictionary { { "not", GC.OtherLetter } } } }, + "M", [ + new Dictionary + { + { "UISC", ISC.ConsonantMedial }, + { "UGC", new Dictionary { { "not", GC.OtherLetter } } } + }, ISC.ConsonantInitialPostfixed - } + ] }, - { "N", new List { ISC.BrahmiJoiningNumber } }, + { "N", [ISC.BrahmiJoiningNumber] }, { - "R", new List - { + "R", [ ISC.ConsonantPrecedingRepha, ISC.ConsonantPrefixed - } + ] }, - { "Rsv", new List { new Dictionary { { "UGC", GC.OtherNotAssigned } } } }, + { "Rsv", [new Dictionary { { "UGC", GC.OtherNotAssigned } }] }, { - "S", new List - { - new Dictionary { { "UGC", GC.OtherSymbol }, { "U", new Dictionary { { "not", 0x25cc } } } }, + "S", [ + new Dictionary + { + { "UGC", GC.OtherSymbol }, { "U", new Dictionary { { "not", 0x25cc } } } + }, new Dictionary { { "UGC", GC.CurrencySymbol } } - } + ] }, { - "SM", new List - { + "SM", [ 0x1b6b, 0x1b6c, 0x1b6d, @@ -119,43 +124,54 @@ public static partial class Generator 0x1b71, 0x1b72, 0x1b73 - } + ] }, { - "SUB", new List - { - new Dictionary { { "UISC", ISC.ConsonantSubjoined }, { "UGC", new Dictionary { { "not", GC.OtherLetter } } } } - } + "SUB", + [ + new Dictionary + { + { "UISC", ISC.ConsonantSubjoined }, + { "UGC", new Dictionary { { "not", GC.OtherLetter } } } + } + ] }, { - "V", new List - { - new Dictionary { { "UISC", ISC.Vowel }, { "UGC", new Dictionary { { "not", GC.OtherLetter } } } }, - new Dictionary { { "UISC", ISC.VowelDependent }, { "UGC", new Dictionary { { "not", GC.OtherLetter } } } }, + "V", [ + new Dictionary + { + { "UISC", ISC.Vowel }, { "UGC", new Dictionary { { "not", GC.OtherLetter } } } + }, + new Dictionary + { + { "UISC", ISC.VowelDependent }, + { "UGC", new Dictionary { { "not", GC.OtherLetter } } } + }, new Dictionary { { "UISC", ISC.PureKiller } } - } + ] }, { - "VM", new List - { - new Dictionary { { "UISC", ISC.Bindu }, { "UGC", new Dictionary { { "not", GC.OtherLetter } } } }, + "VM", [ + new Dictionary + { + { "UISC", ISC.Bindu }, { "UGC", new Dictionary { { "not", GC.OtherLetter } } } + }, ISC.ToneMark, ISC.CantillationMark, ISC.RegisterShifter, ISC.Visarga - } + ] }, { - "VS", new List - { + "VS", [ 0xfe00, 0xfe01, 0xfe02, 0xfe03, 0xfe04, 0xfe05, 0xfe06, 0xfe07, 0xfe08, 0xfe09, 0xfe0a, 0xfe0b, 0xfe0c, 0xfe0d, 0xfe0e, 0xfe0f - } + ] }, - { "WJ", new List { 0x2060 } }, - { "ZWJ", new List { ISC.Joiner } }, - { "ZWNJ", new List { ISC.NonJoiner } }, - { "O", new List { ISC.Other } } + { "WJ", [0x2060] }, + { "ZWJ", [ISC.Joiner] }, + { "ZWNJ", [ISC.NonJoiner] }, + { "O", [ISC.Other] } }; private static readonly Dictionary>> UniversalPositions = new() @@ -166,13 +182,13 @@ public static partial class Generator new Dictionary>() { { - "Abv", new List() { IPC.Top } + "Abv", [IPC.Top] }, { - "Blw", new List() { IPC.Bottom } + "Blw", [IPC.Bottom] }, { - "Pst", new List() { IPC.Right } + "Pst", [IPC.Right] } } }, @@ -181,16 +197,16 @@ public static partial class Generator new Dictionary>() { { - "Abv", new List() { IPC.Top } + "Abv", [IPC.Top] }, { - "Blw", new List() { IPC.Bottom, IPC.BottomAndLeft, IPC.BottomAndRight } + "Blw", [IPC.Bottom, IPC.BottomAndLeft, IPC.BottomAndRight] }, { - "Pst", new List() { IPC.Right } + "Pst", [IPC.Right] }, { - "Pre", new List() { IPC.Left, IPC.TopAndBottomAndLeft } + "Pre", [IPC.Left, IPC.TopAndBottomAndLeft] } } }, @@ -200,10 +216,10 @@ public static partial class Generator new Dictionary>() { { - "Abv", new List() { IPC.Top } + "Abv", [IPC.Top] }, { - "Blw", new List() { IPC.Bottom, IPC.Overstruck } + "Blw", [IPC.Bottom, IPC.Overstruck] } } }, @@ -213,16 +229,16 @@ public static partial class Generator new Dictionary>() { { - "Abv", new List() { IPC.Top, IPC.TopAndBottom, IPC.TopAndBottomAndRight, IPC.TopAndRight } + "Abv", [IPC.Top, IPC.TopAndBottom, IPC.TopAndBottomAndRight, IPC.TopAndRight] }, { - "Blw", new List() { IPC.Bottom, IPC.Overstruck, IPC.BottomAndRight } + "Blw", [IPC.Bottom, IPC.Overstruck, IPC.BottomAndRight] }, { - "Pst", new List() { IPC.Right } + "Pst", [IPC.Right] }, { - "Pre", new List() { IPC.Left, IPC.TopAndLeft, IPC.TopAndLeftAndRight, IPC.LeftAndRight } + "Pre", [IPC.Left, IPC.TopAndLeft, IPC.TopAndLeftAndRight, IPC.LeftAndRight] } } }, @@ -232,16 +248,16 @@ public static partial class Generator new Dictionary>() { { - "Abv", new List() { IPC.Top } + "Abv", [IPC.Top] }, { - "Blw", new List() { IPC.Bottom, IPC.Overstruck } + "Blw", [IPC.Bottom, IPC.Overstruck] }, { - "Pst", new List() { IPC.Right } + "Pst", [IPC.Right] }, { - "Pre", new List() { IPC.Left } + "Pre", [IPC.Left] } } }, @@ -251,10 +267,10 @@ public static partial class Generator new Dictionary>() { { - "Abv", new List() { IPC.Top } + "Abv", [IPC.Top] }, { - "Blw", new List() { IPC.Bottom } + "Blw", [IPC.Bottom] } } }, @@ -264,13 +280,13 @@ public static partial class Generator new Dictionary>() { { - "Abv", new List() { IPC.Top } + "Abv", [IPC.Top] }, { - "Blw", new List() { IPC.Bottom } + "Blw", [IPC.Bottom] }, { - "Pst", new List() { IPC.NA } + "Pst", [IPC.NA] } } } diff --git a/src/UnicodeTrieGenerator/StateAutomation/Compile.cs b/src/UnicodeTrieGenerator/StateAutomation/Compile.cs index b5aed88d8..399f212e1 100644 --- a/src/UnicodeTrieGenerator/StateAutomation/Compile.cs +++ b/src/UnicodeTrieGenerator/StateAutomation/Compile.cs @@ -16,7 +16,7 @@ public static StateMachine Build(string value, IDictionary? externa private static SymbolTable Parse(string value, IDictionary? externalSymbols = null) { IList ast = new GrammarParser().Parse(value); - return new SymbolTable(ast, new(externalSymbols ?? new Dictionary())); + return new SymbolTable(ast, new Dictionary(externalSymbols ?? new Dictionary())); } private static StateMachine Build(SymbolTable symbolTable) diff --git a/src/UnicodeTrieGenerator/StateAutomation/DeterministicFiniteAutomata.cs b/src/UnicodeTrieGenerator/StateAutomation/DeterministicFiniteAutomata.cs index 0732e5252..5484c5ff0 100644 --- a/src/UnicodeTrieGenerator/StateAutomation/DeterministicFiniteAutomata.cs +++ b/src/UnicodeTrieGenerator/StateAutomation/DeterministicFiniteAutomata.cs @@ -24,7 +24,7 @@ public static IEnumerable Build(ILogicalNode root, int numSymbols) State failState = new(new HashSet(), numSymbols); State initialState = new(root.FirstPos, numSymbols); - List dstates = new() { failState, initialState }; + List dstates = [failState, initialState]; // While there is an unmarked state S in dstates while (true) @@ -53,7 +53,7 @@ public static IEnumerable Build(ILogicalNode root, int numSymbols) { // let U be the union of followpos(p) for all // p in S that correspond to a - HashSet u = new(); + HashSet u = []; foreach (INode p in s.Positions) { if (p is Literal l && l.Value == a) diff --git a/src/UnicodeTrieGenerator/StateAutomation/INode.cs b/src/UnicodeTrieGenerator/StateAutomation/INode.cs index 422d8cd40..4090974c1 100644 --- a/src/UnicodeTrieGenerator/StateAutomation/INode.cs +++ b/src/UnicodeTrieGenerator/StateAutomation/INode.cs @@ -67,10 +67,10 @@ internal interface ILogicalNode : INode /// internal abstract class Node : INode { - protected List Enumerator { get; } = new(); + protected List Enumerator { get; } = []; /// - public HashSet FollowPos { get; } = new(); + public HashSet FollowPos { get; } = []; /// public virtual bool Nullable => false; @@ -110,10 +110,10 @@ internal class Variable : Node, ILogicalNode public string Name { get; } /// - HashSet ILogicalNode.FirstPos { get; } = new HashSet(); + HashSet ILogicalNode.FirstPos { get; } = []; /// - HashSet ILogicalNode.LastPos { get; } = new HashSet(); + HashSet ILogicalNode.LastPos { get; } = []; /// public override INode Copy() => new Variable(this.Name); @@ -291,10 +291,10 @@ public override INode Copy() internal abstract class Leaf : Node, ILogicalNode { /// - public HashSet FirstPos => new() { this }; + public HashSet FirstPos => [this]; /// - public HashSet LastPos => new() { this }; + public HashSet LastPos => [this]; } /// @@ -396,7 +396,7 @@ public static ILogicalNode Concat(ILogicalNode? a, ILogicalNode b) /// The . public static HashSet Union(HashSet a, HashSet b) { - var s = new HashSet(a); + HashSet s = new(a); AddAll(s, b); return s; } diff --git a/tests/SixLabors.Fonts.Tests/Accents.cs b/tests/SixLabors.Fonts.Tests/Accents.cs index da9a2eedb..b54238997 100644 --- a/tests/SixLabors.Fonts.Tests/Accents.cs +++ b/tests/SixLabors.Fonts.Tests/Accents.cs @@ -17,7 +17,7 @@ public class Accents public void MeasuringAccentedCharacterDoesNotThrow(char c) { FontFamily sans = new FontCollection().Add(TestFonts.OpenSansFile); - var font = new Font(sans, 1f, FontStyle.Regular); + Font font = new(sans, 1f, FontStyle.Regular); FontRectangle size = TextMeasurer.MeasureSize(c.ToString(), new TextOptions(font)); } @@ -34,7 +34,7 @@ public void MeasuringAccentedCharacterDoesNotThrow(char c) public void MeasuringWordWithAccentedCharacterDoesNotThrow(char c) { FontFamily sans = new FontCollection().Add(TestFonts.OpenSansFile); - var font = new Font(sans, 1f, FontStyle.Regular); + Font font = new(sans, 1f, FontStyle.Regular); FontRectangle size = TextMeasurer.MeasureSize($"abc{c}def", new TextOptions(font)); } diff --git a/tests/SixLabors.Fonts.Tests/BigEndianBinaryWriter.cs b/tests/SixLabors.Fonts.Tests/BigEndianBinaryWriter.cs index f7898b394..adcdb99c5 100644 --- a/tests/SixLabors.Fonts.Tests/BigEndianBinaryWriter.cs +++ b/tests/SixLabors.Fonts.Tests/BigEndianBinaryWriter.cs @@ -62,7 +62,7 @@ public void Flush() this.BaseStream.Flush(); } - public BigEndianBinaryReader GetReader() => new BigEndianBinaryReader(this.GetStream(), true); + public BigEndianBinaryReader GetReader() => new(this.GetStream(), true); public MemoryStream GetStream() { @@ -70,7 +70,7 @@ public MemoryStream GetStream() long p = this.BaseStream.Position; this.BaseStream.Position = 0; - var ms = new MemoryStream(); + MemoryStream ms = new(); this.BaseStream.CopyTo(ms); ms.Position = 0; this.BaseStream.Position = 0; diff --git a/tests/SixLabors.Fonts.Tests/ColorGlyphRenderer.cs b/tests/SixLabors.Fonts.Tests/ColorGlyphRenderer.cs index 907734785..3fca8c94b 100644 --- a/tests/SixLabors.Fonts.Tests/ColorGlyphRenderer.cs +++ b/tests/SixLabors.Fonts.Tests/ColorGlyphRenderer.cs @@ -9,7 +9,7 @@ namespace SixLabors.Fonts.Tests; // We should refactor tests to remove it where possible. public class ColorGlyphRenderer : GlyphRenderer { - public List Colors { get; } = new List(); + public List Colors { get; } = []; public override void BeginLayer(Paint paint, FillRule fillRule, in ClipQuad? clipBounds) { diff --git a/tests/SixLabors.Fonts.Tests/CompactFontFormatTests.cs b/tests/SixLabors.Fonts.Tests/CompactFontFormatTests.cs index 81a4554e6..372fddd4c 100644 --- a/tests/SixLabors.Fonts.Tests/CompactFontFormatTests.cs +++ b/tests/SixLabors.Fonts.Tests/CompactFontFormatTests.cs @@ -16,7 +16,7 @@ public void FDSelectFormat0_Works(string testStr, int expectedGlyphIndex) { // arrange Font font = new FontCollection().Add(TestFonts.FDArrayTest257File).CreateFont(8); - var renderer = new ColorGlyphRenderer(); + ColorGlyphRenderer renderer = new(); // act TextRenderer.RenderTextTo(renderer, testStr, new TextOptions(font)); diff --git a/tests/SixLabors.Fonts.Tests/FakeFont.cs b/tests/SixLabors.Fonts.Tests/FakeFont.cs index 3bf449403..4d77698b2 100644 --- a/tests/SixLabors.Fonts.Tests/FakeFont.cs +++ b/tests/SixLabors.Fonts.Tests/FakeFont.cs @@ -31,7 +31,7 @@ public static Font CreateFont(string text, string name = "name") internal static Font CreateFontWithInstance(string text, string name, out FakeFontInstance instance) { - var fc = (IFontMetricsCollection)new FontCollection(); + IFontMetricsCollection fc = (IFontMetricsCollection)new FontCollection(); instance = FakeFontInstance.CreateFontWithVaryingVerticalFontMetrics(text, name); Font d = fc.AddMetrics(instance, CultureInfo.InvariantCulture).CreateFont(12); return new Font(d, 1F); diff --git a/tests/SixLabors.Fonts.Tests/Fakes/FakeFontInstance.cs b/tests/SixLabors.Fonts.Tests/Fakes/FakeFontInstance.cs index 4b54b8615..5fb0696a0 100644 --- a/tests/SixLabors.Fonts.Tests/Fakes/FakeFontInstance.cs +++ b/tests/SixLabors.Fonts.Tests/Fakes/FakeFontInstance.cs @@ -33,9 +33,9 @@ public static FakeFontInstance CreateFontWithVaryingVerticalFontMetrics(string t NameTable name = GenerateNameTable(fontName); MaximumProfileTable maxp = GenerateMaxpTable(glyphs); CMapTable cmap = GenerateCMapTable(glyphs); - var glyf = new FakeGlyphTable(glyphs); + FakeGlyphTable glyf = new(glyphs); PostTable post = GeneratePostTable(); - var kern = new KerningTable(Array.Empty()); + KerningTable kern = new([]); OS2Table os2 = GenerateOS2TableWithVaryingVerticalFontMetrics(); HorizontalMetricsTable htmx = GenerateHorizontalMetricsTable(glyphs); VerticalHeadTable vhea = GenerateVerticalHeadTable(); @@ -60,16 +60,16 @@ private static TrueTypeFontTables CreateTrueTypeFontTables(string text, string f NameTable name = GenerateNameTable(fontName); MaximumProfileTable maxp = GenerateMaxpTable(glyphs); CMapTable cmap = GenerateCMapTable(glyphs); - var glyf = new FakeGlyphTable(glyphs); + FakeGlyphTable glyf = new(glyphs); PostTable post = GeneratePostTable(); - var kern = new KerningTable(Array.Empty()); + KerningTable kern = new([]); OS2Table os2 = GenerateOS2Table(); HorizontalMetricsTable htmx = GenerateHorizontalMetricsTable(glyphs); VerticalHeadTable vhea = GenerateVerticalHeadTable(); VerticalMetricsTable vmtx = GenerateVerticalMetricsTable(glyphs); IndexLocationTable loca = GenerateIndexLocationTable(glyphs); - return new(cmap, head, hhea, htmx, maxp, name, os2, post, glyf, loca) + return new TrueTypeFontTables(cmap, head, hhea, htmx, maxp, name, os2, post, glyf, loca) { Kern = kern, Vhea = vhea, @@ -79,13 +79,7 @@ private static TrueTypeFontTables CreateTrueTypeFontTables(string text, string f private static List GetGlyphs(string text) { - HashSet codePoints = new() - { - // Regardless of the encoding scheme, character codes that do - // not correspond to any glyph in the font should be mapped to glyph index 0. - // The glyph at this location must be a special glyph representing a missing character, commonly known as .notdef. - default // Add default at position 0; - }; + HashSet codePoints = [default]; foreach (CodePoint codePoint in text.AsSpan().EnumerateCodePoints()) { @@ -97,12 +91,11 @@ private static List GetGlyphs(string text) private static NameTable GenerateNameTable(string name) => new( - new[] - { + [ new NameRecord(WellKnownIds.PlatformIDs.Windows, 0, WellKnownIds.KnownNameIds.FullFontName, name), new NameRecord(WellKnownIds.PlatformIDs.Windows, 0, WellKnownIds.KnownNameIds.FontFamilyName, name) - }, - Array.Empty()); + ], + []); private static CMapTable GenerateCMapTable(List glyphs) => new(new[] { new FakeCmapSubtable(glyphs) }); @@ -117,10 +110,10 @@ private static VerticalHeadTable GenerateVerticalHeadTable() => new(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); private static OS2Table GenerateOS2Table() - => new(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, Array.Empty(), 1, 1, 1, 1, string.Empty, OS2Table.FontStyleSelection.USE_TYPO_METRICS, 1, 1, 20, 10, 20, 1, 1); + => new(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, [], 1, 1, 1, 1, string.Empty, OS2Table.FontStyleSelection.USE_TYPO_METRICS, 1, 1, 20, 10, 20, 1, 1); private static OS2Table GenerateOS2TableWithVaryingVerticalFontMetrics() - => new(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, Array.Empty(), 1, 1, 1, 1, string.Empty, OS2Table.FontStyleSelection.USE_TYPO_METRICS, 1, 1, 35, 8, 12, 33, 11); + => new(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, [], 1, 1, 1, 1, string.Empty, OS2Table.FontStyleSelection.USE_TYPO_METRICS, 1, 1, 35, 8, 12, 33, 11); private static HorizontalMetricsTable GenerateHorizontalMetricsTable(List glyphs) => new(glyphs.Select(_ => (ushort)30).ToArray(), glyphs.Select(_ => (short)10).ToArray()); @@ -142,5 +135,5 @@ private static HeadTable GenerateHeadTable() 1, HeadTable.IndexLocationFormats.Offset16); - private static PostTable GeneratePostTable() => new(2, 0, 0, 200, 35, 0, 0, 0, 0, 0, Array.Empty()); + private static PostTable GeneratePostTable() => new(2, 0, 0, 200, 35, 0, 0, 0, 0, 0, []); } diff --git a/tests/SixLabors.Fonts.Tests/FontCodePointsTests.cs b/tests/SixLabors.Fonts.Tests/FontCodePointsTests.cs index b8342e185..f2497e0bc 100644 --- a/tests/SixLabors.Fonts.Tests/FontCodePointsTests.cs +++ b/tests/SixLabors.Fonts.Tests/FontCodePointsTests.cs @@ -10,7 +10,7 @@ public class FontCodePointsTests [Fact] public void TtfTest() { - FontCollection collection = new FontCollection(); + FontCollection collection = new(); FontFamily family = collection.Add(TestFonts.SimpleFontFile); Font font = family.CreateFont(12); @@ -30,7 +30,7 @@ public void TtfTest() Assert.Contains(0x0062, codePointValues); Assert.Contains(0xFFFF, codePointValues); - HashSet glyphIds = new(); + HashSet glyphIds = []; foreach (CodePoint codePoint in codePoints) { Assert.True(font.TryGetGlyphs(codePoint, out Glyph? glyph)); @@ -64,7 +64,7 @@ public void WoffTest() Assert.Contains(0x0062, codePointValues); Assert.Contains(0xFFFF, codePointValues); - HashSet glyphIds = new(); + HashSet glyphIds = []; foreach (CodePoint codePoint in codePoints) { Assert.True(font.TryGetGlyphs(codePoint, out Glyph? glyph)); diff --git a/tests/SixLabors.Fonts.Tests/FontCollectionTests.cs b/tests/SixLabors.Fonts.Tests/FontCollectionTests.cs index 3ccefdb91..1b4d9d0da 100644 --- a/tests/SixLabors.Fonts.Tests/FontCollectionTests.cs +++ b/tests/SixLabors.Fonts.Tests/FontCollectionTests.cs @@ -10,7 +10,7 @@ public class FontCollectionTests [Fact] public void AddViaPathReturnsDescription() { - var sut = new FontCollection(); + FontCollection sut = new(); sut.Add(TestFonts.CarterOneFile, out FontDescription description); Assert.NotNull(description); @@ -22,7 +22,7 @@ public void AddViaPathReturnsDescription() [Fact] public void AddViaPathAddFontFileInstances() { - var sut = new FontCollection(); + FontCollection sut = new(); FontFamily family = sut.Add(TestFonts.CarterOneFile, out FontDescription descriptions); IEnumerable allInstances = ((IReadOnlyFontMetricsCollection)sut).GetAllMetrics(family.Name, CultureInfo.InvariantCulture); @@ -36,7 +36,7 @@ public void AddViaPathAddFontFileInstances() [Fact] public void AddViaStreamReturnsDescription() { - var sut = new FontCollection(); + FontCollection sut = new(); using Stream s = TestFonts.CarterOneFileData(); FontFamily family = sut.Add(s, out FontDescription description); Assert.NotNull(description); @@ -59,7 +59,7 @@ public void NotFoundThrowsCorrectException() [Fact] public void CanAddSystemFonts() { - var collection = new FontCollection(); + FontCollection collection = new(); Assert.False(collection.Families.Any()); @@ -72,7 +72,7 @@ public void CanAddSystemFonts() [Fact] public void CanAddSystemFontsWithFilter() { - var collection = new FontCollection(); + FontCollection collection = new(); collection.AddSystemFonts(_ => false); Assert.False(collection.Families.Any()); diff --git a/tests/SixLabors.Fonts.Tests/FontDescriptionTests.cs b/tests/SixLabors.Fonts.Tests/FontDescriptionTests.cs index e0e1d740b..72706ebf2 100644 --- a/tests/SixLabors.Fonts.Tests/FontDescriptionTests.cs +++ b/tests/SixLabors.Fonts.Tests/FontDescriptionTests.cs @@ -11,7 +11,7 @@ public class FontDescriptionTests [Fact] public void LoadFontDescription() { - var writer = new BigEndianBinaryWriter(); + BigEndianBinaryWriter writer = new(); writer.WriteTrueTypeFileHeader(1, 0, 0, 0); writer.WriteTableHeader("name", 0, 28, 999); writer.WriteNameTable( @@ -22,7 +22,7 @@ public void LoadFontDescription() { KnownNameIds.FontFamilyName, "fam" } }); - var description = FontDescription.LoadDescription(writer.GetStream()); + FontDescription description = FontDescription.LoadDescription(writer.GetStream()); Assert.Equal("name", description.FontNameInvariantCulture); Assert.Equal("sub", description.FontSubFamilyNameInvariantCulture); Assert.Equal("fam", description.FontFamilyInvariantCulture); @@ -31,11 +31,11 @@ public void LoadFontDescription() [Fact] public void LoadFontDescription_CultureNamePriority_FirstWindows() { - var usCulture = new CultureInfo(0x0409); - var c1 = new CultureInfo(1034); // spanish - international - var c2 = new CultureInfo(3082); // spanish - traditional + CultureInfo usCulture = new(0x0409); + CultureInfo c1 = new(1034); // spanish - international + CultureInfo c2 = new(3082); // spanish - traditional - var writer = new BigEndianBinaryWriter(); + BigEndianBinaryWriter writer = new(); writer.WriteTrueTypeFileHeader(1, 0, 0, 0); writer.WriteTableHeader("name", 0, 28, 999); writer.WriteNameTable( @@ -46,7 +46,7 @@ public void LoadFontDescription_CultureNamePriority_FirstWindows() (KnownNameIds.FontSubfamilyName, "sub_c2", c2), (KnownNameIds.FontFamilyName, "fam_c2", c2)); - var description = FontDescription.LoadDescription(writer.GetStream()); + FontDescription description = FontDescription.LoadDescription(writer.GetStream()); // unknown culture should prioritise US, but missing so will return first Assert.Equal("name_c1", description.FontNameInvariantCulture); @@ -57,11 +57,11 @@ public void LoadFontDescription_CultureNamePriority_FirstWindows() [Fact] public void LoadFontDescription_CultureNamePriority_US() { - var usCulture = new CultureInfo(0x0409); - var c1 = new CultureInfo(1034); // spanish - international - var c2 = new CultureInfo(3082); // spanish - traditional + CultureInfo usCulture = new(0x0409); + CultureInfo c1 = new(1034); // spanish - international + CultureInfo c2 = new(3082); // spanish - traditional - var writer = new BigEndianBinaryWriter(); + BigEndianBinaryWriter writer = new(); writer.WriteTrueTypeFileHeader(1, 0, 0, 0); writer.WriteTableHeader("name", 0, 28, 999); writer.WriteNameTable( @@ -75,7 +75,7 @@ public void LoadFontDescription_CultureNamePriority_US() (KnownNameIds.FontSubfamilyName, "sub_us", usCulture), (KnownNameIds.FontFamilyName, "fam_us", usCulture)); - var description = FontDescription.LoadDescription(writer.GetStream()); + FontDescription description = FontDescription.LoadDescription(writer.GetStream()); // unknown culture should prioritise US, but missing so will return first Assert.Equal("name_us", description.FontNameInvariantCulture); @@ -86,11 +86,11 @@ public void LoadFontDescription_CultureNamePriority_US() [Fact] public void LoadFontDescription_CultureNamePriority_ExactMatch() { - var usCulture = new CultureInfo(0x0409); - var c1 = new CultureInfo(1034); // spanish - international - var c2 = new CultureInfo(3082); // spanish - traditional + CultureInfo usCulture = new(0x0409); + CultureInfo c1 = new(1034); // spanish - international + CultureInfo c2 = new(3082); // spanish - traditional - var writer = new BigEndianBinaryWriter(); + BigEndianBinaryWriter writer = new(); writer.WriteTrueTypeFileHeader(1, 0, 0, 0); writer.WriteTableHeader("name", 0, 28, 999); writer.WriteNameTable( @@ -104,7 +104,7 @@ public void LoadFontDescription_CultureNamePriority_ExactMatch() (KnownNameIds.FontSubfamilyName, "sub_us", usCulture), (KnownNameIds.FontFamilyName, "fam_us", usCulture)); - var description = FontDescription.LoadDescription(writer.GetStream()); + FontDescription description = FontDescription.LoadDescription(writer.GetStream()); // unknown culture should prioritise US, but missing so will return first Assert.Equal("name_c2", description.FontName(c2)); @@ -135,10 +135,10 @@ public void CanLoadFontCollectionDescriptionsFromPath() [Fact] public void LoadFontDescription_GetNameById() { - var c1 = new CultureInfo(1034); // spanish - international - var c2 = new CultureInfo(3082); // spanish - traditional + CultureInfo c1 = new(1034); // spanish - international + CultureInfo c2 = new(3082); // spanish - traditional - var writer = new BigEndianBinaryWriter(); + BigEndianBinaryWriter writer = new(); writer.WriteTrueTypeFileHeader(1, 0, 0, 0); writer.WriteTableHeader("name", 0, 28, 999); writer.WriteNameTable( @@ -149,7 +149,7 @@ public void LoadFontDescription_GetNameById() (KnownNameIds.FontSubfamilyName, "sub_c2", c2), (KnownNameIds.FontFamilyName, "fam_c2", c2)); - var description = FontDescription.LoadDescription(writer.GetStream()); + FontDescription description = FontDescription.LoadDescription(writer.GetStream()); Assert.Equal("name_c1", description.GetNameById(c1, KnownNameIds.FullFontName)); Assert.Equal("sub_c1", description.GetNameById(c1, KnownNameIds.FontSubfamilyName)); diff --git a/tests/SixLabors.Fonts.Tests/FontLoaderTests.cs b/tests/SixLabors.Fonts.Tests/FontLoaderTests.cs index f3823fc9b..fdeb270ac 100644 --- a/tests/SixLabors.Fonts.Tests/FontLoaderTests.cs +++ b/tests/SixLabors.Fonts.Tests/FontLoaderTests.cs @@ -140,7 +140,7 @@ public void LoadFontWithIncorrectClassDefinitionTableOffset() // See https://forum.stimulsoft.com/viewtopic.php?t=60972 Font font = new FontCollection().Add(TestFonts.THSarabunFile).CreateFont(12); - FontRectangle advance = TextMeasurer.MeasureAdvance("เราใช้คุกกี้เพื่อพัฒนาประสิทธิภาพ และประสบการณ์ที่ดีในการใช้เว็บไซต์ของคุณ คุณสามารถศึกษารายละเอียดได้ที่", new(font)); + FontRectangle advance = TextMeasurer.MeasureAdvance("เราใช้คุกกี้เพื่อพัฒนาประสิทธิภาพ และประสบการณ์ที่ดีในการใช้เว็บไซต์ของคุณ คุณสามารถศึกษารายละเอียดได้ที่", new TextOptions(font)); Assert.NotEqual(default, advance); } diff --git a/tests/SixLabors.Fonts.Tests/FontReaderTests.cs b/tests/SixLabors.Fonts.Tests/FontReaderTests.cs index 2c0983279..a6ffeae6b 100644 --- a/tests/SixLabors.Fonts.Tests/FontReaderTests.cs +++ b/tests/SixLabors.Fonts.Tests/FontReaderTests.cs @@ -12,32 +12,32 @@ public class FontReaderTests [Fact] public void ReadTrueTypeOutlineType() { - var writer = new BigEndianBinaryWriter(); + BigEndianBinaryWriter writer = new(); writer.WriteTrueTypeFileHeader(0, 0, 0, 0); - using var reader = new FontReader(writer.GetStream()); + using FontReader reader = new(writer.GetStream()); Assert.Equal(OutlineType.TrueType, reader.OutlineType); } [Fact] public void ReadCffOutlineType() { - var writer = new BigEndianBinaryWriter(); + BigEndianBinaryWriter writer = new(); writer.WriteCffFileHeader(0, 0, 0, 0); - using var reader = new FontReader(writer.GetStream()); + using FontReader reader = new(writer.GetStream()); Assert.Equal(OutlineType.CFF, reader.OutlineType); } [Fact] public void ReadTableHeaders() { - var writer = new BigEndianBinaryWriter(); + BigEndianBinaryWriter writer = new(); writer.WriteTrueTypeFileHeader(2, 0, 0, 0); writer.WriteTableHeader("name", 0, 10, 0); writer.WriteTableHeader("cmap", 0, 1, 0); - using var reader = new FontReader(writer.GetStream()); + using FontReader reader = new(writer.GetStream()); Assert.Equal(2, reader.Headers.Count); } @@ -45,7 +45,7 @@ public void ReadTableHeaders() [Fact] public void ReadCMapTable() { - var writer = new BigEndianBinaryWriter(); + BigEndianBinaryWriter writer = new(); writer.WriteTrueTypeFileHeader(new TableHeader("cmap", 0, 0, 20)); @@ -56,10 +56,10 @@ public void ReadCMapTable() 0, WellKnownIds.PlatformIDs.Macintosh, 1, - new byte[] { 2, 9 }) + [2, 9]) }); - using var reader = new FontReader(writer.GetStream()); + using FontReader reader = new(writer.GetStream()); CMapTable cmap = reader.GetTable(); Assert.NotNull(cmap); } @@ -67,8 +67,8 @@ public void ReadCMapTable() [Fact] public void ReadFont_WithWoffFormat_EqualsTtf() { - using var fontReaderTtf = new FontReader(TestFonts.OpenSansTtfData()); - using var fontReaderWoff = new FontReader(TestFonts.OpensSansWoff1Data()); + using FontReader fontReaderTtf = new(TestFonts.OpenSansTtfData()); + using FontReader fontReaderWoff = new(TestFonts.OpensSansWoff1Data()); Assert.Equal(fontReaderTtf.Headers.Count, fontReaderWoff.Headers.Count); foreach (string key in fontReaderTtf.Headers.Keys) @@ -80,9 +80,9 @@ public void ReadFont_WithWoffFormat_EqualsTtf() [Fact] public void GlyphsCount_WithWoffFormat_EqualsTtf() { - using var fontReaderWoff = new FontReader(TestFonts.OpensSansWoff1Data()); + using FontReader fontReaderWoff = new(TestFonts.OpensSansWoff1Data()); GlyphTable glyphsWoff = fontReaderWoff.GetTable(); - using var fontReaderTtf = new FontReader(TestFonts.OpenSansTtfData()); + using FontReader fontReaderTtf = new(TestFonts.OpenSansTtfData()); GlyphTable glyphsTtf = fontReaderTtf.GetTable(); Assert.Equal(glyphsTtf.GlyphCount, glyphsWoff.GlyphCount); @@ -91,8 +91,8 @@ public void GlyphsCount_WithWoffFormat_EqualsTtf() [Fact] public void ReadFont_WithWoff2Format_EqualsTtf() { - using var fontReaderTtf = new FontReader(TestFonts.OpenSansTtfData()); - using var fontReaderWoff = new FontReader(TestFonts.OpensSansWoff2Data()); + using FontReader fontReaderTtf = new(TestFonts.OpenSansTtfData()); + using FontReader fontReaderWoff = new(TestFonts.OpensSansWoff2Data()); Assert.Equal(fontReaderTtf.Headers.Count, fontReaderWoff.Headers.Count); foreach (string key in fontReaderTtf.Headers.Keys) @@ -104,9 +104,9 @@ public void ReadFont_WithWoff2Format_EqualsTtf() [Fact] public void GlyphsCount_WithWoff2Format_EqualsTtf() { - using var fontReaderWoff = new FontReader(TestFonts.OpensSansWoff2Data()); + using FontReader fontReaderWoff = new(TestFonts.OpensSansWoff2Data()); GlyphTable glyphsWoff = fontReaderWoff.GetTable(); - using var fontReaderTtf = new FontReader(TestFonts.OpenSansTtfData()); + using FontReader fontReaderTtf = new(TestFonts.OpenSansTtfData()); GlyphTable glyphsTtf = fontReaderTtf.GetTable(); Assert.Equal(glyphsTtf.GlyphCount, glyphsWoff.GlyphCount); diff --git a/tests/SixLabors.Fonts.Tests/FontRectangleTests.cs b/tests/SixLabors.Fonts.Tests/FontRectangleTests.cs index 33a89263f..a6a05fc9b 100644 --- a/tests/SixLabors.Fonts.Tests/FontRectangleTests.cs +++ b/tests/SixLabors.Fonts.Tests/FontRectangleTests.cs @@ -19,10 +19,10 @@ public void DefaultConstructorTest() [InlineData(0, float.MinValue, float.MaxValue, 0)] public void NonDefaultConstructorTest(float x, float y, float width, float height) { - var rect1 = new FontRectangle(x, y, width, height); - var p = new Vector2(x, y); - var s = new Vector2(width, height); - var rect2 = new FontRectangle(p, s); + FontRectangle rect1 = new(x, y, width, height); + Vector2 p = new(x, y); + Vector2 s = new(width, height); + FontRectangle rect2 = new(p, s); Assert.Equal(rect1, rect2); } @@ -34,8 +34,8 @@ public void NonDefaultConstructorTest(float x, float y, float width, float heigh [InlineData(0, float.MinValue, float.MaxValue, 0)] public void FromLTRBTest(float left, float top, float right, float bottom) { - var expected = new FontRectangle(left, top, right - left, bottom - top); - var actual = FontRectangle.FromLTRB(left, top, right, bottom); + FontRectangle expected = new(left, top, right - left, bottom - top); + FontRectangle actual = FontRectangle.FromLTRB(left, top, right, bottom); Assert.Equal(expected, actual); } @@ -47,9 +47,9 @@ public void FromLTRBTest(float left, float top, float right, float bottom) [InlineData(0, float.MinValue, float.MaxValue, 0)] public void DimensionsTest(float x, float y, float width, float height) { - var rect = new FontRectangle(x, y, width, height); - var p = new Vector2(x, y); - var s = new Vector2(width, height); + FontRectangle rect = new(x, y, width, height); + Vector2 p = new(x, y); + Vector2 s = new(width, height); Assert.Equal(p, rect.Location); Assert.Equal(s, rect.Size); @@ -80,8 +80,8 @@ public void IsEmptyTest() [InlineData(float.MaxValue, float.MinValue)] public void LocationSetTest(float x, float y) { - var point = new Vector2(x, y); - var rect = new FontRectangle(point.X, point.Y, 10, 10); + Vector2 point = new(x, y); + FontRectangle rect = new(point.X, point.Y, 10, 10); Assert.Equal(point, rect.Location); Assert.Equal(point.X, rect.X); Assert.Equal(point.Y, rect.Y); @@ -92,8 +92,8 @@ public void LocationSetTest(float x, float y) [InlineData(float.MaxValue, float.MinValue)] public void SizeSetTest(float x, float y) { - var size = new Vector2(x, y); - var rect = new FontRectangle(10, 10, size.X, size.Y); + Vector2 size = new(x, y); + FontRectangle rect = new(10, 10, size.X, size.Y); Assert.Equal(size, rect.Size); Assert.Equal(size.X, rect.Width); Assert.Equal(size.Y, rect.Height); @@ -105,8 +105,8 @@ public void SizeSetTest(float x, float y) [InlineData(0, float.MinValue, float.MaxValue, 0)] public void EqualityTest(float x, float y, float width, float height) { - var rect1 = new FontRectangle(x, y, width, height); - var rect2 = new FontRectangle(width, height, x, y); + FontRectangle rect1 = new(x, y, width, height); + FontRectangle rect2 = new(width, height, x, y); Assert.True(rect1 != rect2); Assert.False(rect1 == rect2); @@ -117,8 +117,8 @@ public void EqualityTest(float x, float y, float width, float height) [Fact] public void GetHashCodeTest() { - var rect1 = new FontRectangle(10, 10, 10, 10); - var rect2 = new FontRectangle(10, 10, 10, 10); + FontRectangle rect1 = new(10, 10, 10, 10); + FontRectangle rect2 = new(10, 10, 10, 10); Assert.Equal(rect1.GetHashCode(), rect2.GetHashCode()); Assert.NotEqual(rect1.GetHashCode(), new FontRectangle(20, 10, 10, 10).GetHashCode()); Assert.NotEqual(rect1.GetHashCode(), new FontRectangle(10, 20, 10, 10).GetHashCode()); @@ -131,11 +131,11 @@ public void GetHashCodeTest() [InlineData(0, float.MinValue, float.MaxValue, 0)] public void ContainsTest(float x, float y, float width, float height) { - var rect = new FontRectangle(x, y, width, height); + FontRectangle rect = new(x, y, width, height); float x1 = (x + width) / 2; float y1 = (y + height) / 2; - var p = new Vector2(x1, y1); - var r = new FontRectangle(x1, y1, width / 2, height / 2); + Vector2 p = new(x1, y1); + FontRectangle r = new(x1, y1, width / 2, height / 2); Assert.False(rect.Contains(x1, y1)); Assert.False(rect.Contains(p)); @@ -148,13 +148,13 @@ public void ContainsTest(float x, float y, float width, float height) [InlineData(0, float.MinValue, float.MaxValue, 0)] public void InflateTest(float x, float y, float width, float height) { - var rect = new FontRectangle(x, y, width, height); - var inflatedRect = new FontRectangle(x - width, y - height, width + (2 * width), height + (2 * height)); + FontRectangle rect = new(x, y, width, height); + FontRectangle inflatedRect = new(x - width, y - height, width + (2 * width), height + (2 * height)); rect = rect.Inflate(width, height); Assert.Equal(inflatedRect, rect); - var s = new Vector2(x, y); + Vector2 s = new(x, y); inflatedRect = FontRectangle.Inflate(rect, x, y); rect = rect.Inflate(s); @@ -166,9 +166,9 @@ public void InflateTest(float x, float y, float width, float height) [InlineData(0, float.MinValue, float.MaxValue, 0)] public void IntersectTest(float x, float y, float width, float height) { - var rect1 = new FontRectangle(x, y, width, height); - var rect2 = new FontRectangle(y, x, width, height); - var expectedRect = FontRectangle.Intersect(rect1, rect2); + FontRectangle rect1 = new(x, y, width, height); + FontRectangle rect2 = new(y, x, width, height); + FontRectangle expectedRect = FontRectangle.Intersect(rect1, rect2); rect1 = rect1.Intersect(rect2); Assert.Equal(expectedRect, rect1); Assert.False(rect1.IntersectsWith(expectedRect)); @@ -177,9 +177,9 @@ public void IntersectTest(float x, float y, float width, float height) [Fact] public void IntersectIntersectingRectsTest() { - var rect1 = new FontRectangle(0, 0, 5, 5); - var rect2 = new FontRectangle(1, 1, 3, 3F); - var expected = new FontRectangle(1, 1, 3, 3F); + FontRectangle rect1 = new(0, 0, 5, 5); + FontRectangle rect2 = new(1, 1, 3, 3F); + FontRectangle expected = new(1, 1, 3, 3F); Assert.Equal(expected, FontRectangle.Intersect(rect1, rect2)); } @@ -191,15 +191,15 @@ public void IntersectIntersectingRectsTest() [InlineData(0, float.MinValue, float.MaxValue, 0)] public void UnionTest(float x, float y, float width, float height) { - var a = new FontRectangle(x, y, width, height); - var b = new FontRectangle(width, height, x, y); + FontRectangle a = new(x, y, width, height); + FontRectangle b = new(width, height, x, y); float x1 = Math.Min(a.X, b.X); float x2 = Math.Max(a.X + a.Width, b.X + b.Width); float y1 = Math.Min(a.Y, b.Y); float y2 = Math.Max(a.Y + a.Height, b.Y + b.Height); - var expectedRectangle = new FontRectangle(x1, y1, x2 - x1, y2 - y1); + FontRectangle expectedRectangle = new(x1, y1, x2 - x1, y2 - y1); Assert.Equal(expectedRectangle, FontRectangle.Union(a, b)); } @@ -211,9 +211,9 @@ public void UnionTest(float x, float y, float width, float height) [InlineData(0, float.MinValue, float.MaxValue, 0)] public void OffsetTest(float x, float y, float width, float height) { - var r1 = new FontRectangle(x, y, width, height); - var expectedRect = new FontRectangle(x + width, y + height, width, height); - var p = new Vector2(width, height); + FontRectangle r1 = new(x, y, width, height); + FontRectangle expectedRect = new(x + width, y + height, width, height); + Vector2 p = new(width, height); r1 = r1.Offset(p); Assert.Equal(expectedRect, r1); @@ -226,7 +226,7 @@ public void OffsetTest(float x, float y, float width, float height) [Fact] public void ToStringTest() { - var r = new FontRectangle(5, 5.1F, 1.3F, 1F); + FontRectangle r = new(5, 5.1F, 1.3F, 1F); Assert.Equal(string.Format(CultureInfo.CurrentCulture, "FontRectangle [ X={0}, Y={1}, Width={2}, Height={3} ]", r.X, r.Y, r.Width, r.Height), r.ToString()); } diff --git a/tests/SixLabors.Fonts.Tests/FontTests.cs b/tests/SixLabors.Fonts.Tests/FontTests.cs index af6df49e3..c801c8f13 100644 --- a/tests/SixLabors.Fonts.Tests/FontTests.cs +++ b/tests/SixLabors.Fonts.Tests/FontTests.cs @@ -44,9 +44,9 @@ public void FontClass_NullWithSizeFontThrowsException() [Fact] public void FontClassWithPath_SetProperties() { - var collection = new FontCollection(); + FontCollection collection = new(); FontFamily family = collection.Add(TestFonts.CarterOneFile); - var font = new Font(family, 12); + Font font = new(family, 12); Assert.Equal("Carter One", font.Name); Assert.Equal(12, font.Size); @@ -60,10 +60,10 @@ public void FontClassWithPath_SetProperties() [Fact] public void FontClassNoPath_SetProperties() { - var collection = new FontCollection(); + FontCollection collection = new(); using Stream stream = TestFonts.CarterOneFileData(); FontFamily family = collection.Add(stream); - var font = new Font(family, 12); + Font font = new(family, 12); Assert.Equal("Carter One", font.Name); Assert.Equal(12, font.Size); diff --git a/tests/SixLabors.Fonts.Tests/GlyphRenderer.cs b/tests/SixLabors.Fonts.Tests/GlyphRenderer.cs index ca7ad5d82..276d12bf2 100644 --- a/tests/SixLabors.Fonts.Tests/GlyphRenderer.cs +++ b/tests/SixLabors.Fonts.Tests/GlyphRenderer.cs @@ -11,13 +11,13 @@ public class GlyphRenderer : IGlyphRenderer private int figuresCount; private GlyphRendererParameters parameters; - public List ControlPoints { get; } = new(); + public List ControlPoints { get; } = []; - public List ControlPointsOnCurve { get; } = new(); + public List ControlPointsOnCurve { get; } = []; - public List GlyphRects { get; } = new(); + public List GlyphRects { get; } = []; - public List GlyphKeys { get; } = new(); + public List GlyphKeys { get; } = []; public bool BeginGlyph(in FontRectangle bounds, in GlyphRendererParameters parameters) { diff --git a/tests/SixLabors.Fonts.Tests/Issues/Issues_104.cs b/tests/SixLabors.Fonts.Tests/Issues/Issues_104.cs index 3cb734f19..3acf3c38e 100644 --- a/tests/SixLabors.Fonts.Tests/Issues/Issues_104.cs +++ b/tests/SixLabors.Fonts.Tests/Issues/Issues_104.cs @@ -12,16 +12,16 @@ public class Issues_104 [Fact] public void Format4SubTableWithSegmentsHasOffByOneWhenOverflowing() { - Segment[] segments = new[] - { - new Segment( + Segment[] segments = + [ + new( 0, ushort.MaxValue, // end ushort.MinValue, // start of range short.MaxValue, // delta 0) // zero to force correctly tested codepath - }; - var tbl = new Format4SubTable( + ]; + Format4SubTable tbl = new( 0, WellKnownIds.PlatformIDs.Windows, 0, diff --git a/tests/SixLabors.Fonts.Tests/Issues/Issues_203.cs b/tests/SixLabors.Fonts.Tests/Issues/Issues_203.cs index a416c7808..416c986b8 100644 --- a/tests/SixLabors.Fonts.Tests/Issues/Issues_203.cs +++ b/tests/SixLabors.Fonts.Tests/Issues/Issues_203.cs @@ -8,7 +8,7 @@ public class Issues_203 [Fact] public void CanParseVersion1Font() { - var font = FontDescription.LoadDescription(TestFonts.Version1Font); + FontDescription font = FontDescription.LoadDescription(TestFonts.Version1Font); Assert.NotNull(font); } } diff --git a/tests/SixLabors.Fonts.Tests/Issues/Issues_33.cs b/tests/SixLabors.Fonts.Tests/Issues/Issues_33.cs index 8b2db2c75..6a82a728c 100644 --- a/tests/SixLabors.Fonts.Tests/Issues/Issues_33.cs +++ b/tests/SixLabors.Fonts.Tests/Issues/Issues_33.cs @@ -26,7 +26,7 @@ public void WhiteSpaceAtStartOfLineNotMeasured(string text, float width, float h public static Font CreateFont(string text) { - var fc = (IFontMetricsCollection)new FontCollection(); + IFontMetricsCollection fc = (IFontMetricsCollection)new FontCollection(); Font d = fc.AddMetrics(new FakeFontInstance(text), CultureInfo.InvariantCulture).CreateFont(12); return new Font(d, 1F); } diff --git a/tests/SixLabors.Fonts.Tests/Issues/Issues_337.cs b/tests/SixLabors.Fonts.Tests/Issues/Issues_337.cs index e93dcb16a..2f1db23b7 100644 --- a/tests/SixLabors.Fonts.Tests/Issues/Issues_337.cs +++ b/tests/SixLabors.Fonts.Tests/Issues/Issues_337.cs @@ -22,14 +22,14 @@ public void CanShapeCompositeGlyphs() Assert.Equal(5, renderer.GlyphKeys.Count); Assert.Equal(5, renderer.GlyphRects.Count); - var expected = new FontRectangle[] - { - new FontRectangle(0, -254.99994F, 1024, 1024), - new FontRectangle(1024, -254.99994F, 1024, 1024), - new FontRectangle(2048, -254.99994F, 1024, 1024), - new FontRectangle(3072, -254.99994F, 1024, 1024), - new FontRectangle(4096, -254.99994F, 1024, 1024) - }; + FontRectangle[] expected = + [ + new(0, -254.99994F, 1024, 1024), + new(1024, -254.99994F, 1024, 1024), + new(2048, -254.99994F, 1024, 1024), + new(3072, -254.99994F, 1024, 1024), + new(4096, -254.99994F, 1024, 1024) + ]; for (int i = 0; i < expected.Length; i++) { diff --git a/tests/SixLabors.Fonts.Tests/Issues/Issues_417.cs b/tests/SixLabors.Fonts.Tests/Issues/Issues_417.cs index 0d12f914f..6798a94bd 100644 --- a/tests/SixLabors.Fonts.Tests/Issues/Issues_417.cs +++ b/tests/SixLabors.Fonts.Tests/Issues/Issues_417.cs @@ -30,7 +30,7 @@ public void DoesNotThrow_InvalidAnchor() GlyphRenderer renderer = new(); TextRenderer.RenderTextTo(renderer, "Text", new TextOptions(font)); - int[] expectedGlyphIndices = { 55, 72, 91, 87 }; + int[] expectedGlyphIndices = [55, 72, 91, 87]; Assert.Equal(expectedGlyphIndices.Length, renderer.GlyphKeys.Count); for (int i = 0; i < expectedGlyphIndices.Length; i++) { diff --git a/tests/SixLabors.Fonts.Tests/Issues/Issues_429.cs b/tests/SixLabors.Fonts.Tests/Issues/Issues_429.cs index 369a6775b..244e87574 100644 --- a/tests/SixLabors.Fonts.Tests/Issues/Issues_429.cs +++ b/tests/SixLabors.Fonts.Tests/Issues/Issues_429.cs @@ -24,7 +24,7 @@ public void VerticalMixedLayout_ExpectedRotation() // Only the Latin glyph + space should be rotated. // Any other glyphs that appear rotated have actually been substituted by the font. - int[] rotatedGlyphs = new int[] { 20, 21, 22, 23, 24, 25, 26, 27 }; + int[] rotatedGlyphs = [20, 21, 22, 23, 24, 25, 26, 27]; for (int i = 0; i < glyphs.Count; i++) { diff --git a/tests/SixLabors.Fonts.Tests/Issues/Issues_47.cs b/tests/SixLabors.Fonts.Tests/Issues/Issues_47.cs index 283dfd5c9..82e40a593 100644 --- a/tests/SixLabors.Fonts.Tests/Issues/Issues_47.cs +++ b/tests/SixLabors.Fonts.Tests/Issues/Issues_47.cs @@ -14,7 +14,7 @@ public void LeftAlignedTextNewLineShouldNotStartWithWhiteSpace(string text) { Font font = CreateFont("\t x"); - var r = new GlyphRenderer(); + GlyphRenderer r = new(); IReadOnlyList layout = TextLayout.GenerateLayout(text.AsSpan(), new TextOptions(new Font(font, 30)) { @@ -42,7 +42,7 @@ public void NewWrappedLinesShouldNotStartOrEndWithWhiteSpace(string text, Horizo { Font font = CreateFont("\t x"); - var r = new GlyphRenderer(); + GlyphRenderer r = new(); IReadOnlyList layout = TextLayout.GenerateLayout(text.AsSpan(), new TextOptions(new Font(font, 30)) { @@ -69,7 +69,7 @@ public void WhiteSpaceAtStartOfTextShouldNotBeTrimmed() Font font = CreateFont("\t x"); string text = " hello world hello world hello world"; - var r = new GlyphRenderer(); + GlyphRenderer r = new(); IReadOnlyList layout = TextLayout.GenerateLayout(text.AsSpan(), new TextOptions(new Font(font, 30)) { @@ -87,7 +87,7 @@ public void WhiteSpaceAtTheEndOfTextShouldBeTrimmed() Font font = CreateFont("\t x"); string text = "hello world hello world hello world "; - var r = new GlyphRenderer(); + GlyphRenderer r = new(); IReadOnlyList layout = TextLayout.GenerateLayout(text.AsSpan(), new TextOptions(new Font(font, 30)) { @@ -101,7 +101,7 @@ public void WhiteSpaceAtTheEndOfTextShouldBeTrimmed() public static Font CreateFont(string text) { - var fc = (IFontMetricsCollection)new FontCollection(); + IFontMetricsCollection fc = (IFontMetricsCollection)new FontCollection(); Font d = fc.AddMetrics(new FakeFontInstance(text), CultureInfo.InvariantCulture).CreateFont(12); return new Font(d, 1F); } diff --git a/tests/SixLabors.Fonts.Tests/Native/MacSystemFontsEnumeratorTests.cs b/tests/SixLabors.Fonts.Tests/Native/MacSystemFontsEnumeratorTests.cs index 4b486c6ea..75e367bbf 100644 --- a/tests/SixLabors.Fonts.Tests/Native/MacSystemFontsEnumeratorTests.cs +++ b/tests/SixLabors.Fonts.Tests/Native/MacSystemFontsEnumeratorTests.cs @@ -16,12 +16,12 @@ public void TestReset() return; } - using var enumerator = new MacSystemFontsEnumerator(); - var fonts1 = new HashSet(enumerator); + using MacSystemFontsEnumerator enumerator = new(); + HashSet fonts1 = new(enumerator); Assert.NotEmpty(fonts1); enumerator.Reset(); - var fonts2 = new HashSet(enumerator); + HashSet fonts2 = new(enumerator); Assert.Empty(fonts1.Except(fonts2)); } } diff --git a/tests/SixLabors.Fonts.Tests/SixLabors.Fonts.Tests.csproj b/tests/SixLabors.Fonts.Tests/SixLabors.Fonts.Tests.csproj index 74a10e685..28228b1ea 100644 --- a/tests/SixLabors.Fonts.Tests/SixLabors.Fonts.Tests.csproj +++ b/tests/SixLabors.Fonts.Tests/SixLabors.Fonts.Tests.csproj @@ -3,7 +3,6 @@ True AnyCPU;x64;x86 - 10 diff --git a/tests/SixLabors.Fonts.Tests/SystemFontCollectionTests.cs b/tests/SixLabors.Fonts.Tests/SystemFontCollectionTests.cs index bc9a3fb79..35d938946 100644 --- a/tests/SixLabors.Fonts.Tests/SystemFontCollectionTests.cs +++ b/tests/SixLabors.Fonts.Tests/SystemFontCollectionTests.cs @@ -99,7 +99,7 @@ public void CanEnumerateNonGenericSystemFontMetrics() [Fact] public void CanGetAllMetricsByCulture() { - var collection = (IReadOnlyFontMetricsCollection)SysFontCollection; + IReadOnlyFontMetricsCollection collection = (IReadOnlyFontMetricsCollection)SysFontCollection; FontFamily family = SysFontCollection.Families.First(); IEnumerable metrics = collection.GetAllMetrics(family.Name, family.Culture); diff --git a/tests/SixLabors.Fonts.Tests/Tables/AdvancedTypographic/GPos/GPosTableTests.cs b/tests/SixLabors.Fonts.Tests/Tables/AdvancedTypographic/GPos/GPosTableTests.cs index 3c20a2318..c21b4a76c 100644 --- a/tests/SixLabors.Fonts.Tests/Tables/AdvancedTypographic/GPos/GPosTableTests.cs +++ b/tests/SixLabors.Fonts.Tests/Tables/AdvancedTypographic/GPos/GPosTableTests.cs @@ -16,14 +16,14 @@ public void SingleAdjustmentPositioning_Format1_Works() string fontFile = TestFonts.GposLookupType1Format1; ushort upem = ReadFontUpem(fontFile); Font font = new FontCollection().Add(fontFile).CreateFont(upem); - var renderer = new ColorGlyphRenderer(); + ColorGlyphRenderer renderer = new(); string testStr = "\u0012\u0014"; // XPlacement should be adjusted by minus 200 for both glyphs. - int[] expectedGlyphIndices = { 20, 22 }; + int[] expectedGlyphIndices = [20, 22]; FontRectangle[] expectedFontRectangles = - { + [ new(275, 1085.9999F, 825, 719), - new(1622, 1084.9999F, 978, 704), - }; + new(1622, 1084.9999F, 978, 704) + ]; // act TextRenderer.RenderTextTo(renderer, testStr, new TextOptions(font)); @@ -51,14 +51,14 @@ public void SingleAdjustmentPositioning_Format2_Works() string fontFile = TestFonts.GposLookupType1Format2; ushort upem = ReadFontUpem(fontFile); Font font = new FontCollection().Add(fontFile).CreateFont(upem); - var renderer = new ColorGlyphRenderer(); + ColorGlyphRenderer renderer = new(); string testStr = "\u0015\u0014"; // second character XPlacement should be adjusted by minus 200 - int[] expectedGlyphIndices = { 23, 22 }; + int[] expectedGlyphIndices = [23, 22]; FontRectangle[] expectedFontRectangles = - { + [ new(322, 1085.9999F, 978, 708), - new(1522, 1084.9999F, 978, 704), - }; + new(1522, 1084.9999F, 978, 704) + ]; // act TextRenderer.RenderTextTo(renderer, testStr, new TextOptions(font)); @@ -86,15 +86,15 @@ public void PairAdjustmentPositioning_Format1_Works() string fontFile = TestFonts.GposLookupType2Format1; ushort upem = ReadFontUpem(fontFile); Font font = new FontCollection().Add(fontFile).CreateFont(upem); - var renderer = new ColorGlyphRenderer(); + ColorGlyphRenderer renderer = new(); string testStr = "\u0017\u0012\u0014"; // "\u0012\u0014" first XPlacement minus 300 and second YPlacement minus 400. - int[] expectedGlyphIndices = { 25, 20, 22 }; + int[] expectedGlyphIndices = [25, 20, 22]; FontRectangle[] expectedFontRectangles = - { + [ new(322, 1104.9999F, 978, 671), new(1675, 1085.9999F, 825, 719), - new(3322, 1484.9999F, 978, 704), - }; + new(3322, 1484.9999F, 978, 704) + ]; // act TextRenderer.RenderTextTo(renderer, testStr, new TextOptions(font)); @@ -122,14 +122,14 @@ public void CursiveAttachmentPositioning_Format1_Works() string fontFile = TestFonts.GposLookupType3Format1; ushort upem = ReadFontUpem(fontFile); Font font = new FontCollection().Add(fontFile).CreateFont(upem); - var renderer = new ColorGlyphRenderer(); + ColorGlyphRenderer renderer = new(); string testStr = "\u0012\u0012"; // "\u0012\u0012" characters should overlap. - int[] expectedGlyphIndices = { 20, 20 }; + int[] expectedGlyphIndices = [20, 20]; FontRectangle[] expectedFontRectangles = - { + [ new(475, 1185.9999F, 825, 719), - new(575, 1085.9999F, 825, 719), - }; + new(575, 1085.9999F, 825, 719) + ]; // act TextRenderer.RenderTextTo(renderer, testStr, new TextOptions(font)); @@ -157,14 +157,14 @@ public void MarkToBaseAttachmentPositioning_Format1_Works() string fontFile = TestFonts.GposLookupType4Format1; ushort upem = ReadFontUpem(fontFile); Font font = new FontCollection().Add(fontFile).CreateFont(upem); - var renderer = new ColorGlyphRenderer(); + ColorGlyphRenderer renderer = new(); string testStr = "\u0012\u0013"; // "\u0012\u0013" characters should overlap. - int[] expectedGlyphIndices = { 20, 21 }; + int[] expectedGlyphIndices = [20, 21]; FontRectangle[] expectedFontRectangles = - { + [ new(475, 1085.9999F, 825, 719), - new(375, 1164.9999F, 825, 709), - }; + new(375, 1164.9999F, 825, 709) + ]; // act TextRenderer.RenderTextTo(renderer, testStr, new TextOptions(font)); @@ -192,14 +192,14 @@ public void MarkToLigatureAttachmentPositioning_Format1_Works() string fontFile = TestFonts.GposLookupType5Format1; ushort upem = ReadFontUpem(fontFile); Font font = new FontCollection().Add(fontFile).CreateFont(upem); - var renderer = new ColorGlyphRenderer(); + ColorGlyphRenderer renderer = new(); string testStr = "\u0012\u0013"; // "\u0012\u0013" characters should overlap. - int[] expectedGlyphIndices = { 20, 21 }; + int[] expectedGlyphIndices = [20, 21]; FontRectangle[] expectedFontRectangles = - { + [ new(475, 1085.9999F, 825, 719), - new(375, 1164.9999F, 825, 709), - }; + new(375, 1164.9999F, 825, 709) + ]; // act TextRenderer.RenderTextTo(renderer, testStr, new TextOptions(font)); @@ -227,14 +227,14 @@ public void MarkToMarkAttachmentPositioning_Format1_Works() string fontFile = TestFonts.GposLookupType6Format1; ushort upem = ReadFontUpem(fontFile); Font font = new FontCollection().Add(fontFile).CreateFont(upem); - var renderer = new ColorGlyphRenderer(); + ColorGlyphRenderer renderer = new(); string testStr = "\u0012\u0013"; // "\u0012\u0013" characters should overlap. - int[] expectedGlyphIndices = { 20, 21 }; + int[] expectedGlyphIndices = [20, 21]; FontRectangle[] expectedFontRectangles = - { + [ new(475, 1085.9999F, 825, 719), - new(375, 1164.9999F, 825, 709), - }; + new(375, 1164.9999F, 825, 709) + ]; // act TextRenderer.RenderTextTo(renderer, testStr, new TextOptions(font)); @@ -262,15 +262,15 @@ public void ContextualPositioning_Format1_Works() string fontFile = TestFonts.GposLookupType7Format1; ushort upem = ReadFontUpem(fontFile); Font font = new FontCollection().Add(fontFile).CreateFont(upem); - var renderer = new ColorGlyphRenderer(); + ColorGlyphRenderer renderer = new(); string testStr = "\u0014\u0015\u0016"; // "\u0014\u0015\u0016" XPlacement plus 20. - int[] expectedGlyphIndices = { 22, 23, 24 }; + int[] expectedGlyphIndices = [22, 23, 24]; FontRectangle[] expectedFontRectangles = - { + [ new(342, 1084.9999F, 978, 704), new(1842, 1085.9999F, 978, 708), - new(3342, 1108.9999F, 978, 667), - }; + new(3342, 1108.9999F, 978, 667) + ]; // act TextRenderer.RenderTextTo(renderer, testStr, new TextOptions(font)); @@ -298,15 +298,15 @@ public void ContextualPositioning_Format2_Works() string fontFile = TestFonts.GposLookupType7Format2; ushort upem = ReadFontUpem(fontFile); Font font = new FontCollection().Add(fontFile).CreateFont(upem); - var renderer = new ColorGlyphRenderer(); + ColorGlyphRenderer renderer = new(); string testStr = "\u0014\u0015\u0016"; // "\u0014\u0015\u0016" XPlacement plus 20. - int[] expectedGlyphIndices = { 22, 23, 24 }; + int[] expectedGlyphIndices = [22, 23, 24]; FontRectangle[] expectedFontRectangles = - { + [ new(342, 1084.9999F, 978, 704), new(1842, 1085.9999F, 978, 708), - new(3342, 1108.9999F, 978, 667), - }; + new(3342, 1108.9999F, 978, 667) + ]; // act TextRenderer.RenderTextTo(renderer, testStr, new TextOptions(font)); @@ -334,16 +334,16 @@ public void ContextualPositioning_Format3_Works() string fontFile = TestFonts.GposLookupType7Format3; ushort upem = ReadFontUpem(fontFile); Font font = new FontCollection().Add(fontFile).CreateFont(upem); - var renderer = new ColorGlyphRenderer(); + ColorGlyphRenderer renderer = new(); string testStr = "\u0014\u0015\u0016"; // "\u0014\u0015\u0016" XPlacement plus 20. - int[] expectedGlyphIndices = { 22, 23, 24 }; + int[] expectedGlyphIndices = [22, 23, 24]; FontRectangle[] expectedFontRectangles = - { + [ new(342, 1084.9999F, 978, 704), new(1842, 1085.9999F, 978, 708), - new(3342, 1108.9999F, 978, 667), - }; + new(3342, 1108.9999F, 978, 667) + ]; // act TextRenderer.RenderTextTo(renderer, testStr, new TextOptions(font)); @@ -371,18 +371,18 @@ public void ChainedContextsPositioning_Format1_Works() string fontFile = TestFonts.GposLookupType8Format1; ushort upem = ReadFontUpem(fontFile); Font font = new FontCollection().Add(fontFile).CreateFont(upem); - var renderer = new ColorGlyphRenderer(); + ColorGlyphRenderer renderer = new(); // "\u0014\u0015\u0016\u0017" backtrack:\u0014, input:\u0015\u0016, lookahead:u0017 -> XPlacement plus 200. string testStr = "\u0014\u0015\u0016\u0017"; - int[] expectedGlyphIndices = { 22, 23, 24, 25 }; + int[] expectedGlyphIndices = [22, 23, 24, 25]; FontRectangle[] expectedFontRectangles = - { + [ new(322, 1084.9999F, 978, 704), new(2022, 1085.9999F, 978, 708), new(3522, 1108.9999F, 978, 667), - new(4822, 1104.9999F, 978, 671), - }; + new(4822, 1104.9999F, 978, 671) + ]; // act TextRenderer.RenderTextTo(renderer, testStr, new TextOptions(font)); @@ -410,18 +410,18 @@ public void ChainedContextsPositioning_Format2_Works() string fontFile = TestFonts.GposLookupType8Format2; ushort upem = ReadFontUpem(fontFile); Font font = new FontCollection().Add(fontFile).CreateFont(upem); - var renderer = new ColorGlyphRenderer(); + ColorGlyphRenderer renderer = new(); // "\u0014\u0015\u0016\u0017" backtrack:\u0014, input:\u0015\u0016, lookahead:u0017 -> XPlacement plus 200. string testStr = "\u0014\u0015\u0016\u0017"; - int[] expectedGlyphIndices = { 22, 23, 24, 25 }; + int[] expectedGlyphIndices = [22, 23, 24, 25]; FontRectangle[] expectedFontRectangles = - { + [ new(322, 1084.9999F, 978, 704), new(2022, 1085.9999F, 978, 708), new(3522, 1108.9999F, 978, 667), - new(4822, 1104.9999F, 978, 671), - }; + new(4822, 1104.9999F, 978, 671) + ]; // act TextRenderer.RenderTextTo(renderer, testStr, new TextOptions(font)); @@ -449,18 +449,18 @@ public void ChainedContextsPositioning_Format3_Works() string fontFile = TestFonts.GposLookupType8Format3; ushort upem = ReadFontUpem(fontFile); Font font = new FontCollection().Add(fontFile).CreateFont(upem); - var renderer = new ColorGlyphRenderer(); + ColorGlyphRenderer renderer = new(); // "\u0014\u0015\u0016\u0017" backtrack:\u0014, input:\u0015\u0016, lookahead:u0017 -> XPlacement plus 200. string testStr = "\u0014\u0015\u0016\u0017"; - int[] expectedGlyphIndices = { 22, 23, 24, 25 }; + int[] expectedGlyphIndices = [22, 23, 24, 25]; FontRectangle[] expectedFontRectangles = - { + [ new(322, 1084.9999F, 978, 704), new(2022, 1085.9999F, 978, 708), new(3522, 1108.9999F, 978, 667), - new(4822, 1104.9999F, 978, 671), - }; + new(4822, 1104.9999F, 978, 671) + ]; // act TextRenderer.RenderTextTo(renderer, testStr, new TextOptions(font)); @@ -486,15 +486,15 @@ public void MarkAnchoring_Works() string fontFile = TestFonts.TimesNewRomanFile; ushort upem = ReadFontUpem(fontFile); Font font = new FontCollection().Add(fontFile).CreateFont(upem); - var renderer = new ColorGlyphRenderer(); + ColorGlyphRenderer renderer = new(); string testStr = "\u0644\u0651"; // /lam-arab/arabicshaddacomb - int[] expectedGlyphIndices = { 759, 989 }; + int[] expectedGlyphIndices = [759, 989]; FontRectangle[] expectedFontRectangles = - { + [ new(246, 23.5F, 363, 322), - new(71, 84.5F, 966, 1573), - }; + new(71, 84.5F, 966, 1573) + ]; // act TextRenderer.RenderTextTo(renderer, testStr, new TextOptions(font)); @@ -521,16 +521,16 @@ public void MarkToMarkAttachment_Works() string fontFile = TestFonts.MeQuranFile; ushort upem = ReadFontUpem(fontFile); Font font = new FontCollection().Add(fontFile).CreateFont(upem); - var renderer = new ColorGlyphRenderer(); + ColorGlyphRenderer renderer = new(); string testStr = "\u0631\u0651\u064E"; - int[] expectedGlyphIndices = { 47, 50, 23 }; + int[] expectedGlyphIndices = [47, 50, 23]; FontRectangle[] expectedFontRectangles = - { + [ new(345, 182, 561, 461), new(420, 621, 447, 414), - new(40, 1298, 1002, 986), - }; + new(40, 1298, 1002, 986) + ]; // act TextRenderer.RenderTextTo(renderer, testStr, new TextOptions(font)); diff --git a/tests/SixLabors.Fonts.Tests/Tables/AdvancedTypographic/Gsub/GSubTableTests.Hangul.cs b/tests/SixLabors.Fonts.Tests/Tables/AdvancedTypographic/Gsub/GSubTableTests.Hangul.cs index 78fb7173d..121ca2fa8 100644 --- a/tests/SixLabors.Fonts.Tests/Tables/AdvancedTypographic/Gsub/GSubTableTests.Hangul.cs +++ b/tests/SixLabors.Fonts.Tests/Tables/AdvancedTypographic/Gsub/GSubTableTests.Hangul.cs @@ -15,7 +15,7 @@ public partial class GSubTableTests private static Font CreateHangulFont() { - var collection = new FontCollection(); + FontCollection collection = new(); FontFamily family = collection.Add(TestFonts.NotoSansKRRegular); return family.CreateFont(12); } @@ -26,7 +26,7 @@ public void ShouldUseComposedSyllablesCFF() // arrange const string input = "\uD734\uAC00\u0020\uAC00\u002D\u002D\u0020\u0028\uC624\u002D\u002D\u0029"; ColorGlyphRenderer renderer = new(); - int[] expectedGlyphIndices = { 21324, 10264, 1, 10264, 14, 14, 1, 9, 16956, 14, 14, 10 }; + int[] expectedGlyphIndices = [21324, 10264, 1, 10264, 14, 14, 1, 9, 16956, 14, 14, 10]; // act TextRenderer.RenderTextTo(renderer, input, new TextOptions(this.hangulFontCFF)); @@ -45,7 +45,7 @@ public void ShouldComposeDecomposedSyllablesCFF() // arrange const string input = "\u1112\u1172\u1100\u1161\u0020\u1100\u1161\u002D\u002D\u0020\u0028\u110B\u1169\u002D\u002D\u0029"; ColorGlyphRenderer renderer = new(); - int[] expectedGlyphIndices = { 21324, 10264, 1, 10264, 14, 14, 1, 9, 16956, 14, 14, 10 }; + int[] expectedGlyphIndices = [21324, 10264, 1, 10264, 14, 14, 1, 9, 16956, 14, 14, 10]; // act TextRenderer.RenderTextTo(renderer, input, new TextOptions(this.hangulFontCFF)); @@ -64,7 +64,7 @@ public void ShouldUseOTFeaturesForNonCombining_L_V_T_CFF() // arrange const string input = "\ua960\ud7b0\ud7cb"; ColorGlyphRenderer renderer = new(); - int[] expectedGlyphIndices = { 23511, 23860, 24202 }; + int[] expectedGlyphIndices = [23511, 23860, 24202]; // act TextRenderer.RenderTextTo(renderer, input, new TextOptions(this.hangulFontCFF)); @@ -86,7 +86,7 @@ public void ShouldDecompose_LV_T_To_L_V_T_If_LVT_IsNotSupportedCFF() // arrange const string input = "\u1100\u1161\ud7cb"; ColorGlyphRenderer renderer = new(); - int[] expectedGlyphIndices = { 23168, 23789, 24065 }; + int[] expectedGlyphIndices = [23168, 23789, 24065]; // act TextRenderer.RenderTextTo(renderer, input, new TextOptions(this.hangulFontCFF)); @@ -105,7 +105,7 @@ public void ShouldReorderToneMarksToBeginningOf_L_V_SyllablesCFF() // arrange const string input = "\ua960\ud7b0\u302f"; ColorGlyphRenderer renderer = new(); - int[] expectedGlyphIndices = { 1443, 23759, 23954 }; + int[] expectedGlyphIndices = [1443, 23759, 23954]; // act TextRenderer.RenderTextTo(renderer, input, new TextOptions(this.hangulFontCFF)); diff --git a/tests/SixLabors.Fonts.Tests/Tables/AdvancedTypographic/Gsub/GSubTableTests.cs b/tests/SixLabors.Fonts.Tests/Tables/AdvancedTypographic/Gsub/GSubTableTests.cs index 495cc21c2..cb02c41c9 100644 --- a/tests/SixLabors.Fonts.Tests/Tables/AdvancedTypographic/Gsub/GSubTableTests.cs +++ b/tests/SixLabors.Fonts.Tests/Tables/AdvancedTypographic/Gsub/GSubTableTests.cs @@ -42,7 +42,7 @@ public void RenderArabicCharacters_WithIsolatedForm_Works(string testStr, int ex { // arrange Font arabicFont = new FontCollection().Add(TestFonts.ArabicFontFile).CreateFont(8); - var renderer = new ColorGlyphRenderer(); + ColorGlyphRenderer renderer = new(); // act TextRenderer.RenderTextTo(renderer, testStr, new TextOptions(arabicFont)); @@ -59,7 +59,7 @@ public void SingleSubstitution_Works() { // arrange Font font = new FontCollection().Add(TestFonts.GSubTestFontFile1).CreateFont(12); - var renderer = new ColorGlyphRenderer(); + ColorGlyphRenderer renderer = new(); string testStr = "A"; int expectedGlyphIndex = 38; // we expect A to be mapped to B. @@ -76,9 +76,9 @@ public void ContextualFractions_WithFractionSlash_Works() { // arrange Font font = new FontCollection().Add(TestFonts.RobotoRegular).CreateFont(12); - var renderer = new ColorGlyphRenderer(); + ColorGlyphRenderer renderer = new(); string testStr = "9⁄2"; - int[] expectedGlyphIndices = { 580, 404, 453 }; + int[] expectedGlyphIndices = [580, 404, 453]; // act TextRenderer.RenderTextTo(renderer, testStr, new TextOptions(font) { FeatureTags = new Tag[] { FeatureTags.Numerators, FeatureTags.Denominators } }); @@ -96,9 +96,9 @@ public void ContextualFractions_WithSlash_Works() { // arrange Font font = new FontCollection().Add(TestFonts.RobotoRegular).CreateFont(12); - var renderer = new ColorGlyphRenderer(); + ColorGlyphRenderer renderer = new(); string testStr = "9/2"; - int[] expectedGlyphIndices = { 580, 404, 453 }; + int[] expectedGlyphIndices = [580, 404, 453]; // act TextRenderer.RenderTextTo(renderer, testStr, new TextOptions(font) { FeatureTags = new Tag[] { FeatureTags.Fractions } }); @@ -118,7 +118,7 @@ public void MultipleSubstitution_Works() { // arrange Font font = new FontCollection().Add(TestFonts.GSubTestFontFile1).CreateFont(12); - var renderer = new ColorGlyphRenderer(); + ColorGlyphRenderer renderer = new(); string testStr = "C"; int expectedGlyphIndex = 40; // we expect C to be mapped to D. @@ -137,7 +137,7 @@ public void AlternateSubstitution_Works() { // arrange Font font = new FontCollection().Add(TestFonts.GSubTestFontFile1).CreateFont(12); - var renderer = new ColorGlyphRenderer(); + ColorGlyphRenderer renderer = new(); string testStr = "E"; int expectedGlyphIndex = 42; // we expect E to be mapped to F. @@ -156,7 +156,7 @@ public void LigatureSubstitution_Works() { // arrange Font font = new FontCollection().Add(TestFonts.GSubTestFontFile1).CreateFont(12); - var renderer = new ColorGlyphRenderer(); + ColorGlyphRenderer renderer = new(); string testStr = "ffi"; int expectedGlyphIndex = 229; @@ -175,9 +175,9 @@ public void ContextualSubstitution_Format1_Works() { // arrange Font font = new FontCollection().Add(TestFonts.GSubLookupType5Format1).CreateFont(12); - var renderer = new ColorGlyphRenderer(); + ColorGlyphRenderer renderer = new(); string testStr = "\u0041\u0042"; // "6566" (\u0041\u0042) -> "6576" - int[] expectedGlyphIndices = { 3, 7 }; + int[] expectedGlyphIndices = [3, 7]; // act TextRenderer.RenderTextTo(renderer, testStr, new TextOptions(font)); @@ -197,9 +197,9 @@ public void ContextualSubstitution_Format2_Works() { // arrange Font font = new FontCollection().Add(TestFonts.GSubLookupType5Format2).CreateFont(12); - var renderer = new ColorGlyphRenderer(); + ColorGlyphRenderer renderer = new(); string testStr = "\u0041\u0042"; // "6566" (\u0041\u0042) -> "6576" - int[] expectedGlyphIndices = { 3, 7 }; + int[] expectedGlyphIndices = [3, 7]; // act TextRenderer.RenderTextTo(renderer, testStr, new TextOptions(font)); @@ -219,9 +219,9 @@ public void ContextualSubstitution_Format3_Works() { // arrange Font font = new FontCollection().Add(TestFonts.GSubLookupType5Format3).CreateFont(12); - var renderer = new ColorGlyphRenderer(); + ColorGlyphRenderer renderer = new(); string testStr = "\u0041\u0042\u0043\u0044"; // "65666768" -> "657678" - int[] expectedGlyphIndices = { 67, 78, 80 }; + int[] expectedGlyphIndices = [67, 78, 80]; // act TextRenderer.RenderTextTo(renderer, testStr, new TextOptions(font)); @@ -241,9 +241,9 @@ public void ChainedContextsSubstitution_Format1_Works() { // arrange Font font = new FontCollection().Add(TestFonts.GSubLookupType6Format1).CreateFont(12); - var renderer = new ColorGlyphRenderer(); + ColorGlyphRenderer renderer = new(); string testStr = "\u0014\u0015\u0016\u0017"; // "20212223" -> "20636423" - int[] expectedGlyphIndices = { 22, 63, 64, 25 }; + int[] expectedGlyphIndices = [22, 63, 64, 25]; // act TextRenderer.RenderTextTo(renderer, testStr, new TextOptions(font)); @@ -263,9 +263,9 @@ public void ChainedContextsSubstitution_Format2_Works() { // arrange Font font = new FontCollection().Add(TestFonts.GSubLookupType6Format2).CreateFont(12); - var renderer = new ColorGlyphRenderer(); + ColorGlyphRenderer renderer = new(); string testStr = "\u0014\u0015\u0016\u0017"; // "20212223" -> "20216423" - int[] expectedGlyphIndices = { 22, 23, 64, 25 }; + int[] expectedGlyphIndices = [22, 23, 64, 25]; // act TextRenderer.RenderTextTo(renderer, testStr, new TextOptions(font)); @@ -285,9 +285,9 @@ public void ChainedContextsSubstitution_Format3_Works() { // arrange Font font = new FontCollection().Add(TestFonts.GSubTestFontFile2).CreateFont(12); - var renderer = new ColorGlyphRenderer(); + ColorGlyphRenderer renderer = new(); string testStr = "x=y"; // This should be replaced with "x>y". - int[] expectedGlyphIndices = { 89, 31, 90 }; + int[] expectedGlyphIndices = [89, 31, 90]; // act TextRenderer.RenderTextTo(renderer, testStr, new TextOptions(font)); @@ -307,9 +307,9 @@ public void ChainedContextsSubstitution_Format3_WithCursiveScript_Works() { // arrange Font font = new FontCollection().Add(TestFonts.FormalScript).CreateFont(12); - var renderer = new ColorGlyphRenderer(); + ColorGlyphRenderer renderer = new(); string testStr = "ba"; // Characters following b should have a special form and should be replaced. - int[] expectedGlyphIndices = { 69, 102 }; + int[] expectedGlyphIndices = [69, 102]; // act TextRenderer.RenderTextTo(renderer, testStr, new TextOptions(font)); @@ -329,9 +329,9 @@ public void ReverseChainingContextualSingleSubstitution_Works() { // arrange Font font = new FontCollection().Add(TestFonts.GSubTestFontFile2).CreateFont(12); - var renderer = new ColorGlyphRenderer(); + ColorGlyphRenderer renderer = new(); string testStr = "X89"; // X89 -> XYZ - int[] expectedGlyphIndices = { 57, 58, 59 }; + int[] expectedGlyphIndices = [57, 58, 59]; // act TextRenderer.RenderTextTo(renderer, testStr, new TextOptions(font)); @@ -350,9 +350,9 @@ public void OldStyleFiguresFeature_Works() { // arrange Font font = new FontCollection().Add(TestFonts.EbGaramond).CreateFont(12); - var renderer = new ColorGlyphRenderer(); + ColorGlyphRenderer renderer = new(); string testStr = "123456"; - int[] expectedGlyphIndices = { 2242, 2243, 2244, 2245, 2246, 2247 }; + int[] expectedGlyphIndices = [2242, 2243, 2244, 2245, 2246, 2247]; // act TextRenderer.RenderTextTo(renderer, testStr, new TextOptions(font) diff --git a/tests/SixLabors.Fonts.Tests/Tables/General/CMap/Format0SubTableTests.cs b/tests/SixLabors.Fonts.Tests/Tables/General/CMap/Format0SubTableTests.cs index a96f873a7..0f17fb987 100644 --- a/tests/SixLabors.Fonts.Tests/Tables/General/CMap/Format0SubTableTests.cs +++ b/tests/SixLabors.Fonts.Tests/Tables/General/CMap/Format0SubTableTests.cs @@ -12,7 +12,7 @@ public class Format0SubTableTests [Fact] public void LoadFormat0() { - var writer = new BigEndianBinaryWriter(); + BigEndianBinaryWriter writer = new(); // int subtableCount = 1; writer.WriteCMapSubTable( @@ -20,7 +20,7 @@ public void LoadFormat0() 0, PlatformIDs.Windows, 2, - new byte[] { 1, 2, 3, 4, 5, 6, 7, 8 })); + [1, 2, 3, 4, 5, 6, 7, 8])); BigEndianBinaryReader reader = writer.GetReader(); ushort format = reader.ReadUInt16(); // read format before we pass along as that's what the cmap table does @@ -39,7 +39,7 @@ public void LoadFormat0() [Fact] public void GetCharacter() { - var format = new Format0SubTable(0, PlatformIDs.Windows, 2, new byte[] { 1, 2, 3, 4, 5, 6, 7, 8 }); + Format0SubTable format = new(0, PlatformIDs.Windows, 2, [1, 2, 3, 4, 5, 6, 7, 8]); bool found = format.TryGetGlyphId(new CodePoint(4), out ushort id); @@ -50,7 +50,7 @@ public void GetCharacter() [Fact] public void GetCharacter_missing() { - var format = new Format0SubTable(0, PlatformIDs.Windows, 2, new byte[] { 1, 2, 3, 4, 5, 6, 7, 8 }); + Format0SubTable format = new(0, PlatformIDs.Windows, 2, [1, 2, 3, 4, 5, 6, 7, 8]); bool found = format.TryGetGlyphId(new CodePoint(99), out ushort id); diff --git a/tests/SixLabors.Fonts.Tests/Tables/General/CMap/Format4SubTableTests.cs b/tests/SixLabors.Fonts.Tests/Tables/General/CMap/Format4SubTableTests.cs index 1cdcb16c1..cc21b6003 100644 --- a/tests/SixLabors.Fonts.Tests/Tables/General/CMap/Format4SubTableTests.cs +++ b/tests/SixLabors.Fonts.Tests/Tables/General/CMap/Format4SubTableTests.cs @@ -12,7 +12,7 @@ public class Format4SubTableTests [Fact] public void LoadFormat4() { - var writer = new BigEndianBinaryWriter(); + BigEndianBinaryWriter writer = new(); // int subtableCount = 1; writer.WriteCMapSubTable( @@ -20,8 +20,8 @@ public void LoadFormat4() 0, PlatformIDs.Windows, 2, - new[] { new Format4SubTable.Segment(0, 1, 2, 3, 4) }, - new ushort[] { 1, 2, 3, 4, 5, 6, 7, 8 })); + [new Format4SubTable.Segment(0, 1, 2, 3, 4)], + [1, 2, 3, 4, 5, 6, 7, 8])); BigEndianBinaryReader reader = writer.GetReader(); ushort format = reader.ReadUInt16(); // read format before we pass along as that's what the cmap table does @@ -64,14 +64,14 @@ public void GetCharacter(int src, int expected, bool expectedFound) // idRangeOffset: 0 0 0 0 ushort[] glyphs = Enumerable.Range(0, expected).Select(x => (ushort)x).ToArray(); - Format4SubTable.Segment[] segments = new[] - { - new Format4SubTable.Segment(0, 20, 10, -9, 0), - new Format4SubTable.Segment(1, 90, 30, -18, 0), - new Format4SubTable.Segment(2, 480, 153, -27, 0), - }; + Format4SubTable.Segment[] segments = + [ + new(0, 20, 10, -9, 0), + new(1, 90, 30, -18, 0), + new(2, 480, 153, -27, 0) + ]; - var table = new Format4SubTable( + Format4SubTable table = new( 0, PlatformIDs.Windows, 0, diff --git a/tests/SixLabors.Fonts.Tests/Tables/General/CMapTableTests.cs b/tests/SixLabors.Fonts.Tests/Tables/General/CMapTableTests.cs index b7e351d6e..aada0d0ee 100644 --- a/tests/SixLabors.Fonts.Tests/Tables/General/CMapTableTests.cs +++ b/tests/SixLabors.Fonts.Tests/Tables/General/CMapTableTests.cs @@ -12,14 +12,14 @@ public class CMapTableTests [Fact] public void LoadFormat0() { - var writer = new BigEndianBinaryWriter(); + BigEndianBinaryWriter writer = new(); writer.WriteCMapTable(new[] { - new Format0SubTable(0, PlatformIDs.Windows, 9, new byte[] { 0, 1, 2 }) + new Format0SubTable(0, PlatformIDs.Windows, 9, [0, 1, 2]) }); - var table = CMapTable.Load(writer.GetReader()); + CMapTable table = CMapTable.Load(writer.GetReader()); Assert.Single(table.Tables.Where(x => x != null)); @@ -30,14 +30,14 @@ public void LoadFormat0() [Fact] public void ShouldThrowExceptionWhenTableCouldNotBeFound() { - var writer = new BigEndianBinaryWriter(); + BigEndianBinaryWriter writer = new(); writer.WriteTrueTypeFileHeader(); using (System.IO.MemoryStream stream = writer.GetStream()) { InvalidFontTableException exception = Assert.Throws(() => { - using var reader = new FontReader(stream); + using FontReader reader = new(stream); CMapTable.Load(reader); }); diff --git a/tests/SixLabors.Fonts.Tests/Tables/General/ColrTableTests.cs b/tests/SixLabors.Fonts.Tests/Tables/General/ColrTableTests.cs index 7f60b602a..809b5096f 100644 --- a/tests/SixLabors.Fonts.Tests/Tables/General/ColrTableTests.cs +++ b/tests/SixLabors.Fonts.Tests/Tables/General/ColrTableTests.cs @@ -11,12 +11,12 @@ public class ColrTableTests [Fact] public void ShouldReturnNullWhenTableCouldNotBeFound() { - var writer = new BigEndianBinaryWriter(); + BigEndianBinaryWriter writer = new(); writer.WriteTrueTypeFileHeader(); using (MemoryStream stream = writer.GetStream()) { - using var reader = new FontReader(stream); + using FontReader reader = new(stream); Assert.Null(ColrTable.Load(reader)); } } @@ -24,10 +24,9 @@ public void ShouldReturnNullWhenTableCouldNotBeFound() [Fact] public void ShouldReturnTableValues() { - var writer = new BigEndianBinaryWriter(); + BigEndianBinaryWriter writer = new(); writer.WriteTrueTypeFileHeader(); - writer.WriteColrTable(new[] - { + writer.WriteColrTable([ new ColrGlyphRecord { Glyph = 1, @@ -46,11 +45,11 @@ public void ShouldReturnTableValues() new ColrLayerRecord { Glyph = 13, Palette = 2 } } } - }); + ]); using (Stream stream = TestFonts.TwemojiMozillaData()) { - using var reader = new FontReader(stream); + using FontReader reader = new(stream); ColrTable tbl = reader.GetTable(); Span layers = tbl.GetLayers(15); diff --git a/tests/SixLabors.Fonts.Tests/Tables/General/Glyphs/CompositeGlyphLoaderTests.cs b/tests/SixLabors.Fonts.Tests/Tables/General/Glyphs/CompositeGlyphLoaderTests.cs index 087951bbd..625e47502 100644 --- a/tests/SixLabors.Fonts.Tests/Tables/General/Glyphs/CompositeGlyphLoaderTests.cs +++ b/tests/SixLabors.Fonts.Tests/Tables/General/Glyphs/CompositeGlyphLoaderTests.cs @@ -11,7 +11,7 @@ public class CompositeGlyphLoaderTests [Fact] public void LoadSingleGlyphWithUInt16Offset_unsigned_short() { - var writer = new BigEndianBinaryWriter(); + BigEndianBinaryWriter writer = new(); writer.WriteUInt16((ushort)CompositeGlyphFlags.Args1And2AreWords); // 16bit unsigned writer.WriteUInt16(1); // glyph id @@ -19,14 +19,13 @@ public void LoadSingleGlyphWithUInt16Offset_unsigned_short() writer.WriteUInt16(short.MaxValue + 2); // dy writer.GetReader(); - var bounds = new Bounds(0, 0, 100, 100); - var glyph = CompositeGlyphLoader.LoadCompositeGlyph(writer.GetReader(), in bounds); + Bounds bounds = new(0, 0, 100, 100); + CompositeGlyphLoader glyph = CompositeGlyphLoader.LoadCompositeGlyph(writer.GetReader(), in bounds); - var tbl = new GlyphTable(new[] - { + GlyphTable tbl = new([ new SimpleGlyphLoader(bounds), // padding - new SimpleGlyphLoader(new ControlPoint[] { new(new Vector2(20, 21), true) }, new ushort[] { 1 }, bounds, Array.Empty()) - }); + new SimpleGlyphLoader([new ControlPoint(new Vector2(20, 21), true)], [1], bounds, []) + ]); GlyphVector finalGlyph = glyph.CreateGlyph(tbl); @@ -37,7 +36,7 @@ public void LoadSingleGlyphWithUInt16Offset_unsigned_short() [Fact] public void LoadSingleGlyphWithInt16Offset_signed_short() { - var writer = new BigEndianBinaryWriter(); + BigEndianBinaryWriter writer = new(); writer.WriteUInt16((ushort)(CompositeGlyphFlags.Args1And2AreWords /* 16bit */ | CompositeGlyphFlags.ArgsAreXYValues /* signed */)); // flags writer.WriteUInt16(1); // glyph id @@ -45,14 +44,13 @@ public void LoadSingleGlyphWithInt16Offset_signed_short() writer.WriteInt16(short.MinValue + 2); // dy writer.GetReader(); - var bounds = new Bounds(0, 0, 100, 100); - var glyph = CompositeGlyphLoader.LoadCompositeGlyph(writer.GetReader(), in bounds); + Bounds bounds = new(0, 0, 100, 100); + CompositeGlyphLoader glyph = CompositeGlyphLoader.LoadCompositeGlyph(writer.GetReader(), in bounds); - var tbl = new GlyphTable(new[] - { + GlyphTable tbl = new([ new SimpleGlyphLoader(bounds), // padding - new SimpleGlyphLoader(new ControlPoint[] { new(new Vector2(20, 21), true) }, new ushort[] { 1 }, bounds, Array.Empty()) - }); + new SimpleGlyphLoader([new ControlPoint(new Vector2(20, 21), true)], [1], bounds, []) + ]); GlyphVector finalGlyph = glyph.CreateGlyph(tbl); @@ -63,7 +61,7 @@ public void LoadSingleGlyphWithInt16Offset_signed_short() [Fact] public void LoadSingleGlyphWithUInt8Offset_unsigned_byte() { - var writer = new BigEndianBinaryWriter(); + BigEndianBinaryWriter writer = new(); writer.WriteUInt16(0); // 8bit unsigned writer.WriteUInt16(1); // glyph id @@ -71,14 +69,13 @@ public void LoadSingleGlyphWithUInt8Offset_unsigned_byte() writer.WriteUInt8(sbyte.MaxValue + 2); // dy writer.GetReader(); - var bounds = new Bounds(0, 0, 100, 100); - var glyph = CompositeGlyphLoader.LoadCompositeGlyph(writer.GetReader(), in bounds); + Bounds bounds = new(0, 0, 100, 100); + CompositeGlyphLoader glyph = CompositeGlyphLoader.LoadCompositeGlyph(writer.GetReader(), in bounds); - var tbl = new GlyphTable(new[] - { + GlyphTable tbl = new([ new SimpleGlyphLoader(bounds), // padding - new SimpleGlyphLoader(new ControlPoint[] { new(new Vector2(20, 21), true) }, new ushort[] { 1 }, bounds, Array.Empty()) - }); + new SimpleGlyphLoader([new ControlPoint(new Vector2(20, 21), true)], [1], bounds, []) + ]); GlyphVector finalGlyph = glyph.CreateGlyph(tbl); @@ -89,7 +86,7 @@ public void LoadSingleGlyphWithUInt8Offset_unsigned_byte() [Fact] public void LoadSingleGlyphWithInt8Offset_signed_byte() { - var writer = new BigEndianBinaryWriter(); + BigEndianBinaryWriter writer = new(); writer.WriteUInt16((ushort)CompositeGlyphFlags.ArgsAreXYValues); // signed byte writer.WriteUInt16(1); // glyph id @@ -97,14 +94,13 @@ public void LoadSingleGlyphWithInt8Offset_signed_byte() writer.WriteInt8(sbyte.MinValue + 2); // dy writer.GetReader(); - var bounds = new Bounds(0, 0, 100, 100); - var glyph = CompositeGlyphLoader.LoadCompositeGlyph(writer.GetReader(), in bounds); + Bounds bounds = new(0, 0, 100, 100); + CompositeGlyphLoader glyph = CompositeGlyphLoader.LoadCompositeGlyph(writer.GetReader(), in bounds); - var tbl = new GlyphTable(new[] - { + GlyphTable tbl = new([ new SimpleGlyphLoader(bounds), // padding - new SimpleGlyphLoader(new ControlPoint[] { new(new Vector2(20, 21), true) }, new ushort[] { 1 }, bounds, Array.Empty()) - }); + new SimpleGlyphLoader([new ControlPoint(new Vector2(20, 21), true)], [1], bounds, []) + ]); GlyphVector finalGlyph = glyph.CreateGlyph(tbl); diff --git a/tests/SixLabors.Fonts.Tests/Tables/General/Glyphs/GlyphVectorTests.cs b/tests/SixLabors.Fonts.Tests/Tables/General/Glyphs/GlyphVectorTests.cs index 15ecd0085..a8e97dd46 100644 --- a/tests/SixLabors.Fonts.Tests/Tables/General/Glyphs/GlyphVectorTests.cs +++ b/tests/SixLabors.Fonts.Tests/Tables/General/Glyphs/GlyphVectorTests.cs @@ -12,13 +12,13 @@ public class GlyphVectorTests public void CloneIsDeep() { // arrange - ControlPoint[] controlPoints = { new(new Vector2(1.0f), true), new(new Vector2(2.0f), false) }; - ushort[] endPoints = { 1, 2, 3 }; - var bounds = new Bounds(1.0f, 2.0f, 3.0f, 4.0f); - var outline = new GlyphVector(controlPoints, endPoints, bounds, Array.Empty(), false); + ControlPoint[] controlPoints = [new(new Vector2(1.0f), true), new(new Vector2(2.0f), false)]; + ushort[] endPoints = [1, 2, 3]; + Bounds bounds = new(1.0f, 2.0f, 3.0f, 4.0f); + GlyphVector outline = new(controlPoints, endPoints, bounds, Array.Empty(), false); // act - var clone = GlyphVector.DeepClone(outline); + GlyphVector clone = GlyphVector.DeepClone(outline); // assert Assert.False(outline.ControlPoints.Equals(clone.ControlPoints)); @@ -31,11 +31,11 @@ public void CloneIsDeep() public void TtfOffsetXy_Works() { // arrange - ControlPoint[] controlPoints = { new(new Vector2(1.0f), true), new(new Vector2(2.0f), false) }; - ushort[] endPoints = { 1, 2, 3 }; - var bounds = new Bounds(1.0f, 2.0f, 3.0f, 4.0f); - var expectedBounds = new Bounds(11.0f, 12.0f, 13.0f, 14.0f); - var glyphVector = new GlyphVector(controlPoints, endPoints, bounds, Array.Empty(), false); + ControlPoint[] controlPoints = [new(new Vector2(1.0f), true), new(new Vector2(2.0f), false)]; + ushort[] endPoints = [1, 2, 3]; + Bounds bounds = new(1.0f, 2.0f, 3.0f, 4.0f); + Bounds expectedBounds = new(11.0f, 12.0f, 13.0f, 14.0f); + GlyphVector glyphVector = new(controlPoints, endPoints, bounds, Array.Empty(), false); // act Matrix3x2 matrix = Matrix3x2.Identity; @@ -52,7 +52,7 @@ public void TtfTransformWith2x2Matrix_Works() // arrange const float precision = 2F; ControlPoint[] controlPoints = - { + [ new(new Vector2(653.0f, 791.0f), true), new(new Vector2(1065.0f, 791.0f), false), new(new Vector2(1065.0f, 653.0f), true), @@ -68,13 +68,13 @@ public void TtfTransformWith2x2Matrix_Works() new(new Vector2(104.0f, 1.0f), true), new(new Vector2(104.0f, 139.0f), false), new(new Vector2(1065.0f, 139.0f), true), - new(new Vector2(1065.0f, 1.0f), false), - }; + new(new Vector2(1065.0f, 1.0f), false) + ]; - ushort[] endPoints = { 1, 2, 3 }; - var bounds = new Bounds(16130.0f, 260.0f, 26624.0f, 28928.0f); - var expectedBounds = new Bounds(19876f, 013684f, 89804.8f, 108083.2f); - var glyphVector = new GlyphVector(controlPoints, endPoints, bounds, Array.Empty(), false); + ushort[] endPoints = [1, 2, 3]; + Bounds bounds = new(16130.0f, 260.0f, 26624.0f, 28928.0f); + Bounds expectedBounds = new(19876f, 013684f, 89804.8f, 108083.2f); + GlyphVector glyphVector = new(controlPoints, endPoints, bounds, Array.Empty(), false); // act Matrix3x2 matrix = Matrix3x2.Identity; diff --git a/tests/SixLabors.Fonts.Tests/Tables/General/HeadTableTests.cs b/tests/SixLabors.Fonts.Tests/Tables/General/HeadTableTests.cs index a6027be1a..c93b3b5c0 100644 --- a/tests/SixLabors.Fonts.Tests/Tables/General/HeadTableTests.cs +++ b/tests/SixLabors.Fonts.Tests/Tables/General/HeadTableTests.cs @@ -10,7 +10,7 @@ public class HeadTableTests [Fact] public void LoadHead() { - var writer = new BigEndianBinaryWriter(); + BigEndianBinaryWriter writer = new(); writer.WriteHeadTable(new HeadTable( HeadTable.HeadFlags.None, @@ -22,7 +22,7 @@ public void LoadHead() 0, HeadTable.IndexLocationFormats.Offset16)); - var head = HeadTable.Load(writer.GetReader()); + HeadTable head = HeadTable.Load(writer.GetReader()); Assert.Equal(HeadTable.HeadFlags.None, head.Flags); Assert.Equal(HeadTable.HeadMacStyle.Italic | HeadTable.HeadMacStyle.Bold, head.MacStyle); diff --git a/tests/SixLabors.Fonts.Tests/Tables/General/HorizontalHeadTableTests.cs b/tests/SixLabors.Fonts.Tests/Tables/General/HorizontalHeadTableTests.cs index 95d55403a..0458447e3 100644 --- a/tests/SixLabors.Fonts.Tests/Tables/General/HorizontalHeadTableTests.cs +++ b/tests/SixLabors.Fonts.Tests/Tables/General/HorizontalHeadTableTests.cs @@ -10,11 +10,11 @@ public class HorizontalHeadTableTests [Fact] public void LoadHorizontalHeadTable() { - var writer = new BigEndianBinaryWriter(); + BigEndianBinaryWriter writer = new(); writer.WriteHorizontalHeadTable(new HorizontalHeadTable(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)); - var tbl = HorizontalHeadTable.Load(writer.GetReader()); + HorizontalHeadTable tbl = HorizontalHeadTable.Load(writer.GetReader()); Assert.Equal(1, tbl.Ascender); Assert.Equal(2, tbl.Descender); @@ -32,12 +32,12 @@ public void LoadHorizontalHeadTable() [Fact] public void ShouldReturnNullWhenTableCouldNotBeFound() { - var writer = new BigEndianBinaryWriter(); + BigEndianBinaryWriter writer = new(); writer.WriteTrueTypeFileHeader(); using (MemoryStream stream = writer.GetStream()) { - using var reader = new FontReader(stream); + using FontReader reader = new(stream); Assert.Null(HorizontalHeadTable.Load(reader)); } } diff --git a/tests/SixLabors.Fonts.Tests/Tables/General/IndexLocationTableTests.cs b/tests/SixLabors.Fonts.Tests/Tables/General/IndexLocationTableTests.cs index 1052cc059..33d21535b 100644 --- a/tests/SixLabors.Fonts.Tests/Tables/General/IndexLocationTableTests.cs +++ b/tests/SixLabors.Fonts.Tests/Tables/General/IndexLocationTableTests.cs @@ -12,14 +12,14 @@ public class IndexLocationTableTests [Fact] public void ShouldThrowExceptionWhenHeadTableCouldNotBeFound() { - var writer = new BigEndianBinaryWriter(); + BigEndianBinaryWriter writer = new(); writer.WriteTrueTypeFileHeader(); using (MemoryStream stream = writer.GetStream()) { MissingFontTableException exception = Assert.Throws(() => { - using var reader = new FontReader(stream); + using FontReader reader = new(stream); IndexLocationTable.Load(reader); }); @@ -30,7 +30,7 @@ public void ShouldThrowExceptionWhenHeadTableCouldNotBeFound() [Fact] public void ShouldThrowExceptionWhenMaximumProfileTableCouldNotBeFound() { - var writer = new BigEndianBinaryWriter(); + BigEndianBinaryWriter writer = new(); writer.WriteTrueTypeFileHeader(new TableHeader("head", 0, 0, 0)); writer.WriteHeadTable(new HeadTable( @@ -47,7 +47,7 @@ public void ShouldThrowExceptionWhenMaximumProfileTableCouldNotBeFound() { InvalidFontTableException exception = Assert.Throws(() => { - using var reader = new FontReader(stream); + using FontReader reader = new(stream); IndexLocationTable.Load(reader); }); @@ -58,7 +58,7 @@ public void ShouldThrowExceptionWhenMaximumProfileTableCouldNotBeFound() [Fact] public void ShouldReturnNullWhenTableCouldNotBeFound() { - var writer = new BigEndianBinaryWriter(); + BigEndianBinaryWriter writer = new(); writer.WriteTrueTypeFileHeader(new TableHeader("head", 0, 0, 0), new TableHeader("maxp", 0, 0, 0)); writer.WriteHeadTable(new HeadTable( @@ -73,7 +73,7 @@ public void ShouldReturnNullWhenTableCouldNotBeFound() using (MemoryStream stream = writer.GetStream()) { - using var reader = new FontReader(stream); + using FontReader reader = new(stream); Assert.Null(IndexLocationTable.Load(reader)); } } diff --git a/tests/SixLabors.Fonts.Tests/Tables/General/KerningTableTests.cs b/tests/SixLabors.Fonts.Tests/Tables/General/KerningTableTests.cs index b0183591a..566a6ec99 100644 --- a/tests/SixLabors.Fonts.Tests/Tables/General/KerningTableTests.cs +++ b/tests/SixLabors.Fonts.Tests/Tables/General/KerningTableTests.cs @@ -10,13 +10,13 @@ public class KerningTableTests [Fact] public void ShouldReturnDefaultValueWhenTableCouldNotBeFound() { - var writer = new BigEndianBinaryWriter(); + BigEndianBinaryWriter writer = new(); writer.WriteTrueTypeFileHeader(); using (MemoryStream stream = writer.GetStream()) { - using var reader = new FontReader(stream); - var table = KerningTable.Load(reader); + using FontReader reader = new(stream); + KerningTable table = KerningTable.Load(reader); Assert.NotNull(table); } } diff --git a/tests/SixLabors.Fonts.Tests/Tables/General/MaximumProfileTableTests.cs b/tests/SixLabors.Fonts.Tests/Tables/General/MaximumProfileTableTests.cs index 54f123d68..fae3a0f45 100644 --- a/tests/SixLabors.Fonts.Tests/Tables/General/MaximumProfileTableTests.cs +++ b/tests/SixLabors.Fonts.Tests/Tables/General/MaximumProfileTableTests.cs @@ -10,14 +10,14 @@ public class MaximumProfileTableTests [Fact] public void ShouldThrowExceptionWhenTableCouldNotBeFound() { - var writer = new BigEndianBinaryWriter(); + BigEndianBinaryWriter writer = new(); writer.WriteTrueTypeFileHeader(); using (MemoryStream stream = writer.GetStream()) { InvalidFontTableException exception = Assert.Throws(() => { - using var reader = new FontReader(stream); + using FontReader reader = new(stream); MaximumProfileTable.Load(reader); }); diff --git a/tests/SixLabors.Fonts.Tests/Tables/General/NameTableTests.cs b/tests/SixLabors.Fonts.Tests/Tables/General/NameTableTests.cs index 25cec2c70..334fb2500 100644 --- a/tests/SixLabors.Fonts.Tests/Tables/General/NameTableTests.cs +++ b/tests/SixLabors.Fonts.Tests/Tables/General/NameTableTests.cs @@ -12,7 +12,7 @@ public class NameTableTests [Fact] public void LoadFormat0() { - var writer = new BigEndianBinaryWriter(); + BigEndianBinaryWriter writer = new(); writer.WriteNameTable( new Dictionary @@ -26,7 +26,7 @@ public void LoadFormat0() { (KnownNameIds)91, "other2" } }); - var table = NameTable.Load(writer.GetReader()); + NameTable table = NameTable.Load(writer.GetReader()); Assert.Equal("fullname", table.FontName(CultureInfo.InvariantCulture)); Assert.Equal("family", table.FontFamilyName(CultureInfo.InvariantCulture)); @@ -40,7 +40,7 @@ public void LoadFormat0() [Fact] public void LoadFormat1() { - var writer = new BigEndianBinaryWriter(); + BigEndianBinaryWriter writer = new(); writer.WriteNameTable( new Dictionary @@ -53,13 +53,12 @@ public void LoadFormat1() { (KnownNameIds)90, "other1" }, { (KnownNameIds)91, "other2" } }, - new List - { + [ "lang1", "lang2" - }); + ]); - var table = NameTable.Load(writer.GetReader()); + NameTable table = NameTable.Load(writer.GetReader()); Assert.Equal("fullname", table.FontName(CultureInfo.InvariantCulture)); Assert.Equal("family", table.FontFamilyName(CultureInfo.InvariantCulture)); @@ -73,14 +72,14 @@ public void LoadFormat1() [Fact] public void ShouldThrowExceptionWhenTableCouldNotBeFound() { - var writer = new BigEndianBinaryWriter(); + BigEndianBinaryWriter writer = new(); writer.WriteTrueTypeFileHeader(); using (MemoryStream stream = writer.GetStream()) { InvalidFontTableException exception = Assert.Throws(() => { - using var reader = new FontReader(stream); + using FontReader reader = new(stream); NameTable.Load(reader); }); diff --git a/tests/SixLabors.Fonts.Tests/Tables/General/Os2TableTests.cs b/tests/SixLabors.Fonts.Tests/Tables/General/Os2TableTests.cs index cfa4a2f00..137e02155 100644 --- a/tests/SixLabors.Fonts.Tests/Tables/General/Os2TableTests.cs +++ b/tests/SixLabors.Fonts.Tests/Tables/General/Os2TableTests.cs @@ -10,12 +10,12 @@ public class OS2TableTests [Fact] public void ShouldReturnNullWhenTableCouldNotBeFound() { - var writer = new BigEndianBinaryWriter(); + BigEndianBinaryWriter writer = new(); writer.WriteTrueTypeFileHeader(); using (MemoryStream stream = writer.GetStream()) { - using var reader = new FontReader(stream); + using FontReader reader = new(stream); Assert.Null(OS2Table.Load(reader)); } } diff --git a/tests/SixLabors.Fonts.Tests/Tables/General/VerticalHeadTableTests.cs b/tests/SixLabors.Fonts.Tests/Tables/General/VerticalHeadTableTests.cs index 5ea44e76a..6c2714d3f 100644 --- a/tests/SixLabors.Fonts.Tests/Tables/General/VerticalHeadTableTests.cs +++ b/tests/SixLabors.Fonts.Tests/Tables/General/VerticalHeadTableTests.cs @@ -10,11 +10,11 @@ public class VerticalHeadTableTests [Fact] public void LoadVerticalHeadTable() { - var writer = new BigEndianBinaryWriter(); + BigEndianBinaryWriter writer = new(); writer.WriteVerticalHeadTable(new VerticalHeadTable(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)); - var tbl = VerticalHeadTable.Load(writer.GetReader()); + VerticalHeadTable tbl = VerticalHeadTable.Load(writer.GetReader()); Assert.Equal(1, tbl.Ascender); Assert.Equal(2, tbl.Descender); @@ -32,11 +32,11 @@ public void LoadVerticalHeadTable() [Fact] public void ShouldReturnNullWhenTableCouldNotBeFound() { - var writer = new BigEndianBinaryWriter(); + BigEndianBinaryWriter writer = new(); writer.WriteTrueTypeFileHeader(); using MemoryStream stream = writer.GetStream(); - using var reader = new FontReader(stream); + using FontReader reader = new(stream); Assert.Null(VerticalHeadTable.Load(reader)); } } diff --git a/tests/SixLabors.Fonts.Tests/Tables/TableHeaderTests.cs b/tests/SixLabors.Fonts.Tests/Tables/TableHeaderTests.cs index 9e815ff1e..8ccf5e581 100644 --- a/tests/SixLabors.Fonts.Tests/Tables/TableHeaderTests.cs +++ b/tests/SixLabors.Fonts.Tests/Tables/TableHeaderTests.cs @@ -8,7 +8,7 @@ namespace SixLabors.Fonts.Tests.Tables; public class TableHeaderTests { public static TheoryData ReadAllValuesData { get; } = - new TheoryData + new() { { "TAG1", 98, 18, 1218 }, { "TAG2", 198, 0, 121 }, @@ -18,10 +18,10 @@ public class TableHeaderTests [MemberData(nameof(ReadAllValuesData))] public void ReadAllValues(string tag, uint checksum, uint offset, uint length) { - var writer = new BigEndianBinaryWriter(); + BigEndianBinaryWriter writer = new(); writer.WriteTableHeader(tag, checksum, offset, length); - var header = TableHeader.Read(writer.GetReader()); + TableHeader header = TableHeader.Read(writer.GetReader()); Assert.Equal(checksum, header.CheckSum); Assert.Equal(length, header.Length); diff --git a/tests/SixLabors.Fonts.Tests/Tables/TableLoaderTests.cs b/tests/SixLabors.Fonts.Tests/Tables/TableLoaderTests.cs index 5682e0b8b..3dbe0c313 100644 --- a/tests/SixLabors.Fonts.Tests/Tables/TableLoaderTests.cs +++ b/tests/SixLabors.Fonts.Tests/Tables/TableLoaderTests.cs @@ -27,7 +27,7 @@ public static IEnumerable RegisterableTableTypes [MemberData(nameof(RegisterableTableTypes))] public void AllNamedTablesAreRegistered(Type type, string name) { - var tl = new TableLoader(); + TableLoader tl = new(); Assert.Contains(type, tl.RegisteredTypes()); Assert.Equal(name, tl.GetTag(type)); } @@ -38,7 +38,7 @@ public void AllNamedTablesAreRegistered(Type type, string name) [Fact] public void TryingToLoadUnregisteredTagReturnsUnknownTable() { - var loader = new TableLoader(); + TableLoader loader = new(); string tag = Guid.NewGuid().ToString(); Table result = loader.Load(tag, null); @@ -50,7 +50,7 @@ public void TryingToLoadUnregisteredTagReturnsUnknownTable() [Fact] public void NullForUnknownTypes() { - var loader = new TableLoader(); + TableLoader loader = new(); string tag = loader.GetTag(typeof(TableLoaderTests)); Assert.Null(tag); } diff --git a/tests/SixLabors.Fonts.Tests/TestFonts.cs b/tests/SixLabors.Fonts.Tests/TestFonts.cs index 5b4cfecb2..3571d13ff 100644 --- a/tests/SixLabors.Fonts.Tests/TestFonts.cs +++ b/tests/SixLabors.Fonts.Tests/TestFonts.cs @@ -307,7 +307,7 @@ private static Stream OpenStream(string path) => private static Stream Clone(this Stream src) { - var ms = new MemoryStream(); + MemoryStream ms = new(); src.Position = 0; src.CopyTo(ms); ms.Position = 0; @@ -318,13 +318,13 @@ private static string GetFullPath(string path) { string root = Path.GetDirectoryName(new Uri(typeof(TestFonts).GetTypeInfo().Assembly.CodeBase).LocalPath); - string[] paths = new[] - { + string[] paths = + [ "Fonts", @"..\..\Fonts", @"..\..\..\..\Fonts", @"..\..\..\..\..\Fonts" - }; + ]; IEnumerable fullPaths = paths.Select(x => Path.GetFullPath(Path.Combine(root, x))); string rootPath = fullPaths.FirstOrDefault(Directory.Exists); diff --git a/tests/SixLabors.Fonts.Tests/TextLayoutTests.cs b/tests/SixLabors.Fonts.Tests/TextLayoutTests.cs index 8523bdad9..61d1ad9ff 100644 --- a/tests/SixLabors.Fonts.Tests/TextLayoutTests.cs +++ b/tests/SixLabors.Fonts.Tests/TextLayoutTests.cs @@ -202,14 +202,14 @@ public unsafe void MeasureTextWithSpan() { Font font = CreateFont("hello"); - Span text = stackalloc char[] - { + Span text = + [ 'h', 'e', 'l', 'l', 'o' - }; + ]; // 72 * emSize means 1pt = 1px FontRectangle size = TextMeasurer.MeasureBounds(text, new TextOptions(font) { Dpi = font.FontMetrics.ScaleFactor }); @@ -240,12 +240,12 @@ public void TryMeasureCharacterBounds() { const string text = "a b\nc"; GlyphBounds[] expectedGlyphMetrics = - { + [ new(new CodePoint('a'), new FontRectangle(10, 0, 10, 10), 0, 0), new(new CodePoint(' '), new FontRectangle(40, 0, 30, 10), 1, 1), new(new CodePoint('b'), new FontRectangle(70, 0, 10, 10), 2, 2), - new(new CodePoint('c'), new FontRectangle(10, 30, 10, 10), 3, 3), - }; + new(new CodePoint('c'), new FontRectangle(10, 30, 10, 10), 3, 3) + ]; Font font = CreateFont(text); Assert.True(TextMeasurer.TryMeasureCharacterBounds( @@ -465,7 +465,7 @@ public void MeasureTextWordBreak(string text, LayoutMode layoutMode, WordBreakin [InlineData("AB", 465, 654, true)] public void MeasureTextWithKerning(string text, float height, float width, bool applyKerning) { - var c = new FontCollection(); + FontCollection c = new(); Font font = c.Add(TestFonts.SimpleFontFileData()).CreateFont(12); FontRectangle size = TextMeasurer.MeasureBounds( text, @@ -483,11 +483,11 @@ public void MeasureTextWithKerning(string text, float height, float width, bool [InlineData("a", 100, 100, 125, 396)] public void LayoutWithLocation(string text, float x, float y, float expectedX, float expectedY) { - var c = new FontCollection(); + FontCollection c = new(); Font font = c.Add(TestFonts.SimpleFontFileData()).CreateFont(12); - var glyphRenderer = new GlyphRenderer(); - var renderer = new TextRenderer(glyphRenderer); + GlyphRenderer glyphRenderer = new(); + TextRenderer renderer = new(glyphRenderer); renderer.RenderText( text, new TextOptions(new Font(font, 1)) @@ -529,8 +529,8 @@ public void CountLinesWithSpan() { Font font = CreateFont("hello\n!"); - Span text = stackalloc char[] - { + Span text = + [ 'h', 'e', 'l', @@ -538,7 +538,7 @@ public void CountLinesWithSpan() 'o', '\n', '!' - }; + ]; int count = TextMeasurer.CountLines(text, new TextOptions(font) { Dpi = font.FontMetrics.ScaleFactor }); Assert.Equal(2, count); @@ -588,9 +588,9 @@ public void BuildTextRuns_ReturnsCreatesInterimRuns() { TextRuns = new List() { - new TextRun() { Start = 9, End = 23, Font = font2 }, - new TextRun() { Start = 35, End = 54, Font = font2 }, - new TextRun() { Start = 68, End = 70, Font = font2 }, + new() { Start = 9, End = 23, Font = font2 }, + new() { Start = 35, End = 54, Font = font2 }, + new() { Start = 68, End = 70, Font = font2 }, } }; @@ -643,8 +643,8 @@ public void BuildTextRuns_PreventsOverlappingRun() { TextRuns = new List() { - new TextRun() { Start = 0, End = 23 }, - new TextRun() { Start = 1, End = 76 }, + new() { Start = 0, End = 23 }, + new() { Start = 1, End = 76 }, } }; @@ -849,100 +849,100 @@ public void TextJustification_InterWord_Vertical(TextDirection direction) public static TheoryData OpenSans_Data = new() { - { '!', new(0F, 0F, 1.1621094F, 7.2753906F) }, - { '"', new(0F, 0F, 2.6660156F, 2.578125F) }, - { '#', new(0F, 0F, 5.9472656F, 7.138672F) }, - { '$', new(0F, 0F, 4.4921875F, 8.168945F) }, - { '%', new(0F, 0F, 7.270508F, 7.338867F) }, - { '&', new(0F, 0F, 6.689453F, 7.348633F) }, - { '\'', new(0F, 0F, 0.87890625F, 2.578125F) }, - { '(', new(0F, 0F, 2.2460938F, 8.720703F) }, - { ')', new(0F, 0F, 2.2460938F, 8.720703F) }, - { '*', new(0F, 0F, 4.614258F, 4.4433594F) }, - { '+', new(0F, 0F, 4.692383F, 4.814453F) }, - { ',', new(0F, 0F, 1.4404297F, 2.4511719F) }, - { '-', new(0F, 0F, 2.421875F, 0.72265625F) }, - { '.', new(0F, 0F, 1.1621094F, 1.2744141F) }, - { '/', new(0F, 0F, 3.4570312F, 7.138672F) }, - { '0', new(0F, 0F, 4.7070312F, 7.348633F) }, - { '1', new(0F, 0F, 2.6074219F, 7.138672F) }, - { '2', new(0F, 0F, 4.6777344F, 7.241211F) }, - { '3', new(0F, 0F, 4.6777344F, 7.338867F) }, - { '4', new(0F, 0F, 5.3125F, 7.1777344F) }, - { '5', new(0F, 0F, 4.4970703F, 7.236328F) }, - { '6', new(0F, 0F, 4.6679688F, 7.338867F) }, - { '7', new(0F, 0F, 4.760742F, 7.138672F) }, - { '8', new(0F, 0F, 4.6972656F, 7.338867F) }, - { '9', new(0F, 0F, 4.6777344F, 7.34375F) }, - { ':', new(0F, 0F, 1.1621094F, 5.6152344F) }, - { ';', new(0F, 0F, 1.5576172F, 6.767578F) }, - { '<', new(0F, 0F, 4.6972656F, 4.868164F) }, - { '=', new(0F, 0F, 4.580078F, 2.65625F) }, - { '>', new(0F, 0F, 4.6972656F, 4.868164F) }, - { '?', new(0F, 0F, 3.8916016F, 7.3779297F) }, - { '@', new(0F, 0F, 7.817383F, 8.032227F) }, - { 'A', new(0F, 0F, 6.3134766F, 7.1679688F) }, - { 'B', new(0F, 0F, 4.9414062F, 7.138672F) }, - { 'C', new(0F, 0F, 5.3808594F, 7.338867F) }, - { 'D', new(0F, 0F, 5.6689453F, 7.138672F) }, - { 'E', new(0F, 0F, 3.9746094F, 7.138672F) }, - { 'F', new(0F, 0F, 3.9746094F, 7.138672F) }, - { 'G', new(0F, 0F, 5.913086F, 7.338867F) }, - { 'H', new(0F, 0F, 5.4101562F, 7.138672F) }, - { 'I', new(0F, 0F, 0.8300781F, 7.138672F) }, - { 'J', new(0F, 0F, 2.5683594F, 9.018555F) }, - { 'K', new(0F, 0F, 5.1464844F, 7.138672F) }, - { 'L', new(0F, 0F, 3.9990234F, 7.138672F) }, - { 'M', new(0F, 0F, 7.0410156F, 7.138672F) }, - { 'N', new(0F, 0F, 5.5810547F, 7.138672F) }, - { 'O', new(0F, 0F, 6.557617F, 7.348633F) }, - { 'P', new(0F, 0F, 4.5214844F, 7.138672F) }, - { 'Q', new(0F, 0F, 6.557617F, 8.950195F) }, - { 'R', new(0F, 0F, 5.029297F, 7.138672F) }, - { 'S', new(0F, 0F, 4.4921875F, 7.338867F) }, - { 'T', new(0F, 0F, 5.317383F, 7.138672F) }, - { 'U', new(0F, 0F, 5.473633F, 7.236328F) }, - { 'V', new(0F, 0F, 5.961914F, 7.138672F) }, - { 'W', new(0F, 0F, 8.94043F, 7.138672F) }, - { 'X', new(0F, 0F, 5.7128906F, 7.138672F) }, - { 'Y', new(0F, 0F, 5.5908203F, 7.138672F) }, - { 'Z', new(0F, 0F, 4.9560547F, 7.138672F) }, - { '[', new(0F, 0F, 2.211914F, 8.720703F) }, - { '\\', new(0F, 0F, 3.4667969F, 7.138672F) }, - { ']', new(0F, 0F, 2.2167969F, 8.720703F) }, - { '^', new(0F, 0F, 4.9414062F, 4.5117188F) }, - { '_', new(0F, 0F, 4.4189453F, 0.60058594F) }, - { '`', new(0F, 0F, 1.9775391F, 1.6015625F) }, - { 'a', new(0F, 0F, 4.2822266F, 5.5371094F) }, - { 'b', new(0F, 0F, 4.7070312F, 7.6953125F) }, - { 'c', new(0F, 0F, 3.90625F, 5.546875F) }, - { 'd', new(0F, 0F, 4.7021484F, 7.6953125F) }, - { 'e', new(0F, 0F, 4.536133F, 5.546875F) }, - { 'f', new(0F, 0F, 3.671875F, 7.651367F) }, - { 'g', new(0F, 0F, 5.078125F, 7.861328F) }, - { 'h', new(0F, 0F, 4.4628906F, 7.5976562F) }, - { 'i', new(0F, 0F, 0.9765625F, 7.3535156F) }, - { 'j', new(0F, 0F, 2.3046875F, 9.755859F) }, - { 'k', new(0F, 0F, 4.321289F, 7.5976562F) }, - { 'l', new(0F, 0F, 0.8154297F, 7.5976562F) }, - { 'm', new(0F, 0F, 7.5927734F, 5.4492188F) }, - { 'n', new(0F, 0F, 4.4628906F, 5.4492188F) }, - { 'o', new(0F, 0F, 4.9121094F, 5.546875F) }, - { 'p', new(0F, 0F, 4.7070312F, 7.841797F) }, - { 'q', new(0F, 0F, 4.7021484F, 7.841797F) }, - { 'r', new(0F, 0F, 3.0810547F, 5.4492188F) }, - { 's', new(0F, 0F, 3.8134766F, 5.546875F) }, - { 't', new(0F, 0F, 3.178711F, 6.689453F) }, - { 'u', new(0F, 0F, 4.477539F, 5.4492188F) }, - { 'v', new(0F, 0F, 4.995117F, 5.3515625F) }, - { 'w', new(0F, 0F, 7.5146484F, 5.3515625F) }, - { 'x', new(0F, 0F, 4.8535156F, 5.3515625F) }, - { 'y', new(0F, 0F, 5F, 7.758789F) }, - { 'z', new(0F, 0F, 3.9013672F, 5.3515625F) }, - { '{', new(0F, 0F, 3.149414F, 8.720703F) }, - { '|', new(0F, 0F, 0.67871094F, 10.024414F) }, - { '}', new(0F, 0F, 3.149414F, 8.720703F) }, - { '~', new(0F, 0F, 4.6972656F, 1.2597656F) }, + { '!', new FontRectangle(0F, 0F, 1.1621094F, 7.2753906F) }, + { '"', new FontRectangle(0F, 0F, 2.6660156F, 2.578125F) }, + { '#', new FontRectangle(0F, 0F, 5.9472656F, 7.138672F) }, + { '$', new FontRectangle(0F, 0F, 4.4921875F, 8.168945F) }, + { '%', new FontRectangle(0F, 0F, 7.270508F, 7.338867F) }, + { '&', new FontRectangle(0F, 0F, 6.689453F, 7.348633F) }, + { '\'', new FontRectangle(0F, 0F, 0.87890625F, 2.578125F) }, + { '(', new FontRectangle(0F, 0F, 2.2460938F, 8.720703F) }, + { ')', new FontRectangle(0F, 0F, 2.2460938F, 8.720703F) }, + { '*', new FontRectangle(0F, 0F, 4.614258F, 4.4433594F) }, + { '+', new FontRectangle(0F, 0F, 4.692383F, 4.814453F) }, + { ',', new FontRectangle(0F, 0F, 1.4404297F, 2.4511719F) }, + { '-', new FontRectangle(0F, 0F, 2.421875F, 0.72265625F) }, + { '.', new FontRectangle(0F, 0F, 1.1621094F, 1.2744141F) }, + { '/', new FontRectangle(0F, 0F, 3.4570312F, 7.138672F) }, + { '0', new FontRectangle(0F, 0F, 4.7070312F, 7.348633F) }, + { '1', new FontRectangle(0F, 0F, 2.6074219F, 7.138672F) }, + { '2', new FontRectangle(0F, 0F, 4.6777344F, 7.241211F) }, + { '3', new FontRectangle(0F, 0F, 4.6777344F, 7.338867F) }, + { '4', new FontRectangle(0F, 0F, 5.3125F, 7.1777344F) }, + { '5', new FontRectangle(0F, 0F, 4.4970703F, 7.236328F) }, + { '6', new FontRectangle(0F, 0F, 4.6679688F, 7.338867F) }, + { '7', new FontRectangle(0F, 0F, 4.760742F, 7.138672F) }, + { '8', new FontRectangle(0F, 0F, 4.6972656F, 7.338867F) }, + { '9', new FontRectangle(0F, 0F, 4.6777344F, 7.34375F) }, + { ':', new FontRectangle(0F, 0F, 1.1621094F, 5.6152344F) }, + { ';', new FontRectangle(0F, 0F, 1.5576172F, 6.767578F) }, + { '<', new FontRectangle(0F, 0F, 4.6972656F, 4.868164F) }, + { '=', new FontRectangle(0F, 0F, 4.580078F, 2.65625F) }, + { '>', new FontRectangle(0F, 0F, 4.6972656F, 4.868164F) }, + { '?', new FontRectangle(0F, 0F, 3.8916016F, 7.3779297F) }, + { '@', new FontRectangle(0F, 0F, 7.817383F, 8.032227F) }, + { 'A', new FontRectangle(0F, 0F, 6.3134766F, 7.1679688F) }, + { 'B', new FontRectangle(0F, 0F, 4.9414062F, 7.138672F) }, + { 'C', new FontRectangle(0F, 0F, 5.3808594F, 7.338867F) }, + { 'D', new FontRectangle(0F, 0F, 5.6689453F, 7.138672F) }, + { 'E', new FontRectangle(0F, 0F, 3.9746094F, 7.138672F) }, + { 'F', new FontRectangle(0F, 0F, 3.9746094F, 7.138672F) }, + { 'G', new FontRectangle(0F, 0F, 5.913086F, 7.338867F) }, + { 'H', new FontRectangle(0F, 0F, 5.4101562F, 7.138672F) }, + { 'I', new FontRectangle(0F, 0F, 0.8300781F, 7.138672F) }, + { 'J', new FontRectangle(0F, 0F, 2.5683594F, 9.018555F) }, + { 'K', new FontRectangle(0F, 0F, 5.1464844F, 7.138672F) }, + { 'L', new FontRectangle(0F, 0F, 3.9990234F, 7.138672F) }, + { 'M', new FontRectangle(0F, 0F, 7.0410156F, 7.138672F) }, + { 'N', new FontRectangle(0F, 0F, 5.5810547F, 7.138672F) }, + { 'O', new FontRectangle(0F, 0F, 6.557617F, 7.348633F) }, + { 'P', new FontRectangle(0F, 0F, 4.5214844F, 7.138672F) }, + { 'Q', new FontRectangle(0F, 0F, 6.557617F, 8.950195F) }, + { 'R', new FontRectangle(0F, 0F, 5.029297F, 7.138672F) }, + { 'S', new FontRectangle(0F, 0F, 4.4921875F, 7.338867F) }, + { 'T', new FontRectangle(0F, 0F, 5.317383F, 7.138672F) }, + { 'U', new FontRectangle(0F, 0F, 5.473633F, 7.236328F) }, + { 'V', new FontRectangle(0F, 0F, 5.961914F, 7.138672F) }, + { 'W', new FontRectangle(0F, 0F, 8.94043F, 7.138672F) }, + { 'X', new FontRectangle(0F, 0F, 5.7128906F, 7.138672F) }, + { 'Y', new FontRectangle(0F, 0F, 5.5908203F, 7.138672F) }, + { 'Z', new FontRectangle(0F, 0F, 4.9560547F, 7.138672F) }, + { '[', new FontRectangle(0F, 0F, 2.211914F, 8.720703F) }, + { '\\', new FontRectangle(0F, 0F, 3.4667969F, 7.138672F) }, + { ']', new FontRectangle(0F, 0F, 2.2167969F, 8.720703F) }, + { '^', new FontRectangle(0F, 0F, 4.9414062F, 4.5117188F) }, + { '_', new FontRectangle(0F, 0F, 4.4189453F, 0.60058594F) }, + { '`', new FontRectangle(0F, 0F, 1.9775391F, 1.6015625F) }, + { 'a', new FontRectangle(0F, 0F, 4.2822266F, 5.5371094F) }, + { 'b', new FontRectangle(0F, 0F, 4.7070312F, 7.6953125F) }, + { 'c', new FontRectangle(0F, 0F, 3.90625F, 5.546875F) }, + { 'd', new FontRectangle(0F, 0F, 4.7021484F, 7.6953125F) }, + { 'e', new FontRectangle(0F, 0F, 4.536133F, 5.546875F) }, + { 'f', new FontRectangle(0F, 0F, 3.671875F, 7.651367F) }, + { 'g', new FontRectangle(0F, 0F, 5.078125F, 7.861328F) }, + { 'h', new FontRectangle(0F, 0F, 4.4628906F, 7.5976562F) }, + { 'i', new FontRectangle(0F, 0F, 0.9765625F, 7.3535156F) }, + { 'j', new FontRectangle(0F, 0F, 2.3046875F, 9.755859F) }, + { 'k', new FontRectangle(0F, 0F, 4.321289F, 7.5976562F) }, + { 'l', new FontRectangle(0F, 0F, 0.8154297F, 7.5976562F) }, + { 'm', new FontRectangle(0F, 0F, 7.5927734F, 5.4492188F) }, + { 'n', new FontRectangle(0F, 0F, 4.4628906F, 5.4492188F) }, + { 'o', new FontRectangle(0F, 0F, 4.9121094F, 5.546875F) }, + { 'p', new FontRectangle(0F, 0F, 4.7070312F, 7.841797F) }, + { 'q', new FontRectangle(0F, 0F, 4.7021484F, 7.841797F) }, + { 'r', new FontRectangle(0F, 0F, 3.0810547F, 5.4492188F) }, + { 's', new FontRectangle(0F, 0F, 3.8134766F, 5.546875F) }, + { 't', new FontRectangle(0F, 0F, 3.178711F, 6.689453F) }, + { 'u', new FontRectangle(0F, 0F, 4.477539F, 5.4492188F) }, + { 'v', new FontRectangle(0F, 0F, 4.995117F, 5.3515625F) }, + { 'w', new FontRectangle(0F, 0F, 7.5146484F, 5.3515625F) }, + { 'x', new FontRectangle(0F, 0F, 4.8535156F, 5.3515625F) }, + { 'y', new FontRectangle(0F, 0F, 5F, 7.758789F) }, + { 'z', new FontRectangle(0F, 0F, 3.9013672F, 5.3515625F) }, + { '{', new FontRectangle(0F, 0F, 3.149414F, 8.720703F) }, + { '|', new FontRectangle(0F, 0F, 0.67871094F, 10.024414F) }, + { '}', new FontRectangle(0F, 0F, 3.149414F, 8.720703F) }, + { '~', new FontRectangle(0F, 0F, 4.6972656F, 1.2597656F) }, }; [Theory] @@ -958,7 +958,7 @@ public void TrueTypeHinting_CanHintSmallOpenSans(char c, FontRectangle expected) FontRectangle actual = TextMeasurer.MeasureSize(c.ToString(), options); Assert.Equal(expected, actual, Comparer); - options = new(OpenSansWoff) + options = new TextOptions(OpenSansWoff) { KerningMode = KerningMode.Standard, HintingMode = HintingMode.Standard @@ -1231,7 +1231,7 @@ public static List GenerateGlyphsBoxes(string text, TextOptions o return glyphBuilder.GlyphBounds; } - public readonly List GlyphBounds = new(); + public readonly List GlyphBounds = []; public CaptureGlyphBoundBuilder() { @@ -1422,10 +1422,7 @@ public void TrueTypeHinting_CanHintSmallSegoeUi(char c, FontRectangle expected) private static IReadOnlyList CollectFirstLine(IReadOnlyList glyphs) { - List line = new() - { - glyphs[0] - }; + List line = [glyphs[0]]; for (int i = 1; i < glyphs.Count; i++) { @@ -1456,14 +1453,14 @@ public static Font CreateRenderingFont(float pointSize = 12) public static Font CreateFont(string text) { - var fc = (IFontMetricsCollection)new FontCollection(); + IFontMetricsCollection fc = (IFontMetricsCollection)new FontCollection(); Font d = fc.AddMetrics(new FakeFontInstance(text), CultureInfo.InvariantCulture).CreateFont(12); return new Font(d, 1F); } public static Font CreateFont(string text, float pointSize) { - var fc = (IFontMetricsCollection)new FontCollection(); + IFontMetricsCollection fc = (IFontMetricsCollection)new FontCollection(); Font d = fc.AddMetrics(new FakeFontInstance(text), CultureInfo.InvariantCulture).CreateFont(12); return new Font(d, pointSize); } diff --git a/tests/SixLabors.Fonts.Tests/TextOptionsTests.cs b/tests/SixLabors.Fonts.Tests/TextOptionsTests.cs index 52ab2cc3e..af7593778 100644 --- a/tests/SixLabors.Fonts.Tests/TextOptionsTests.cs +++ b/tests/SixLabors.Fonts.Tests/TextOptionsTests.cs @@ -24,7 +24,7 @@ public TextOptionsTests() public void ConstructorTest_FontOnly() { Font font = FakeFont.CreateFont("ABC"); - var options = new TextOptions(font); + TextOptions options = new(font); Assert.Equal(72, options.Dpi); Assert.Empty(options.FallbackFontFamilies); @@ -38,7 +38,7 @@ public void ConstructorTest_FontWithSingleDpi() { Font font = FakeFont.CreateFont("ABC"); const float dpi = 123; - var options = new TextOptions(font) { Dpi = dpi }; + TextOptions options = new(font) { Dpi = dpi }; Assert.Equal(dpi, options.Dpi); Assert.Empty(options.FallbackFontFamilies); @@ -51,7 +51,7 @@ public void ConstructorTest_FontWithSingleDpi() public void ConstructorTest_FontWithOrigin() { Font font = FakeFont.CreateFont("ABC"); - var origin = new Vector2(123, 345); + Vector2 origin = new(123, 345); TextOptions options = new(font) { Origin = origin }; Assert.Equal(72, options.Dpi); @@ -65,7 +65,7 @@ public void ConstructorTest_FontWithOrigin() public void ConstructorTest_FontWithSingleDpiWithOrigin() { Font font = FakeFont.CreateFont("ABC"); - var origin = new Vector2(123, 345); + Vector2 origin = new(123, 345); const float dpi = 123; TextOptions options = new(font) { Dpi = dpi, Origin = origin }; @@ -80,13 +80,13 @@ public void ConstructorTest_FontWithSingleDpiWithOrigin() public void ConstructorTest_FontOnly_WithFallbackFonts() { Font font = FakeFont.CreateFont("ABC"); - FontFamily[] fontFamilies = new[] - { + FontFamily[] fontFamilies = + [ FakeFont.CreateFont("DEF").Family, FakeFont.CreateFont("GHI").Family - }; + ]; - var options = new TextOptions(font) + TextOptions options = new(font) { FallbackFontFamilies = fontFamilies }; @@ -102,14 +102,14 @@ public void ConstructorTest_FontOnly_WithFallbackFonts() public void ConstructorTest_FontWithSingleDpi_WithFallbackFonts() { Font font = FakeFont.CreateFont("ABC"); - FontFamily[] fontFamilies = new[] - { + FontFamily[] fontFamilies = + [ FakeFont.CreateFont("DEF").Family, FakeFont.CreateFont("GHI").Family - }; + ]; const float dpi = 123; - var options = new TextOptions(font) + TextOptions options = new(font) { Dpi = dpi, FallbackFontFamilies = fontFamilies @@ -126,13 +126,13 @@ public void ConstructorTest_FontWithSingleDpi_WithFallbackFonts() public void ConstructorTest_FontWithOrigin_WithFallbackFonts() { Font font = FakeFont.CreateFont("ABC"); - FontFamily[] fontFamilies = new[] - { + FontFamily[] fontFamilies = + [ FakeFont.CreateFont("DEF").Family, FakeFont.CreateFont("GHI").Family - }; + ]; - var origin = new Vector2(123, 345); + Vector2 origin = new(123, 345); TextOptions options = new(font) { FallbackFontFamilies = fontFamilies, @@ -150,13 +150,13 @@ public void ConstructorTest_FontWithOrigin_WithFallbackFonts() public void ConstructorTest_FontWithSingleDpiWithOrigin_WithFallbackFonts() { Font font = FakeFont.CreateFont("ABC"); - FontFamily[] fontFamilies = new[] - { + FontFamily[] fontFamilies = + [ FakeFont.CreateFont("DEF").Family, FakeFont.CreateFont("GHI").Family - }; + ]; - var origin = new Vector2(123, 345); + Vector2 origin = new(123, 345); const float dpi = 123; TextOptions options = new(font) { @@ -176,20 +176,20 @@ public void ConstructorTest_FontWithSingleDpiWithOrigin_WithFallbackFonts() public void GetMissingGlyphFromMainFont() { Font font = FakeFont.CreateFontWithInstance("ABC", "ABC", out Fakes.FakeFontInstance abcFontInstance); - FontFamily[] fontFamilies = new[] - { + FontFamily[] fontFamilies = + [ FakeFont.CreateFontWithInstance("DEF", "DEF", out Fakes.FakeFontInstance defFontInstance).Family, FakeFont.CreateFontWithInstance("GHI", "GHI", out Fakes.FakeFontInstance ghiFontInstance).Family - }; + ]; - var options = new TextOptions(font) + TextOptions options = new(font) { FallbackFontFamilies = fontFamilies, ColorFontSupport = ColorFontSupport.None }; ReadOnlySpan text = "Z".AsSpan(); - var renderer = new GlyphRenderer(); + GlyphRenderer renderer = new(); TextRenderer.RenderTextTo(renderer, text, options); GlyphRendererParameters glyph = Assert.Single(renderer.GlyphKeys); @@ -204,20 +204,20 @@ public void GetMissingGlyphFromMainFont() public void GetGlyphFromFirstAvailableInstance(char character, string instance) { Font font = FakeFont.CreateFontWithInstance("ABC", "ABC", out Fakes.FakeFontInstance abcFontInstance); - FontFamily[] fontFamilies = new[] - { + FontFamily[] fontFamilies = + [ FakeFont.CreateFontWithInstance("DEF", "DEF", out Fakes.FakeFontInstance defFontInstance).Family, FakeFont.CreateFontWithInstance("EFGHI", "EFGHI", out Fakes.FakeFontInstance efghiFontInstance).Family - }; + ]; - var options = new TextOptions(font) + TextOptions options = new(font) { FallbackFontFamilies = fontFamilies, ColorFontSupport = ColorFontSupport.None }; ReadOnlySpan text = new[] { character }; - var renderer = new GlyphRenderer(); + GlyphRenderer renderer = new(); TextRenderer.RenderTextTo(renderer, text, options); GlyphRendererParameters glyph = Assert.Single(renderer.GlyphKeys); Assert.Equal(GlyphType.Standard, glyph.GlyphType); @@ -329,7 +329,7 @@ public void NonDefaultClone() [Fact] public void CloneIsDeep() { - var expected = new TextOptions(this.fakeFont); + TextOptions expected = new(this.fakeFont); TextOptions actual = new(expected) { KerningMode = KerningMode.None, diff --git a/tests/SixLabors.Fonts.Tests/TrueTypeCollectionTests.cs b/tests/SixLabors.Fonts.Tests/TrueTypeCollectionTests.cs index 9edcccef4..17a86838c 100644 --- a/tests/SixLabors.Fonts.Tests/TrueTypeCollectionTests.cs +++ b/tests/SixLabors.Fonts.Tests/TrueTypeCollectionTests.cs @@ -10,7 +10,7 @@ public class TrueTypeCollectionTests [Fact] public void AddViaPathReturnsDescription() { - var suit = new FontCollection(); + FontCollection suit = new(); IEnumerable collectionFromPath = suit.AddCollection(TestFonts.SimpleTrueTypeCollection, out IEnumerable descriptions); Assert.Equal(2, descriptions.Count()); @@ -25,7 +25,7 @@ public void AddViaPathReturnsDescription() [Fact] public void AddViaPathAddFontFileInstances() { - var sut = new FontCollection(); + FontCollection sut = new(); IEnumerable collectionFromPath = sut.AddCollection(TestFonts.SimpleTrueTypeCollection, out IEnumerable descriptions); IEnumerable allInstances = sut.Families.SelectMany(x => ((IReadOnlyFontMetricsCollection)sut).GetAllMetrics(x.Name, CultureInfo.InvariantCulture)); @@ -39,7 +39,7 @@ public void AddViaPathAddFontFileInstances() [Fact] public void AddViaStreamReturnsDescription() { - var suit = new FontCollection(); + FontCollection suit = new(); IEnumerable collectionFromPath = suit.AddCollection(TestFonts.SSimpleTrueTypeCollectionData(), out IEnumerable descriptions); Assert.Equal(2, collectionFromPath.Count()); diff --git a/tests/SixLabors.Fonts.Tests/Unicode/BidiAlgorithmTests.cs b/tests/SixLabors.Fonts.Tests/Unicode/BidiAlgorithmTests.cs index d5764783d..85bf2d20d 100644 --- a/tests/SixLabors.Fonts.Tests/Unicode/BidiAlgorithmTests.cs +++ b/tests/SixLabors.Fonts.Tests/Unicode/BidiAlgorithmTests.cs @@ -21,10 +21,10 @@ public void RendersKurdishTextCorrect() ColorGlyphRenderer renderer = new(); const string testStr = "نەما خانی هەتا چیڕۆکی عیشقی ئێمە داڕێژێ"; int[] expectedGlyphIndices = - { + [ 0, 214, 0, 0, 139, 197, 3, 0, 289, 0, 333, 3, 336, 266, 221, 337, 242, 3, 336, 276, 0, 0, 337, 188, 3, 140, 170, 0, 301, 3, 336, 294, 140, 196, 3, 140, 290, 0, 294 - }; + ]; // act TextRenderer.RenderTextTo(renderer, testStr, new TextOptions(arabicFont)); @@ -42,13 +42,13 @@ public void RendersFarsiTextCorrect() { // arrange Font arabicFont = new FontCollection().Add(TestFonts.ArabicFontFile).CreateFont(8); - var renderer = new ColorGlyphRenderer(); + ColorGlyphRenderer renderer = new(); const string testStr = "زناب فارسی را تک کمی سخت است"; int[] expectedGlyphIndices = - { + [ 168, 218, 139, 3, 168, 195, 218, 3, 336, 289, 276, 3, 274, 170, 3, 139, 203, 3, 336, 218, 203, 140, 250, 3, 157, 140, 294, 207 - }; + ]; // act TextRenderer.RenderTextTo(renderer, testStr, new TextOptions(arabicFont)); @@ -69,11 +69,11 @@ public void RendersArabicTextWithPunctuationCorrectly() ColorGlyphRenderer renderer = new(); const string testStr = "زۆرمان باس کرد؛ باسی ئاو، کەش، هەوای کوردستان."; int[] expectedGlyphIndices = - { + [ 17, 997, 910, 920, 947, 937, 941, 1006, 815, 3, 821, 909, 1005, 1002, 1003, 3, 748, 949, 1002, 815, 3, 748, 1005, 910, 907, 3, 822, 947, 910, 913, 3, 749, 937, 942, 815, 3, 945, 910, 913, 3, 997, 910, 995, 941, 1574, 943 - }; + ]; // act TextRenderer.RenderTextTo(renderer, testStr, new TextOptions(arabicFont)); @@ -91,9 +91,9 @@ public void RendersArabicNumbersFromLeftToRight() { // arrange Font arabicFont = new FontCollection().Add(TestFonts.ArabicFontFile).CreateFont(12); - var renderer = new ColorGlyphRenderer(); + ColorGlyphRenderer renderer = new(); string testStr = "٠١٢٣٤٥٦٧٨٩"; - int[] expectedGlyphIndices = { 403, 405, 407, 409, 411, 413, 415, 417, 419, 421 }; + int[] expectedGlyphIndices = [403, 405, 407, 409, 411, 413, 415, 417, 419, 421]; // act TextRenderer.RenderTextTo(renderer, testStr, new TextOptions(arabicFont)); @@ -113,7 +113,8 @@ public void MixingArabicWordsWithNumbers_Works() Font arabicFont = new FontCollection().Add(TestFonts.SegeouiFontFile).CreateFont(12); ColorGlyphRenderer renderer = new(); const string testStr = "لە ساڵی ١٢٣٤ ڕوویدا"; - int[] expectedGlyphIndices = { 2317, 3631, 2380, 2345, 2345, 2485, 3, 2264, 2265, 2266, 2267, 3, 2379, 2540, 2247, 2260, 3, 2842, 2286 }; + int[] expectedGlyphIndices = [2317, 3631, 2380, 2345, 2345, 2485, 3, 2264, 2265, 2266, 2267, 3, 2379, 2540, 2247, 2260, 3, 2842, 2286 + ]; // act TextRenderer.RenderTextTo(renderer, testStr, new TextOptions(arabicFont)); @@ -133,7 +134,7 @@ public void MathematicalFormulasWithArabicText_Works() Font arabicFont = new FontCollection().Add(TestFonts.SegeouiFontFile).CreateFont(12); ColorGlyphRenderer renderer = new(); const string testStr = "١١س + ٨ج = ٨٥١"; - int[] expectedGlyphIndices = { 2271, 2268, 2264, 3, 32, 3, 2322, 2271, 3, 14, 3, 2329, 2264, 2264 }; + int[] expectedGlyphIndices = [2271, 2268, 2264, 3, 32, 3, 2322, 2271, 3, 14, 3, 2329, 2264, 2264]; // act TextRenderer.RenderTextTo(renderer, testStr, new TextOptions(arabicFont)); @@ -157,9 +158,9 @@ private bool ICUTestsImpl() // Read the test file string[] lines = File.ReadAllLines(Path.Combine(TestEnvironment.UnicodeTestDataFullPath, "BidiTest.txt")); - var bidi = new BidiAlgorithm(); + BidiAlgorithm bidi = new(); - var tests = new List(); + List tests = []; // Process each line int[] levels = null; diff --git a/tests/SixLabors.Fonts.Tests/Unicode/BidiCharacterTests.cs b/tests/SixLabors.Fonts.Tests/Unicode/BidiCharacterTests.cs index d0a348489..bb7382c8e 100644 --- a/tests/SixLabors.Fonts.Tests/Unicode/BidiCharacterTests.cs +++ b/tests/SixLabors.Fonts.Tests/Unicode/BidiCharacterTests.cs @@ -26,7 +26,7 @@ private bool ICUTestsImpl() string[] lines = File.ReadAllLines(Path.Combine(TestEnvironment.UnicodeTestDataFullPath, "BidiCharacterTest.txt")); // Parse lines - var tests = new List(); + List tests = []; for (int lineNumber = 1; lineNumber < lines.Length + 1; lineNumber++) { // Get the line, remove comments @@ -56,14 +56,14 @@ private bool ICUTestsImpl() // Parse field 4 - resolved levels int[] resolvedOrder = fields[4].Split(' ').Select(x => x.Trim()).Where(x => !string.IsNullOrEmpty(x)).Select(x => Convert.ToInt32(x)).ToArray(); - var test = new Test(lineNumber, codePoints, paragraphLevel, resolvedParagraphLevel, resolvedLevels, resolvedOrder); + Test test = new(lineNumber, codePoints, paragraphLevel, resolvedParagraphLevel, resolvedLevels, resolvedOrder); tests.Add(test); } this.output.WriteLine($"Test data loaded: {tests.Count} test cases"); - var bidi = new BidiAlgorithm(); - var bidiData = new BidiData(); + BidiAlgorithm bidi = new(); + BidiData bidiData = new(); // Run tests... for (int testNumber = 0; testNumber < tests.Count; testNumber++) diff --git a/tests/SixLabors.Fonts.Tests/Unicode/CodePointTests.TestData.cs b/tests/SixLabors.Fonts.Tests/Unicode/CodePointTests.TestData.cs index a5f07ece3..536357bb4 100644 --- a/tests/SixLabors.Fonts.Tests/Unicode/CodePointTests.TestData.cs +++ b/tests/SixLabors.Fonts.Tests/Unicode/CodePointTests.TestData.cs @@ -17,8 +17,8 @@ public partial class CodePointTests { public static IEnumerable GeneralTestData_BmpCodePoints_NoSurrogates() { - yield return new object[] - { + yield return + [ // first BMP code point / first ASCII code point new GeneralTestData { @@ -26,13 +26,13 @@ public static IEnumerable GeneralTestData_BmpCodePoints_NoSurrogates() IsAscii = true, IsBmp = true, Plane = 0, - Utf16Sequence = new char[] { '\u0000' }, - Utf8Sequence = new byte[] { 0x00 } + Utf16Sequence = ['\u0000'], + Utf8Sequence = [0x00] } - }; + ]; - yield return new object[] - { + yield return + [ // last ASCII code point new GeneralTestData { @@ -40,12 +40,13 @@ public static IEnumerable GeneralTestData_BmpCodePoints_NoSurrogates() IsAscii = true, IsBmp = true, Plane = 0, - Utf16Sequence = new char[] { '\u007F' }, - Utf8Sequence = new byte[] { 0x7F } + Utf16Sequence = ['\u007F'], + Utf8Sequence = [0x7F] } - }; + ]; - yield return new object[] { + yield return + [ // first non-ASCII code point / first UTF-8 two-code unit code point new GeneralTestData { @@ -53,12 +54,13 @@ public static IEnumerable GeneralTestData_BmpCodePoints_NoSurrogates() IsAscii = false, IsBmp = true, Plane = 0, - Utf16Sequence = new char[] { '\u0080' }, - Utf8Sequence = new byte[] { 0xC2, 0x80 } + Utf16Sequence = ['\u0080'], + Utf8Sequence = [0xC2, 0x80] } - }; + ]; - yield return new object[] { + yield return + [ // last UTF-8 two-code unit code point new GeneralTestData { @@ -66,12 +68,13 @@ public static IEnumerable GeneralTestData_BmpCodePoints_NoSurrogates() IsAscii = false, IsBmp = true, Plane = 0, - Utf16Sequence = new char[] { '\u07FF' }, - Utf8Sequence = new byte[] { 0xDF, 0xBF } + Utf16Sequence = ['\u07FF'], + Utf8Sequence = [0xDF, 0xBF] } - }; + ]; - yield return new object[] { + yield return + [ // first UTF-8 three-code unit code point new GeneralTestData { @@ -79,12 +82,13 @@ public static IEnumerable GeneralTestData_BmpCodePoints_NoSurrogates() IsAscii = false, IsBmp = true, Plane = 0, - Utf16Sequence = new char[] { '\u0800' }, - Utf8Sequence = new byte[] { 0xE0, 0xA0, 0x80 } + Utf16Sequence = ['\u0800'], + Utf8Sequence = [0xE0, 0xA0, 0x80] } - }; + ]; - yield return new object[] { + yield return + [ // last code point before the surrogate range new GeneralTestData { @@ -92,12 +96,13 @@ public static IEnumerable GeneralTestData_BmpCodePoints_NoSurrogates() IsAscii = false, IsBmp = true, Plane = 0, - Utf16Sequence = new char[] { '\uD7FF' }, - Utf8Sequence = new byte[] { 0xED, 0x9F, 0xBF } + Utf16Sequence = ['\uD7FF'], + Utf8Sequence = [0xED, 0x9F, 0xBF] } - }; + ]; - yield return new object[] { + yield return + [ // first code point after the surrogate range new GeneralTestData { @@ -105,12 +110,13 @@ public static IEnumerable GeneralTestData_BmpCodePoints_NoSurrogates() IsAscii = false, IsBmp = true, Plane = 0, - Utf16Sequence = new char[] { '\uE000' }, - Utf8Sequence = new byte[] { 0xEE, 0x80, 0x80 } + Utf16Sequence = ['\uE000'], + Utf8Sequence = [0xEE, 0x80, 0x80] } - }; + ]; - yield return new object[] { + yield return + [ // replacement character new GeneralTestData { @@ -118,12 +124,13 @@ public static IEnumerable GeneralTestData_BmpCodePoints_NoSurrogates() IsAscii = false, IsBmp = true, Plane = 0, - Utf16Sequence = new char[] { '\uFFFD' }, - Utf8Sequence = new byte[] { 0xEF, 0xBF, 0xBD } + Utf16Sequence = ['\uFFFD'], + Utf8Sequence = [0xEF, 0xBF, 0xBD] } - }; + ]; - yield return new object[] { + yield return + [ // last BMP code point / last UTF-8 two-code unit code point new GeneralTestData { @@ -131,16 +138,16 @@ public static IEnumerable GeneralTestData_BmpCodePoints_NoSurrogates() IsAscii = false, IsBmp = true, Plane = 0, - Utf16Sequence = new char[] { '\uFFFF' }, - Utf8Sequence = new byte[] { 0xEF, 0xBF, 0xBF } + Utf16Sequence = ['\uFFFF'], + Utf8Sequence = [0xEF, 0xBF, 0xBF] } - }; + ]; } public static IEnumerable GeneralTestData_SupplementaryCodePoints_ValidOnly() { - yield return new object[] - { + yield return + [ // first BMP code point / first ASCII code point new GeneralTestData { @@ -148,13 +155,13 @@ public static IEnumerable GeneralTestData_SupplementaryCodePoints_Vali IsAscii = false, IsBmp = false, Plane = 1, - Utf16Sequence = new char[] { '\uD800', '\uDC00' }, - Utf8Sequence = new byte[] { 0xF0, 0x90, 0x80, 0x80 } + Utf16Sequence = ['\uD800', '\uDC00'], + Utf8Sequence = [0xF0, 0x90, 0x80, 0x80] } - }; + ]; - yield return new object[] - { + yield return + [ // last supplementary code point new GeneralTestData { @@ -162,56 +169,56 @@ public static IEnumerable GeneralTestData_SupplementaryCodePoints_Vali IsAscii = false, IsBmp = false, Plane = 16, - Utf16Sequence = new char[] { '\uDBFF', '\uDFFF' }, - Utf8Sequence = new byte[] { 0xF4, 0x8F, 0xBF, 0xBF } + Utf16Sequence = ['\uDBFF', '\uDFFF'], + Utf8Sequence = [0xF4, 0x8F, 0xBF, 0xBF] } - }; + ]; } public static IEnumerable IsValidTestData() { - foreach (var obj in GeneralTestData_BmpCodePoints_NoSurrogates().Concat(GeneralTestData_SupplementaryCodePoints_ValidOnly())) + foreach (object[] obj in GeneralTestData_BmpCodePoints_NoSurrogates().Concat(GeneralTestData_SupplementaryCodePoints_ValidOnly())) { - yield return new object[] { ((GeneralTestData)obj[0]).ScalarValue /* value */, true /* isValid */ }; + yield return [((GeneralTestData)obj[0]).ScalarValue /* value */, true /* isValid */]; } - foreach (var obj in BmpCodePoints_SurrogatesOnly().Concat(SupplementaryCodePoints_InvalidOnly())) + foreach (object[] obj in BmpCodePoints_SurrogatesOnly().Concat(SupplementaryCodePoints_InvalidOnly())) { - yield return new object[] { Convert.ToInt32(obj[0], CultureInfo.InvariantCulture) /* value */, false /* isValid */ }; + yield return [Convert.ToInt32(obj[0], CultureInfo.InvariantCulture) /* value */, false /* isValid */]; } } public static IEnumerable BmpCodePoints_SurrogatesOnly() { - yield return new object[] { '\uD800' }; // first high surrogate code point - yield return new object[] { '\uDBFF' }; // last high surrogate code point - yield return new object[] { '\uDC00' }; // first low surrogate code point - yield return new object[] { '\uDFFF' }; // last low surrogate code point + yield return ['\uD800']; // first high surrogate code point + yield return ['\uDBFF']; // last high surrogate code point + yield return ['\uDC00']; // first low surrogate code point + yield return ['\uDFFF']; // last low surrogate code point } public static IEnumerable SupplementaryCodePoints_InvalidOnly() { - yield return new object[] { (int)-1 }; // negative code points are disallowed - yield return new object[] { (int)0x110000 }; // just past the end of the allowed code point range - yield return new object[] { int.MaxValue }; // too large + yield return [(int)-1]; // negative code points are disallowed + yield return [(int)0x110000]; // just past the end of the allowed code point range + yield return [int.MaxValue]; // too large } public static IEnumerable SurrogatePairTestData_InvalidOnly() { - yield return new object[] { '\ud800', '\ud800' }; // two high surrogates - yield return new object[] { '\udfff', '\udfff' }; // two low surrogates - yield return new object[] { '\ude00', '\udb00' }; // low surrogate before high surrogate - yield return new object[] { '\ud900', '\u1234' }; // high surrogate followed by non-surrogate - yield return new object[] { '\ud900', '\ue000' }; // high surrogate followed by value just beyond low surrogate range - yield return new object[] { '\u1234', '\ude00' }; // low surrogate preceded by non-surrogate - yield return new object[] { '\udc00', '\ude00' }; // low surrogate preceded by value just beyond high surrogate range + yield return ['\ud800', '\ud800']; // two high surrogates + yield return ['\udfff', '\udfff']; // two low surrogates + yield return ['\ude00', '\udb00']; // low surrogate before high surrogate + yield return ['\ud900', '\u1234']; // high surrogate followed by non-surrogate + yield return ['\ud900', '\ue000']; // high surrogate followed by value just beyond low surrogate range + yield return ['\u1234', '\ude00']; // low surrogate preceded by non-surrogate + yield return ['\udc00', '\ude00']; // low surrogate preceded by value just beyond high surrogate range } public static IEnumerable SurrogatePairTestData_ValidOnly() { - yield return new object[] { '\ud800', '\udc00', 0x00010000 }; // lower bound for high & low surrogate - yield return new object[] { '\udbff', '\udfff', 0x0010FFFF }; // upper bound for high & low surrogate - yield return new object[] { '\ud83c', '\udfa8', 0x0001F3A8 }; // U+1F3A8 ARTIST PALETTE + yield return ['\ud800', '\udc00', 0x00010000]; // lower bound for high & low surrogate + yield return ['\udbff', '\udfff', 0x0010FFFF]; // upper bound for high & low surrogate + yield return ['\ud83c', '\udfa8', 0x0001F3A8]; // U+1F3A8 ARTIST PALETTE } public class GeneralTestData @@ -229,294 +236,559 @@ public static IEnumerable UnicodeInfoTestData_Latin1AndSelectOthers() { // ASCII - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x00), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x01), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x02), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x03), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x04), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x05), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x06), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x07), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x08), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x09), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = true } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x0A), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = true } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x0B), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = true } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x0C), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = true } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x0D), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = true } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x0E), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x0F), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x10), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x11), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x12), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x13), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x14), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x15), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x16), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x17), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x18), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x19), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x1A), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x1B), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x1C), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x1D), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x1E), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x1F), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x20), UnicodeCategory = UnicodeCategory.SpaceSeparator, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = true, IsSymbol = false, IsUpper = false, IsWhiteSpace = true } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x21), UnicodeCategory = UnicodeCategory.OtherPunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x22), UnicodeCategory = UnicodeCategory.OtherPunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x23), UnicodeCategory = UnicodeCategory.OtherPunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x24), UnicodeCategory = UnicodeCategory.CurrencySymbol, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = true, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x25), UnicodeCategory = UnicodeCategory.OtherPunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x26), UnicodeCategory = UnicodeCategory.OtherPunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x27), UnicodeCategory = UnicodeCategory.OtherPunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x28), UnicodeCategory = UnicodeCategory.OpenPunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x29), UnicodeCategory = UnicodeCategory.ClosePunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x2A), UnicodeCategory = UnicodeCategory.OtherPunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x2B), UnicodeCategory = UnicodeCategory.MathSymbol, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = true, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x2C), UnicodeCategory = UnicodeCategory.OtherPunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x2D), UnicodeCategory = UnicodeCategory.DashPunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x2E), UnicodeCategory = UnicodeCategory.OtherPunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x2F), UnicodeCategory = UnicodeCategory.OtherPunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x30), UnicodeCategory = UnicodeCategory.DecimalDigitNumber, NumericValue = 0, IsControl = false, IsDigit = true, IsLetter = false, IsLetterOrDigit = true, IsLower = false, IsNumber = true, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x31), UnicodeCategory = UnicodeCategory.DecimalDigitNumber, NumericValue = 1, IsControl = false, IsDigit = true, IsLetter = false, IsLetterOrDigit = true, IsLower = false, IsNumber = true, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x32), UnicodeCategory = UnicodeCategory.DecimalDigitNumber, NumericValue = 2, IsControl = false, IsDigit = true, IsLetter = false, IsLetterOrDigit = true, IsLower = false, IsNumber = true, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x33), UnicodeCategory = UnicodeCategory.DecimalDigitNumber, NumericValue = 3, IsControl = false, IsDigit = true, IsLetter = false, IsLetterOrDigit = true, IsLower = false, IsNumber = true, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x34), UnicodeCategory = UnicodeCategory.DecimalDigitNumber, NumericValue = 4, IsControl = false, IsDigit = true, IsLetter = false, IsLetterOrDigit = true, IsLower = false, IsNumber = true, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x35), UnicodeCategory = UnicodeCategory.DecimalDigitNumber, NumericValue = 5, IsControl = false, IsDigit = true, IsLetter = false, IsLetterOrDigit = true, IsLower = false, IsNumber = true, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x36), UnicodeCategory = UnicodeCategory.DecimalDigitNumber, NumericValue = 6, IsControl = false, IsDigit = true, IsLetter = false, IsLetterOrDigit = true, IsLower = false, IsNumber = true, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x37), UnicodeCategory = UnicodeCategory.DecimalDigitNumber, NumericValue = 7, IsControl = false, IsDigit = true, IsLetter = false, IsLetterOrDigit = true, IsLower = false, IsNumber = true, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x38), UnicodeCategory = UnicodeCategory.DecimalDigitNumber, NumericValue = 8, IsControl = false, IsDigit = true, IsLetter = false, IsLetterOrDigit = true, IsLower = false, IsNumber = true, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x39), UnicodeCategory = UnicodeCategory.DecimalDigitNumber, NumericValue = 9, IsControl = false, IsDigit = true, IsLetter = false, IsLetterOrDigit = true, IsLower = false, IsNumber = true, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x3A), UnicodeCategory = UnicodeCategory.OtherPunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x3B), UnicodeCategory = UnicodeCategory.OtherPunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x3C), UnicodeCategory = UnicodeCategory.MathSymbol, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = true, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x3D), UnicodeCategory = UnicodeCategory.MathSymbol, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = true, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x3E), UnicodeCategory = UnicodeCategory.MathSymbol, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = true, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x3F), UnicodeCategory = UnicodeCategory.OtherPunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x40), UnicodeCategory = UnicodeCategory.OtherPunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x41), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x42), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x43), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x44), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x45), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x46), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x47), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x48), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x49), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x4A), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x4B), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x4C), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x4D), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x4E), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x4F), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x50), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x51), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x52), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x53), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x54), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x55), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x56), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x57), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x58), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x59), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x5A), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x5B), UnicodeCategory = UnicodeCategory.OpenPunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x5C), UnicodeCategory = UnicodeCategory.OtherPunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x5D), UnicodeCategory = UnicodeCategory.ClosePunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x5E), UnicodeCategory = UnicodeCategory.ModifierSymbol, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = true, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x5F), UnicodeCategory = UnicodeCategory.ConnectorPunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x60), UnicodeCategory = UnicodeCategory.ModifierSymbol, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = true, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x61), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x62), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x63), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x64), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x65), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x66), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x67), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x68), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x69), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x6A), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x6B), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x6C), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x6D), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x6E), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x6F), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x70), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x71), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x72), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x73), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x74), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x75), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x76), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x77), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x78), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x79), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x7A), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x7B), UnicodeCategory = UnicodeCategory.OpenPunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x7C), UnicodeCategory = UnicodeCategory.MathSymbol, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = true, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x7D), UnicodeCategory = UnicodeCategory.ClosePunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x7E), UnicodeCategory = UnicodeCategory.MathSymbol, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = true, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x7F), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x00), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x01), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x02), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x03), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x04), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x05), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x06), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x07), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x08), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x09), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = true } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x0A), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = true } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x0B), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = true } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x0C), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = true } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x0D), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = true } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x0E), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x0F), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x10), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x11), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x12), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x13), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x14), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x15), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x16), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x17), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x18), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x19), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x1A), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x1B), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x1C), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x1D), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x1E), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x1F), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x20), UnicodeCategory = UnicodeCategory.SpaceSeparator, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = true, IsSymbol = false, IsUpper = false, IsWhiteSpace = true } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x21), UnicodeCategory = UnicodeCategory.OtherPunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x22), UnicodeCategory = UnicodeCategory.OtherPunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x23), UnicodeCategory = UnicodeCategory.OtherPunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x24), UnicodeCategory = UnicodeCategory.CurrencySymbol, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = true, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x25), UnicodeCategory = UnicodeCategory.OtherPunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x26), UnicodeCategory = UnicodeCategory.OtherPunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x27), UnicodeCategory = UnicodeCategory.OtherPunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x28), UnicodeCategory = UnicodeCategory.OpenPunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x29), UnicodeCategory = UnicodeCategory.ClosePunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x2A), UnicodeCategory = UnicodeCategory.OtherPunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x2B), UnicodeCategory = UnicodeCategory.MathSymbol, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = true, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x2C), UnicodeCategory = UnicodeCategory.OtherPunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x2D), UnicodeCategory = UnicodeCategory.DashPunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x2E), UnicodeCategory = UnicodeCategory.OtherPunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x2F), UnicodeCategory = UnicodeCategory.OtherPunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x30), UnicodeCategory = UnicodeCategory.DecimalDigitNumber, NumericValue = 0, IsControl = false, IsDigit = true, IsLetter = false, IsLetterOrDigit = true, IsLower = false, IsNumber = true, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x31), UnicodeCategory = UnicodeCategory.DecimalDigitNumber, NumericValue = 1, IsControl = false, IsDigit = true, IsLetter = false, IsLetterOrDigit = true, IsLower = false, IsNumber = true, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x32), UnicodeCategory = UnicodeCategory.DecimalDigitNumber, NumericValue = 2, IsControl = false, IsDigit = true, IsLetter = false, IsLetterOrDigit = true, IsLower = false, IsNumber = true, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x33), UnicodeCategory = UnicodeCategory.DecimalDigitNumber, NumericValue = 3, IsControl = false, IsDigit = true, IsLetter = false, IsLetterOrDigit = true, IsLower = false, IsNumber = true, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x34), UnicodeCategory = UnicodeCategory.DecimalDigitNumber, NumericValue = 4, IsControl = false, IsDigit = true, IsLetter = false, IsLetterOrDigit = true, IsLower = false, IsNumber = true, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x35), UnicodeCategory = UnicodeCategory.DecimalDigitNumber, NumericValue = 5, IsControl = false, IsDigit = true, IsLetter = false, IsLetterOrDigit = true, IsLower = false, IsNumber = true, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x36), UnicodeCategory = UnicodeCategory.DecimalDigitNumber, NumericValue = 6, IsControl = false, IsDigit = true, IsLetter = false, IsLetterOrDigit = true, IsLower = false, IsNumber = true, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x37), UnicodeCategory = UnicodeCategory.DecimalDigitNumber, NumericValue = 7, IsControl = false, IsDigit = true, IsLetter = false, IsLetterOrDigit = true, IsLower = false, IsNumber = true, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x38), UnicodeCategory = UnicodeCategory.DecimalDigitNumber, NumericValue = 8, IsControl = false, IsDigit = true, IsLetter = false, IsLetterOrDigit = true, IsLower = false, IsNumber = true, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x39), UnicodeCategory = UnicodeCategory.DecimalDigitNumber, NumericValue = 9, IsControl = false, IsDigit = true, IsLetter = false, IsLetterOrDigit = true, IsLower = false, IsNumber = true, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x3A), UnicodeCategory = UnicodeCategory.OtherPunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x3B), UnicodeCategory = UnicodeCategory.OtherPunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x3C), UnicodeCategory = UnicodeCategory.MathSymbol, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = true, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x3D), UnicodeCategory = UnicodeCategory.MathSymbol, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = true, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x3E), UnicodeCategory = UnicodeCategory.MathSymbol, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = true, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x3F), UnicodeCategory = UnicodeCategory.OtherPunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x40), UnicodeCategory = UnicodeCategory.OtherPunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x41), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x42), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x43), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x44), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x45), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x46), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x47), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x48), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x49), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x4A), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x4B), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x4C), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x4D), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x4E), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x4F), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x50), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x51), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x52), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x53), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x54), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x55), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x56), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x57), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x58), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x59), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x5A), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x5B), UnicodeCategory = UnicodeCategory.OpenPunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x5C), UnicodeCategory = UnicodeCategory.OtherPunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x5D), UnicodeCategory = UnicodeCategory.ClosePunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x5E), UnicodeCategory = UnicodeCategory.ModifierSymbol, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = true, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x5F), UnicodeCategory = UnicodeCategory.ConnectorPunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x60), UnicodeCategory = UnicodeCategory.ModifierSymbol, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = true, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x61), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x62), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x63), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x64), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x65), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x66), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x67), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x68), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x69), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x6A), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x6B), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x6C), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x6D), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x6E), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x6F), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x70), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x71), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x72), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x73), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x74), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x75), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x76), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x77), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x78), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x79), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x7A), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x7B), UnicodeCategory = UnicodeCategory.OpenPunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x7C), UnicodeCategory = UnicodeCategory.MathSymbol, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = true, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x7D), UnicodeCategory = UnicodeCategory.ClosePunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x7E), UnicodeCategory = UnicodeCategory.MathSymbol, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = true, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x7F), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; // Remainder of Latin-1 - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x80), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x81), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x82), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x83), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x84), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x85), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = true } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x86), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x87), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x88), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x89), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x8A), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x8B), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x8C), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x8D), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x8E), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x8F), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x90), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x91), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x92), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x93), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x94), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x95), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x96), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x97), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x98), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x99), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x9A), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x9B), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x9C), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x9D), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x9E), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x9F), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xA0), UnicodeCategory = UnicodeCategory.SpaceSeparator, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = true, IsSymbol = false, IsUpper = false, IsWhiteSpace = true } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xA1), UnicodeCategory = UnicodeCategory.OtherPunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xA2), UnicodeCategory = UnicodeCategory.CurrencySymbol, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = true, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xA3), UnicodeCategory = UnicodeCategory.CurrencySymbol, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = true, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xA4), UnicodeCategory = UnicodeCategory.CurrencySymbol, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = true, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xA5), UnicodeCategory = UnicodeCategory.CurrencySymbol, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = true, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xA6), UnicodeCategory = UnicodeCategory.OtherSymbol, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = true, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xA7), UnicodeCategory = UnicodeCategory.OtherPunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xA8), UnicodeCategory = UnicodeCategory.ModifierSymbol, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = true, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xA9), UnicodeCategory = UnicodeCategory.OtherSymbol, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = true, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xAA), UnicodeCategory = UnicodeCategory.OtherLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xAB), UnicodeCategory = UnicodeCategory.InitialQuotePunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xAC), UnicodeCategory = UnicodeCategory.MathSymbol, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = true, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xAD), UnicodeCategory = UnicodeCategory.Format, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xAE), UnicodeCategory = UnicodeCategory.OtherSymbol, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = true, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xAF), UnicodeCategory = UnicodeCategory.ModifierSymbol, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = true, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xB0), UnicodeCategory = UnicodeCategory.OtherSymbol, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = true, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xB1), UnicodeCategory = UnicodeCategory.MathSymbol, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = true, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xB2), UnicodeCategory = UnicodeCategory.OtherNumber, NumericValue = 2, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = true, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xB3), UnicodeCategory = UnicodeCategory.OtherNumber, NumericValue = 3, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = true, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xB4), UnicodeCategory = UnicodeCategory.ModifierSymbol, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = true, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xB5), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xB6), UnicodeCategory = UnicodeCategory.OtherPunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xB7), UnicodeCategory = UnicodeCategory.OtherPunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xB8), UnicodeCategory = UnicodeCategory.ModifierSymbol, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = true, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xB9), UnicodeCategory = UnicodeCategory.OtherNumber, NumericValue = 1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = true, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xBA), UnicodeCategory = UnicodeCategory.OtherLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xBB), UnicodeCategory = UnicodeCategory.FinalQuotePunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xBC), UnicodeCategory = UnicodeCategory.OtherNumber, NumericValue = 0.25, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = true, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xBD), UnicodeCategory = UnicodeCategory.OtherNumber, NumericValue = 0.5, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = true, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xBE), UnicodeCategory = UnicodeCategory.OtherNumber, NumericValue = 0.75, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = true, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xBF), UnicodeCategory = UnicodeCategory.OtherPunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xC0), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xC1), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xC2), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xC3), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xC4), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xC5), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xC6), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xC7), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xC8), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xC9), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xCA), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xCB), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xCC), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xCD), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xCE), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xCF), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xD0), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xD1), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xD2), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xD3), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xD4), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xD5), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xD6), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xD7), UnicodeCategory = UnicodeCategory.MathSymbol, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = true, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xD8), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xD9), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xDA), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xDB), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xDC), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xDD), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xDE), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xDF), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xE0), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xE1), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xE2), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xE3), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xE4), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xE5), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xE6), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xE7), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xE8), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xE9), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xEA), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xEB), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xEC), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xED), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xEE), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xEF), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xF0), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xF1), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xF2), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xF3), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xF4), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xF5), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xF6), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xF7), UnicodeCategory = UnicodeCategory.MathSymbol, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = true, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xF8), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xF9), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xFA), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xFB), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xFC), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xFD), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xFE), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xFF), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x80), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x81), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x82), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x83), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x84), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x85), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = true } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x86), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x87), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x88), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x89), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x8A), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x8B), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x8C), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x8D), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x8E), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x8F), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x90), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x91), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x92), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x93), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x94), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x95), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x96), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x97), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x98), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x99), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x9A), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x9B), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x9C), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x9D), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x9E), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x9F), UnicodeCategory = UnicodeCategory.Control, NumericValue = -1, IsControl = true, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xA0), UnicodeCategory = UnicodeCategory.SpaceSeparator, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = true, IsSymbol = false, IsUpper = false, IsWhiteSpace = true } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xA1), UnicodeCategory = UnicodeCategory.OtherPunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xA2), UnicodeCategory = UnicodeCategory.CurrencySymbol, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = true, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xA3), UnicodeCategory = UnicodeCategory.CurrencySymbol, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = true, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xA4), UnicodeCategory = UnicodeCategory.CurrencySymbol, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = true, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xA5), UnicodeCategory = UnicodeCategory.CurrencySymbol, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = true, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xA6), UnicodeCategory = UnicodeCategory.OtherSymbol, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = true, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xA7), UnicodeCategory = UnicodeCategory.OtherPunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xA8), UnicodeCategory = UnicodeCategory.ModifierSymbol, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = true, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xA9), UnicodeCategory = UnicodeCategory.OtherSymbol, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = true, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xAA), UnicodeCategory = UnicodeCategory.OtherLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xAB), UnicodeCategory = UnicodeCategory.InitialQuotePunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xAC), UnicodeCategory = UnicodeCategory.MathSymbol, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = true, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xAD), UnicodeCategory = UnicodeCategory.Format, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xAE), UnicodeCategory = UnicodeCategory.OtherSymbol, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = true, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xAF), UnicodeCategory = UnicodeCategory.ModifierSymbol, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = true, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xB0), UnicodeCategory = UnicodeCategory.OtherSymbol, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = true, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xB1), UnicodeCategory = UnicodeCategory.MathSymbol, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = true, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xB2), UnicodeCategory = UnicodeCategory.OtherNumber, NumericValue = 2, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = true, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xB3), UnicodeCategory = UnicodeCategory.OtherNumber, NumericValue = 3, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = true, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xB4), UnicodeCategory = UnicodeCategory.ModifierSymbol, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = true, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xB5), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xB6), UnicodeCategory = UnicodeCategory.OtherPunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xB7), UnicodeCategory = UnicodeCategory.OtherPunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xB8), UnicodeCategory = UnicodeCategory.ModifierSymbol, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = true, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xB9), UnicodeCategory = UnicodeCategory.OtherNumber, NumericValue = 1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = true, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xBA), UnicodeCategory = UnicodeCategory.OtherLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xBB), UnicodeCategory = UnicodeCategory.FinalQuotePunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xBC), UnicodeCategory = UnicodeCategory.OtherNumber, NumericValue = 0.25, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = true, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xBD), UnicodeCategory = UnicodeCategory.OtherNumber, NumericValue = 0.5, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = true, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xBE), UnicodeCategory = UnicodeCategory.OtherNumber, NumericValue = 0.75, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = true, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xBF), UnicodeCategory = UnicodeCategory.OtherPunctuation, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = true, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xC0), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xC1), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xC2), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xC3), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xC4), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xC5), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xC6), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xC7), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xC8), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xC9), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xCA), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xCB), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xCC), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xCD), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xCE), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xCF), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xD0), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xD1), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xD2), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xD3), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xD4), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xD5), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xD6), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xD7), UnicodeCategory = UnicodeCategory.MathSymbol, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = true, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xD8), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xD9), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xDA), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xDB), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xDC), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xDD), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xDE), UnicodeCategory = UnicodeCategory.UppercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = true, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xDF), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xE0), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xE1), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xE2), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xE3), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xE4), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xE5), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xE6), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xE7), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xE8), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xE9), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xEA), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xEB), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xEC), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xED), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xEE), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xEF), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xF0), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xF1), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xF2), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xF3), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xF4), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xF5), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xF6), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xF7), UnicodeCategory = UnicodeCategory.MathSymbol, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = true, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xF8), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xF9), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xFA), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xFB), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xFC), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xFD), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xFE), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xFF), UnicodeCategory = UnicodeCategory.LowercaseLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = true, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; // Select others // U+2000 EN QUAD - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x2000), UnicodeCategory = UnicodeCategory.SpaceSeparator, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = true, IsSymbol = false, IsUpper = false, IsWhiteSpace = true } }; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x2000), UnicodeCategory = UnicodeCategory.SpaceSeparator, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = true, IsSymbol = false, IsUpper = false, IsWhiteSpace = true } + ]; // U+2028 LINE SEPARATOR - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x2028), UnicodeCategory = UnicodeCategory.LineSeparator, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = true, IsSymbol = false, IsUpper = false, IsWhiteSpace = true } }; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x2028), UnicodeCategory = UnicodeCategory.LineSeparator, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = true, IsSymbol = false, IsUpper = false, IsWhiteSpace = true } + ]; // U+2029 PARAGRAPH SEPARATOR - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x2029), UnicodeCategory = UnicodeCategory.ParagraphSeparator, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = true, IsSymbol = false, IsUpper = false, IsWhiteSpace = true } }; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x2029), UnicodeCategory = UnicodeCategory.ParagraphSeparator, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = true, IsSymbol = false, IsUpper = false, IsWhiteSpace = true } + ]; // U+202F NARROW NO-BREAK SPACE - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x202F), UnicodeCategory = UnicodeCategory.SpaceSeparator, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = true, IsSymbol = false, IsUpper = false, IsWhiteSpace = true } }; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x202F), UnicodeCategory = UnicodeCategory.SpaceSeparator, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = true, IsSymbol = false, IsUpper = false, IsWhiteSpace = true } + ]; // U+2154 VULGAR FRACTION TWO THIRDS - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x2154), UnicodeCategory = UnicodeCategory.OtherNumber, NumericValue = 2.0 / 3, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = true, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x2154), UnicodeCategory = UnicodeCategory.OtherNumber, NumericValue = 2.0 / 3, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = true, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; // U+FFFD REPLACEMENT CHARACTER - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xFFFD), UnicodeCategory = UnicodeCategory.OtherSymbol, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = true, IsUpper = false, IsWhiteSpace = false } }; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0xFFFD), UnicodeCategory = UnicodeCategory.OtherSymbol, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = true, IsUpper = false, IsWhiteSpace = false } + ]; // U+10000 LINEAR B SYLLABLE B008 A - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x10000), UnicodeCategory = UnicodeCategory.OtherLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x10000), UnicodeCategory = UnicodeCategory.OtherLetter, NumericValue = -1, IsControl = false, IsDigit = false, IsLetter = true, IsLetterOrDigit = true, IsLower = false, IsNumber = false, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; // U+10110 AEGEAN NUMBER TEN - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x10110), UnicodeCategory = UnicodeCategory.OtherNumber, NumericValue = 10, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = true, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x10110), UnicodeCategory = UnicodeCategory.OtherNumber, NumericValue = 10, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = true, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; // U+10177 GREEK TWO THIRDS SIGN - yield return new object[] { new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x10177), UnicodeCategory = UnicodeCategory.OtherNumber, NumericValue = 2.0 / 3, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = true, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } }; + yield return [new UnicodeInfoTestData { ScalarValue = (CodePoint)(0x10177), UnicodeCategory = UnicodeCategory.OtherNumber, NumericValue = 2.0 / 3, IsControl = false, IsDigit = false, IsLetter = false, IsLetterOrDigit = false, IsLower = false, IsNumber = true, IsPunctuation = false, IsSeparator = false, IsSymbol = false, IsUpper = false, IsWhiteSpace = false } + ]; } public class UnicodeInfoTestData diff --git a/tests/SixLabors.Fonts.Tests/Unicode/CodePointTests.cs b/tests/SixLabors.Fonts.Tests/Unicode/CodePointTests.cs index 96b9faaf5..087c9231f 100644 --- a/tests/SixLabors.Fonts.Tests/Unicode/CodePointTests.cs +++ b/tests/SixLabors.Fonts.Tests/Unicode/CodePointTests.cs @@ -11,8 +11,8 @@ public partial class CodePointTests [MemberData(nameof(GeneralTestData_BmpCodePoints_NoSurrogates))] public static void Ctor_Cast_Char_Valid(GeneralTestData testData) { - var codePoint = new CodePoint(checked((char)testData.ScalarValue)); - var codePointFromCast = (CodePoint)(char)testData.ScalarValue; + CodePoint codePoint = new(checked((char)testData.ScalarValue)); + CodePoint codePointFromCast = (CodePoint)(char)testData.ScalarValue; Assert.Equal(codePoint, codePointFromCast); Assert.Equal(testData.ScalarValue, codePoint.Value); @@ -34,8 +34,8 @@ public static void Ctor_Cast_Char_Invalid_Throws(char value) [MemberData(nameof(GeneralTestData_SupplementaryCodePoints_ValidOnly))] public static void Ctor_Cast_Int32_Valid(GeneralTestData testData) { - var codePoint = new CodePoint(testData.ScalarValue); - var codePointFromCast = (CodePoint)testData.ScalarValue; + CodePoint codePoint = new(testData.ScalarValue); + CodePoint codePointFromCast = (CodePoint)testData.ScalarValue; Assert.Equal(codePoint, codePointFromCast); Assert.Equal(testData.ScalarValue, codePoint.Value); @@ -57,8 +57,8 @@ public static void Ctor_Cast_Int32_Invalid_Throws(int value) [MemberData(nameof(GeneralTestData_SupplementaryCodePoints_ValidOnly))] public static void Ctor_Cast_UInt32_Valid(GeneralTestData testData) { - var codePoint = new CodePoint((uint)testData.ScalarValue); - var codePointFromCast = (CodePoint)(uint)testData.ScalarValue; + CodePoint codePoint = new((uint)testData.ScalarValue); + CodePoint codePointFromCast = (CodePoint)(uint)testData.ScalarValue; Assert.Equal(codePoint, codePointFromCast); Assert.Equal(testData.ScalarValue, codePoint.Value); @@ -168,7 +168,7 @@ public void CodePointIsValid() [MemberData(nameof(GeneralTestData_SupplementaryCodePoints_ValidOnly))] public static void Utf16SequenceLengthIsCorrect(GeneralTestData testData) { - var codePoint = new CodePoint(testData.ScalarValue); + CodePoint codePoint = new(testData.ScalarValue); Assert.Equal(testData.Utf16Sequence.Length, codePoint.Utf16SequenceLength); } @@ -177,7 +177,7 @@ public static void Utf16SequenceLengthIsCorrect(GeneralTestData testData) [MemberData(nameof(GeneralTestData_SupplementaryCodePoints_ValidOnly))] public static void Utf8SequenceLengthIsCorrect(GeneralTestData testData) { - var codePoint = new CodePoint(testData.ScalarValue); + CodePoint codePoint = new(testData.ScalarValue); Assert.Equal(testData.Utf8Sequence.Length, codePoint.Utf8SequenceLength); } @@ -251,7 +251,7 @@ public void CodePointIsControl() { for (uint i = 0; i <= 0x10FFFFu; i++) { - var cp = new CodePoint(i); + CodePoint cp = new(i); if (cp.IsBmp) { Assert.Equal(CodePoint.IsControl(new CodePoint(i)), char.IsControl((char)i)); @@ -301,8 +301,8 @@ static bool IsLineBreakClassBreak(uint value) [InlineData(0x100, 0x80)] public static void Operators_And_CompareTo(uint scalarValueLeft, uint scalarValueRight) { - var left = new CodePoint(scalarValueLeft); - var right = new CodePoint(scalarValueRight); + CodePoint left = new(scalarValueLeft); + CodePoint right = new(scalarValueRight); Assert.Equal(scalarValueLeft == scalarValueRight, left == right); Assert.Equal(scalarValueLeft != scalarValueRight, left != right); diff --git a/tests/SixLabors.Fonts.Tests/Unicode/DfaTests.cs b/tests/SixLabors.Fonts.Tests/Unicode/DfaTests.cs index 8acd35c37..5bd7f5516 100644 --- a/tests/SixLabors.Fonts.Tests/Unicode/DfaTests.cs +++ b/tests/SixLabors.Fonts.Tests/Unicode/DfaTests.cs @@ -11,14 +11,14 @@ public class DfaTests public void CanCompileWithSingleLiteral() { StateMachine stateMachine = Compile.Build("a = 0; b = 1; Main = a;"); - StateMatch[] matches = stateMachine.Match(new[] { 0, 0, 1, 0 }).ToArray(); + StateMatch[] matches = stateMachine.Match([0, 0, 1, 0]).ToArray(); - var expected = new StateMatch[] - { - new StateMatch() { StartIndex = 0, EndIndex = 0 }, - new StateMatch() { StartIndex = 1, EndIndex = 1 }, - new StateMatch() { StartIndex = 3, EndIndex = 3 } - }; + StateMatch[] expected = + [ + new() { StartIndex = 0, EndIndex = 0 }, + new() { StartIndex = 1, EndIndex = 1 }, + new() { StartIndex = 3, EndIndex = 3 } + ]; Assert.True(expected.SequenceEqual(matches)); } @@ -27,13 +27,13 @@ public void CanCompileWithSingleLiteral() public void CanCompileWithConcatenation() { StateMachine stateMachine = Compile.Build("a = 0; b = 1; Main = a b;"); - StateMatch[] matches = stateMachine.Match(new[] { 0, 0, 1, 1, 0, 1, 0 }).ToArray(); + StateMatch[] matches = stateMachine.Match([0, 0, 1, 1, 0, 1, 0]).ToArray(); - var expected = new StateMatch[] - { - new StateMatch() { StartIndex = 1, EndIndex = 2 }, - new StateMatch() { StartIndex = 4, EndIndex = 5 } - }; + StateMatch[] expected = + [ + new() { StartIndex = 1, EndIndex = 2 }, + new() { StartIndex = 4, EndIndex = 5 } + ]; Assert.True(expected.SequenceEqual(matches)); } @@ -42,14 +42,14 @@ public void CanCompileWithConcatenation() public void CanCompileWithAlternation() { StateMachine stateMachine = Compile.Build("a = 0; b = 1; Main = (a b) | (b a);"); - StateMatch[] matches = stateMachine.Match(new[] { 0, 0, 1, 1, 0, 1, 0 }).ToArray(); + StateMatch[] matches = stateMachine.Match([0, 0, 1, 1, 0, 1, 0]).ToArray(); - var expected = new StateMatch[] - { - new StateMatch() { StartIndex = 1, EndIndex = 2 }, - new StateMatch() { StartIndex = 3, EndIndex = 4 }, - new StateMatch() { StartIndex = 5, EndIndex = 6 } - }; + StateMatch[] expected = + [ + new() { StartIndex = 1, EndIndex = 2 }, + new() { StartIndex = 3, EndIndex = 4 }, + new() { StartIndex = 5, EndIndex = 6 } + ]; Assert.True(expected.SequenceEqual(matches)); } @@ -58,13 +58,13 @@ public void CanCompileWithAlternation() public void CanCompileWithRepeat() { StateMachine stateMachine = Compile.Build("a = 0; b = 1; Main = (a b)+;"); - StateMatch[] matches = stateMachine.Match(new[] { 0, 0, 1, 0, 1, 1, 0, 1 }).ToArray(); + StateMatch[] matches = stateMachine.Match([0, 0, 1, 0, 1, 1, 0, 1]).ToArray(); - var expected = new StateMatch[] - { - new StateMatch() { StartIndex = 1, EndIndex = 4 }, - new StateMatch() { StartIndex = 6, EndIndex = 7 } - }; + StateMatch[] expected = + [ + new() { StartIndex = 1, EndIndex = 4 }, + new() { StartIndex = 6, EndIndex = 7 } + ]; Assert.True(expected.SequenceEqual(matches)); } @@ -73,13 +73,13 @@ public void CanCompileWithRepeat() public void CanCompileWithOptionalRepeat() { StateMachine stateMachine = Compile.Build("a = 0; b = 1; Main = b a (a b)*;"); - StateMatch[] matches = stateMachine.Match(new[] { 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0 }).ToArray(); + StateMatch[] matches = stateMachine.Match([0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0]).ToArray(); - var expected = new StateMatch[] - { - new StateMatch() { StartIndex = 2, EndIndex = 7 }, - new StateMatch() { StartIndex = 9, EndIndex = 10 } - }; + StateMatch[] expected = + [ + new() { StartIndex = 2, EndIndex = 7 }, + new() { StartIndex = 9, EndIndex = 10 } + ]; Assert.True(expected.SequenceEqual(matches)); } @@ -88,12 +88,12 @@ public void CanCompileWithOptionalRepeat() public void CanCompileWithExactRepetition() { StateMachine stateMachine = Compile.Build("a = 0; b = 1; Main = a{3} b;"); - StateMatch[] matches = stateMachine.Match(new[] { 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1 }).ToArray(); + StateMatch[] matches = stateMachine.Match([0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1]).ToArray(); - var expected = new StateMatch[] - { - new StateMatch() { StartIndex = 3, EndIndex = 6 } - }; + StateMatch[] expected = + [ + new() { StartIndex = 3, EndIndex = 6 } + ]; Assert.True(expected.SequenceEqual(matches)); } @@ -102,13 +102,13 @@ public void CanCompileWithExactRepetition() public void CanCompileWithMinimumRepetition() { StateMachine stateMachine = Compile.Build("a = 0; b = 1; Main = a{3,} b;"); - StateMatch[] matches = stateMachine.Match(new[] { 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1 }).ToArray(); + StateMatch[] matches = stateMachine.Match([0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1]).ToArray(); - var expected = new StateMatch[] - { - new StateMatch() { StartIndex = 3, EndIndex = 6 }, - new StateMatch() { StartIndex = 7, EndIndex = 11 } - }; + StateMatch[] expected = + [ + new() { StartIndex = 3, EndIndex = 6 }, + new() { StartIndex = 7, EndIndex = 11 } + ]; Assert.True(expected.SequenceEqual(matches)); } @@ -117,15 +117,15 @@ public void CanCompileWithMinimumRepetition() public void CanCompileWithMaximumRepetition() { StateMachine stateMachine = Compile.Build("a = 0; b = 1; Main = a{,3} b;"); - StateMatch[] matches = stateMachine.Match(new[] { 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1 }).ToArray(); + StateMatch[] matches = stateMachine.Match([0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1]).ToArray(); - var expected = new StateMatch[] - { - new StateMatch() { StartIndex = 0, EndIndex = 2 }, - new StateMatch() { StartIndex = 3, EndIndex = 6 }, - new StateMatch() { StartIndex = 10, EndIndex = 11 }, - new StateMatch() { StartIndex = 12, EndIndex = 12 } - }; + StateMatch[] expected = + [ + new() { StartIndex = 0, EndIndex = 2 }, + new() { StartIndex = 3, EndIndex = 6 }, + new() { StartIndex = 10, EndIndex = 11 }, + new() { StartIndex = 12, EndIndex = 12 } + ]; Assert.True(expected.SequenceEqual(matches)); } @@ -134,13 +134,13 @@ public void CanCompileWithMaximumRepetition() public void CanCompileWithMinimumAndMaximumRepetition() { StateMachine stateMachine = Compile.Build("a = 0; b = 1; Main = a{3,5} b;"); - StateMatch[] matches = stateMachine.Match(new[] { 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1 }).ToArray(); + StateMatch[] matches = stateMachine.Match([0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1]).ToArray(); - var expected = new StateMatch[] - { - new StateMatch() { StartIndex = 3, EndIndex = 6 }, - new StateMatch() { StartIndex = 7, EndIndex = 11 } - }; + StateMatch[] expected = + [ + new() { StartIndex = 3, EndIndex = 6 }, + new() { StartIndex = 7, EndIndex = 11 } + ]; Assert.True(expected.SequenceEqual(matches)); } @@ -150,20 +150,20 @@ public void CanCompileWithTags() { StateMachine stateMachine = Compile.Build("a = 0; b = 1; Main = x:(b a) | y:(a b);"); - int[] input = { 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0 }; - StateMatch[] matches = stateMachine.Match(new[] { 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0 }).ToArray(); + int[] input = [1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0]; + StateMatch[] matches = stateMachine.Match([1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0]).ToArray(); - var expected = new StateMatch[] - { - new StateMatch() { StartIndex = 2, EndIndex = 3, Tags = new string[] { "x" } }, - new StateMatch() { StartIndex = 4, EndIndex = 5, Tags = new string[] { "y" } }, - new StateMatch() { StartIndex = 6, EndIndex = 7, Tags = new string[] { "y" } }, - new StateMatch() { StartIndex = 9, EndIndex = 10, Tags = new string[] { "x" } }, - }; + StateMatch[] expected = + [ + new() { StartIndex = 2, EndIndex = 3, Tags = new string[] { "x" } }, + new() { StartIndex = 4, EndIndex = 5, Tags = new string[] { "y" } }, + new() { StartIndex = 6, EndIndex = 7, Tags = new string[] { "y" } }, + new() { StartIndex = 9, EndIndex = 10, Tags = new string[] { "x" } } + ]; Assert.True(expected.SequenceEqual(matches)); - List<(string Tag, int Start, int End, ArraySlice Slice)> applied = new(); + List<(string Tag, int Start, int End, ArraySlice Slice)> applied = []; Dictionary>> actions = new() { { "x", (start, end, slice) => applied.Add(("x", start, end, slice)) }, @@ -174,13 +174,13 @@ public void CanCompileWithTags() Assert.True(applied.Count == 4); - List<(string Tag, int Start, int End, ArraySlice Slice)> expectedApply = new() - { + List<(string Tag, int Start, int End, ArraySlice Slice)> expectedApply = + [ ("x", 2, 3, new int[] { 1, 0 }), ("y", 4, 5, new int[] { 0, 1 }), ("y", 6, 7, new int[] { 0, 1 }), - ("x", 9, 10, new int[] { 1, 0 }), - }; + ("x", 9, 10, new int[] { 1, 0 }) + ]; for (int i = 0; i < expectedApply.Count; i++) { @@ -197,16 +197,16 @@ public void CanCompileWithTags() [Fact] public void CanCompileWithExternalSymbols() { - var externalSymbols = new Dictionary() { { "a", 0 }, { "b", 1 } }; + Dictionary externalSymbols = new() { { "a", 0 }, { "b", 1 } }; StateMachine stateMachine = Compile.Build("Main = a b;", externalSymbols); - int[] input = { 0, 0, 1, 1, 0, 1, 0 }; + int[] input = [0, 0, 1, 1, 0, 1, 0]; StateMatch[] matches = stateMachine.Match(input).ToArray(); - var expected = new StateMatch[] - { - new StateMatch() { StartIndex = 1, EndIndex = 2 }, - new StateMatch() { StartIndex = 4, EndIndex = 5 }, - }; + StateMatch[] expected = + [ + new() { StartIndex = 1, EndIndex = 2 }, + new() { StartIndex = 4, EndIndex = 5 } + ]; Assert.True(expected.SequenceEqual(matches)); } diff --git a/tests/SixLabors.Fonts.Tests/Unicode/GraphemeEnumeratorTests.cs b/tests/SixLabors.Fonts.Tests/Unicode/GraphemeEnumeratorTests.cs index b4f50c9a3..fd6a3dfde 100644 --- a/tests/SixLabors.Fonts.Tests/Unicode/GraphemeEnumeratorTests.cs +++ b/tests/SixLabors.Fonts.Tests/Unicode/GraphemeEnumeratorTests.cs @@ -110,7 +110,7 @@ public bool ICUTestsImpl() string[] lines = File.ReadAllLines(Path.Combine(TestEnvironment.UnicodeTestDataFullPath, "GraphemeBreakTest.txt")); // Process each line - var tests = new List(); + List tests = []; for (int lineNumber = 1; lineNumber < lines.Length + 1; lineNumber++) { // Get the line, remove comments @@ -122,8 +122,8 @@ public bool ICUTestsImpl() continue; } - var codePoints = new List(); - var breakPoints = new List(); + List codePoints = []; + List breakPoints = []; // Parse the test int p = 0; @@ -164,7 +164,7 @@ public bool ICUTestsImpl() tests.Add(new Test(lineNumber, codePoints.ToArray(), breakPoints.ToArray())); } - var foundBreaks = new List + List foundBreaks = new() { Capacity = 100 }; diff --git a/tests/SixLabors.Fonts.Tests/Unicode/LineBreakEnumeratorTests.cs b/tests/SixLabors.Fonts.Tests/Unicode/LineBreakEnumeratorTests.cs index c013797a9..fa57f6915 100644 --- a/tests/SixLabors.Fonts.Tests/Unicode/LineBreakEnumeratorTests.cs +++ b/tests/SixLabors.Fonts.Tests/Unicode/LineBreakEnumeratorTests.cs @@ -17,7 +17,7 @@ public class LineBreakEnumeratorTests [Fact] public void BasicLatinTest() { - var lineBreaker = new LineBreakEnumerator("Hello World\r\nThis is a test.".AsSpan()); + LineBreakEnumerator lineBreaker = new("Hello World\r\nThis is a test.".AsSpan()); Assert.True(lineBreaker.MoveNext()); Assert.Equal(6, lineBreaker.Current.PositionWrap); @@ -51,7 +51,7 @@ public void NumericTests() { const string text1 = "Super Smash Bros (1999)"; const string text2 = "Super, Smash Bros (1999)"; - List breaks1 = new(); + List breaks1 = []; foreach (LineBreak lineBreak in new LineBreakEnumerator(text1.AsSpan())) { @@ -67,7 +67,7 @@ public void NumericTests() Assert.Equal(23, breaks1[3].PositionMeasure); Assert.Equal(23, breaks1[3].PositionWrap); - List breaks2 = new(); + List breaks2 = []; foreach (LineBreak lineBreak in new LineBreakEnumerator(text2.AsSpan())) { breaks2.Add(lineBreak); @@ -87,7 +87,7 @@ public void NumericTests() public void ForwardTextWithOuterWhitespace() { string text = " Apples Pears Bananas "; - var breaks = new List(); + List breaks = []; foreach (LineBreak lineBreak in new LineBreakEnumerator(text.AsSpan())) { @@ -108,7 +108,7 @@ public void ForwardTextWithOuterWhitespace() public void ForwardTest() { string text = "Apples Pears Bananas"; - var breaks = new List(); + List breaks = []; foreach (LineBreak lineBreak in new LineBreakEnumerator(text.AsSpan())) { @@ -137,7 +137,7 @@ public bool ICUTestsImpl() string[] lines = File.ReadAllLines(Path.Combine(TestEnvironment.UnicodeTestDataFullPath, "LineBreakTest.txt")); // Process each line - var tests = new List(); + List tests = []; for (int lineNumber = 1; lineNumber < lines.Length + 1; lineNumber++) { // Get the line, remove comments @@ -149,8 +149,8 @@ public bool ICUTestsImpl() continue; } - var codePoints = new List(); - var breakPoints = new List(); + List codePoints = []; + List breakPoints = []; // Parse the test int p = 0; @@ -188,11 +188,11 @@ public bool ICUTestsImpl() } // Create test - var test = new Test(lineNumber, codePoints.ToArray(), breakPoints.ToArray()); + Test test = new(lineNumber, codePoints.ToArray(), breakPoints.ToArray()); tests.Add(test); } - var foundBreaks = new List(); + List foundBreaks = []; for (int testNumber = 0; testNumber < tests.Count; testNumber++) { @@ -203,7 +203,7 @@ public bool ICUTestsImpl() // Run the line breaker and build a list of break points string text = Encoding.UTF32.GetString(MemoryMarshal.Cast(t.CodePoints).ToArray()); - var enumerator = new LineBreakEnumerator(text.AsSpan()); + LineBreakEnumerator enumerator = new(text.AsSpan()); while (enumerator.MoveNext()) { foundBreaks.Add(enumerator.Current.PositionWrap); diff --git a/tests/SixLabors.Fonts.Tests/Unicode/UnicodeTrieBuilderTests.cs b/tests/SixLabors.Fonts.Tests/Unicode/UnicodeTrieBuilderTests.cs index aca9c65d2..d3d0ce00c 100644 --- a/tests/SixLabors.Fonts.Tests/Unicode/UnicodeTrieBuilderTests.cs +++ b/tests/SixLabors.Fonts.Tests/Unicode/UnicodeTrieBuilderTests.cs @@ -11,140 +11,140 @@ namespace SixLabors.Fonts.Tests.Unicode; /// public class UnicodeTrieBuilderTests { - private static readonly TestRange[] TestRanges1 = new TestRange[] - { - new TestRange(0, 0, 0, false), - new TestRange(0, 0x40, 0, false), - new TestRange(0x40, 0xe7, 0x1234, false), - new TestRange(0xe7, 0x3400, 0, false), - new TestRange(0x3400, 0x9fa6, 0x6162, false), - new TestRange(0x9fa6, 0xda9e, 0x3132, false), - new TestRange(0xdada, 0xeeee, 0x87ff, false), - new TestRange(0xeeee, 0x11111, 1, false), - new TestRange(0x11111, 0x44444, 0x6162, false), - new TestRange(0x44444, 0x60003, 0, false), - new TestRange(0xf0003, 0xf0004, 0xf, false), - new TestRange(0xf0004, 0xf0006, 0x10, false), - new TestRange(0xf0006, 0xf0007, 0x11, false), - new TestRange(0xf0007, 0xf0040, 0x12, false), - new TestRange(0xf0040, 0x110000, 0, false) - }; - - private static readonly CheckValue[] CheckValues1 = new CheckValue[] - { - new CheckValue(0, 0), - new CheckValue(0x40, 0), - new CheckValue(0xe7, 0x1234), - new CheckValue(0x3400, 0), - new CheckValue(0x9fa6, 0x6162), - new CheckValue(0xda9e, 0x3132), - new CheckValue(0xdada, 0), - new CheckValue(0xeeee, 0x87ff), - new CheckValue(0x11111, 1), - new CheckValue(0x44444, 0x6162), - new CheckValue(0xf0003, 0), - new CheckValue(0xf0004, 0xf), - new CheckValue(0xf0006, 0x10), - new CheckValue(0xf0007, 0x11), - new CheckValue(0xf0040, 0x12), - new CheckValue(0x110000, 0), - }; - - private static readonly TestRange[] TestRanges2 = new TestRange[] - { - new TestRange(0, 0, 0, false), - new TestRange(0x21, 0x7f, 0x5555, true), - new TestRange(0x2f800, 0x2fedc, 0x7a, true), - new TestRange(0x72, 0xdd, 3, true), - new TestRange(0xdd, 0xde, 4, false), - new TestRange(0x201, 0x240, 6, true), // 3 consecutive blocks with the same pattern but - new TestRange(0x241, 0x280, 6, true), // discontiguous value ranges, testing utrie2_enum() - new TestRange(0x281, 0x2c0, 6, true), - new TestRange(0x2f987, 0x2fa98, 5, true), - new TestRange(0x2f777, 0x2f883, 0, true), - new TestRange(0x2f900, 0x2ffaa, 1, false), - new TestRange(0x2ffaa, 0x2ffab, 2, true), - new TestRange(0x2ffbb, 0x2ffc0, 7, true), - }; - - private static readonly CheckValue[] CheckValues2 = new CheckValue[] - { - new CheckValue(0, 0), - new CheckValue(0x21, 0), - new CheckValue(0x72, 0x5555), - new CheckValue(0xdd, 3), - new CheckValue(0xde, 4), - new CheckValue(0x201, 0), - new CheckValue(0x240, 6), - new CheckValue(0x241, 0), - new CheckValue(0x280, 6), - new CheckValue(0x281, 0), - new CheckValue(0x2c0, 6), - new CheckValue(0x2f883, 0), - new CheckValue(0x2f987, 0x7a), - new CheckValue(0x2fa98, 5), - new CheckValue(0x2fedc, 0x7a), - new CheckValue(0x2ffaa, 1), - new CheckValue(0x2ffab, 2), - new CheckValue(0x2ffbb, 0), - new CheckValue(0x2ffc0, 7), - new CheckValue(0x110000, 0), - }; - - private static readonly TestRange[] TestRanges3 = new TestRange[] - { - new TestRange(0, 0, 9, false), // non-zero initial value. - new TestRange(0x31, 0xa4, 1, false), - new TestRange(0x3400, 0x6789, 2, false), - new TestRange(0x8000, 0x89ab, 9, true), - new TestRange(0x9000, 0xa000, 4, true), - new TestRange(0xabcd, 0xbcde, 3, true), - new TestRange(0x55555, 0x110000, 6, true), // highStart TestData() { - yield return new object[] { TestRanges1, CheckValues1 }; - yield return new object[] { TestRanges2, CheckValues2 }; - yield return new object[] { TestRanges3, CheckValues3 }; - yield return new object[] { TestRanges4, CheckValues4 }; - yield return new object[] { TestRanges5, CheckValues5 }; + yield return [TestRanges1, CheckValues1]; + yield return [TestRanges2, CheckValues2]; + yield return [TestRanges3, CheckValues3]; + yield return [TestRanges4, CheckValues4]; + yield return [TestRanges5, CheckValues5]; } [Theory] @@ -255,7 +255,7 @@ public void RunRangeChecks(TestRange[] testRanges, CheckValue[] checkValues) uint initialValue = testRanges[0].Value; const uint errorValue = 0x0bad; - var builder = new UnicodeTrieBuilder(initialValue, errorValue); + UnicodeTrieBuilder builder = new(initialValue, errorValue); for (int i = 1; i < testRanges.Length; i++) { TestRange r = testRanges[i]; diff --git a/tests/SixLabors.Fonts.Tests/WriterExtensions.cs b/tests/SixLabors.Fonts.Tests/WriterExtensions.cs index 1d94b0411..9b1e727f7 100644 --- a/tests/SixLabors.Fonts.Tests/WriterExtensions.cs +++ b/tests/SixLabors.Fonts.Tests/WriterExtensions.cs @@ -139,7 +139,7 @@ public static void WriteNameTable(this BigEndianBinaryWriter writer, List<(Known // Offset16 | offset | String offset from start of storage area(in bytes). Encoding encoding = Encoding.BigEndianUnicode; // this is Unicode2 int stringOffset = 0; - var offsets = new List(); + List offsets = []; foreach ((KnownNameIds name, string value, CultureInfo culture) in names) { writer.WriteUInt16((ushort)PlatformIDs.Windows); // hard code platform @@ -477,7 +477,7 @@ public static void WriteHeadTable(this BigEndianBinaryWriter writer, HeadTable t writer.WriteUInt16((ushort)table.Flags); writer.WriteUInt16(table.UnitsPerEm); - var startDate = new DateTime(1904, 01, 01, 0, 0, 0, DateTimeKind.Utc); + DateTime startDate = new(1904, 01, 01, 0, 0, 0, DateTimeKind.Utc); writer.WriteInt64((long)table.Created.Subtract(startDate).TotalSeconds); writer.WriteInt64((long)table.Modified.Subtract(startDate).TotalSeconds); writer.WriteInt16((short)table.Bounds.Min.X); @@ -565,7 +565,7 @@ public static void WriteVerticalHeadTable(this BigEndianBinaryWriter writer, Ver public static void WriteColrTable(this BigEndianBinaryWriter writer, ColrGlyphRecord[] data) { - var formatted = data.ToList(); + List formatted = data.ToList(); // Type | Name | Description // ----------|------------------------|---------------------------------------------------------------------------------------------------- @@ -609,7 +609,7 @@ public class ColrGlyphRecord { public ushort Glyph { get; set; } - public List Layers { get; set; } = new List(); + public List Layers { get; set; } = []; public int HeaderSize => 6;