Skip to content

Commit 81bbe24

Browse files
Fix compiler warning CA1304 for API consumers.
1 parent 3206542 commit 81bbe24

File tree

8 files changed

+38
-38
lines changed

8 files changed

+38
-38
lines changed

src/SixLabors.Fonts/FontCollection.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,11 @@ public IEnumerable<FontFamily> AddCollection(Stream stream, out IEnumerable<Font
7878

7979
/// <inheritdoc/>
8080
public FontFamily Get(string name)
81-
=> this.Get(name, CultureInfo.InvariantCulture);
81+
=> this.GetByCulture(name, CultureInfo.InvariantCulture);
8282

8383
/// <inheritdoc/>
8484
public bool TryGet(string name, out FontFamily family)
85-
=> this.TryGet(name, CultureInfo.InvariantCulture, out family);
85+
=> this.TryGetByCulture(name, CultureInfo.InvariantCulture, out family);
8686

8787
/// <inheritdoc/>
8888
public FontFamily Add(string path, CultureInfo culture)
@@ -127,11 +127,11 @@ public IEnumerable<FontFamily> GetByCulture(CultureInfo culture)
127127
=> this.FamiliesByCultureImpl(culture);
128128

129129
/// <inheritdoc/>
130-
public FontFamily Get(string name, CultureInfo culture)
130+
public FontFamily GetByCulture(string name, CultureInfo culture)
131131
=> this.GetImpl(name, culture);
132132

133133
/// <inheritdoc/>
134-
public bool TryGet(string name, CultureInfo culture, out FontFamily family)
134+
public bool TryGetByCulture(string name, CultureInfo culture, out FontFamily family)
135135
=> this.TryGetImpl(name, culture, out family);
136136

137137
/// <inheritdoc/>

src/SixLabors.Fonts/IFontMetricsCollection.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ internal interface IFontMetricsCollection : IReadOnlyFontMetricsCollection
1616
/// <param name="metrics">The font metrics to add.</param>
1717
/// <param name="culture">The culture of the font metrics to add.</param>
1818
/// <returns>The new <see cref="FontFamily"/>.</returns>
19-
FontFamily AddMetrics(FontMetrics metrics, CultureInfo culture);
19+
public FontFamily AddMetrics(FontMetrics metrics, CultureInfo culture);
2020

2121
/// <summary>
2222
/// Adds the font metrics to the <see cref="IFontMetricsCollection"/>.
2323
/// </summary>
2424
/// <param name="metrics">The font metrics to add.</param>
25-
void AddMetrics(FontMetrics metrics);
25+
public void AddMetrics(FontMetrics metrics);
2626
}

src/SixLabors.Fonts/IGlyphShapingCollection.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,38 +13,38 @@ internal interface IGlyphShapingCollection
1313
/// <summary>
1414
/// Gets the collection count.
1515
/// </summary>
16-
int Count { get; }
16+
public int Count { get; }
1717

1818
/// <summary>
1919
/// Gets the text options used by this collection.
2020
/// </summary>
21-
TextOptions TextOptions { get; }
21+
public TextOptions TextOptions { get; }
2222

2323
/// <summary>
2424
/// Gets the glyph shaping data at the specified index.
2525
/// </summary>
2626
/// <param name="index">The zero-based index of the elements to get.</param>
2727
/// <returns>The <see cref="GlyphShapingData"/>.</returns>
28-
GlyphShapingData this[int index] { get; }
28+
public GlyphShapingData this[int index] { get; }
2929

3030
/// <summary>
3131
/// Adds the shaping feature to the collection which should be applied to the glyph at a specified index.
3232
/// </summary>
3333
/// <param name="index">The zero-based index of the element.</param>
3434
/// <param name="feature">The feature to apply.</param>
35-
void AddShapingFeature(int index, TagEntry feature);
35+
public void AddShapingFeature(int index, TagEntry feature);
3636

3737
/// <summary>
3838
/// Enables a previously added shaping feature.
3939
/// </summary>
4040
/// <param name="index">The zero-based index of the element.</param>
4141
/// <param name="feature">The feature to enable.</param>
42-
void EnableShapingFeature(int index, Tag feature);
42+
public void EnableShapingFeature(int index, Tag feature);
4343

4444
/// <summary>
4545
/// Disables a previously added shaping feature.
4646
/// </summary>
4747
/// <param name="index">The zero-based index of the element.</param>
4848
/// <param name="feature">The feature to disable.</param>
49-
void DisableShapingFeature(int index, Tag feature);
49+
public void DisableShapingFeature(int index, Tag feature);
5050
}

src/SixLabors.Fonts/IReadonlyFontCollection.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public interface IReadOnlyFontCollection
1414
/// Gets the collection of <see cref="FontFamily"/> in this <see cref="IReadOnlyFontCollection"/>
1515
/// using the invariant culture.
1616
/// </summary>
17-
IEnumerable<FontFamily> Families { get; }
17+
public IEnumerable<FontFamily> Families { get; }
1818

1919
/// <summary>
2020
/// Gets the specified font family matching the invariant culture and font family name.
@@ -23,7 +23,7 @@ public interface IReadOnlyFontCollection
2323
/// <returns>The first <see cref="FontFamily"/> matching the given name.</returns>
2424
/// <exception cref="ArgumentNullException"><paramref name="name"/> is <see langword="null"/></exception>
2525
/// <exception cref="FontFamilyNotFoundException">The collection contains no matches.</exception>
26-
FontFamily Get(string name);
26+
public FontFamily Get(string name);
2727

2828
/// <summary>
2929
/// Gets the specified font family matching the invariant culture and font family name.
@@ -39,15 +39,15 @@ public interface IReadOnlyFontCollection
3939
/// with the specified name; otherwise, <see langword="false"/>.
4040
/// </returns>
4141
/// <exception cref="ArgumentNullException"><paramref name="name"/> is <see langword="null"/></exception>
42-
bool TryGet(string name, out FontFamily family);
42+
public bool TryGet(string name, out FontFamily family);
4343

4444
/// <summary>
4545
/// Gets the collection of <see cref="FontFamily"/> in this <see cref="FontCollection"/>
4646
/// using the given culture.
4747
/// </summary>
4848
/// <param name="culture">The culture of the families to return.</param>
4949
/// <returns>The <see cref="IEnumerable{FontFamily}"/>.</returns>
50-
IEnumerable<FontFamily> GetByCulture(CultureInfo culture);
50+
public IEnumerable<FontFamily> GetByCulture(CultureInfo culture);
5151

5252
/// <summary>
5353
/// Gets the specified font family matching the given culture and font family name.
@@ -57,7 +57,7 @@ public interface IReadOnlyFontCollection
5757
/// <returns>The first <see cref="FontFamily"/> matching the given name.</returns>
5858
/// <exception cref="ArgumentNullException"><paramref name="name"/> is <see langword="null"/></exception>
5959
/// <exception cref="FontFamilyNotFoundException">The collection contains no matches.</exception>
60-
FontFamily Get(string name, CultureInfo culture);
60+
public FontFamily GetByCulture(string name, CultureInfo culture);
6161

6262
/// <summary>
6363
/// Gets the specified font family matching the given culture and font family name.
@@ -74,5 +74,5 @@ public interface IReadOnlyFontCollection
7474
/// with the specified name; otherwise, <see langword="false"/>.
7575
/// </returns>
7676
/// <exception cref="ArgumentNullException"><paramref name="name"/> is <see langword="null"/></exception>
77-
bool TryGet(string name, CultureInfo culture, out FontFamily family);
77+
public bool TryGetByCulture(string name, CultureInfo culture, out FontFamily family);
7878
}

src/SixLabors.Fonts/IReadonlyFontMetricsCollection.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ internal interface IReadOnlyFontMetricsCollection
2828
/// with the specified name; otherwise, <see langword="false"/>.
2929
/// </returns>
3030
/// <exception cref="ArgumentNullException"><paramref name="name"/> is <see langword="null"/></exception>
31-
bool TryGetMetrics(string name, CultureInfo culture, FontStyle style, [NotNullWhen(true)] out FontMetrics? metrics);
31+
public bool TryGetMetrics(string name, CultureInfo culture, FontStyle style, [NotNullWhen(true)] out FontMetrics? metrics);
3232

3333
/// <summary>
3434
/// Gets the collection of available font metrics for a given culture and font family name.
@@ -37,7 +37,7 @@ internal interface IReadOnlyFontMetricsCollection
3737
/// <param name="culture">The culture to use when searching for a match.</param>
3838
/// <returns>The <see cref="IEnumerable{FontMetrics}"/>.</returns>
3939
/// <exception cref="ArgumentNullException"><paramref name="name"/> is <see langword="null"/></exception>
40-
IEnumerable<FontMetrics> GetAllMetrics(string name, CultureInfo culture);
40+
public IEnumerable<FontMetrics> GetAllMetrics(string name, CultureInfo culture);
4141

4242
/// <summary>
4343
/// Gets the collection of available font styles for a given culture and font family name.
@@ -46,8 +46,8 @@ internal interface IReadOnlyFontMetricsCollection
4646
/// <param name="culture">The culture to use when searching for a match.</param>
4747
/// <returns>The <see cref="IEnumerable{FontStyle}"/>.</returns>
4848
/// <exception cref="ArgumentNullException"><paramref name="name"/> is <see langword="null"/></exception>
49-
IEnumerable<FontStyle> GetAllStyles(string name, CultureInfo culture);
49+
public IEnumerable<FontStyle> GetAllStyles(string name, CultureInfo culture);
5050

5151
/// <inheritdoc cref="IEnumerable{T}.GetEnumerator"/>
52-
IEnumerator<FontMetrics> GetEnumerator();
52+
public IEnumerator<FontMetrics> GetEnumerator();
5353
}

src/SixLabors.Fonts/SystemFontCollection.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public SystemFontCollection()
108108
public IEnumerable<string> SearchDirectories => this.searchDirectories;
109109

110110
/// <inheritdoc/>
111-
public FontFamily Get(string name) => this.Get(name, CultureInfo.InvariantCulture);
111+
public FontFamily Get(string name) => this.GetByCulture(name, CultureInfo.InvariantCulture);
112112

113113
/// <inheritdoc/>
114114
public bool TryGet(string name, out FontFamily family)
@@ -119,12 +119,12 @@ public IEnumerable<FontFamily> GetByCulture(CultureInfo culture)
119119
=> this.collection.GetByCulture(culture);
120120

121121
/// <inheritdoc/>
122-
public FontFamily Get(string name, CultureInfo culture)
123-
=> this.collection.Get(name, culture);
122+
public FontFamily GetByCulture(string name, CultureInfo culture)
123+
=> this.collection.GetByCulture(name, culture);
124124

125125
/// <inheritdoc/>
126-
public bool TryGet(string name, CultureInfo culture, out FontFamily family)
127-
=> this.collection.TryGet(name, culture, out family);
126+
public bool TryGetByCulture(string name, CultureInfo culture, out FontFamily family)
127+
=> this.collection.TryGetByCulture(name, culture, out family);
128128

129129
/// <inheritdoc/>
130130
bool IReadOnlyFontMetricsCollection.TryGetMetrics(string name, CultureInfo culture, FontStyle style, [NotNullWhen(true)] out FontMetrics? metrics)

src/SixLabors.Fonts/SystemFonts.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public static class SystemFonts
2323
public static IEnumerable<FontFamily> Families => Collection.Families;
2424

2525
/// <inheritdoc cref="IReadOnlyFontCollection.Get(string)"/>
26-
public static FontFamily Get(string name) => Get(name, CultureInfo.InvariantCulture);
26+
public static FontFamily Get(string name) => GetByCulture(name, CultureInfo.InvariantCulture);
2727

2828
/// <inheritdoc cref="IReadOnlyFontCollection.TryGet(string, out FontFamily)" />
2929
public static bool TryGet(string fontFamily, out FontFamily family)
@@ -52,13 +52,13 @@ public static Font CreateFont(string name, float size, FontStyle style)
5252
public static IEnumerable<FontFamily> GetByCulture(CultureInfo culture)
5353
=> Collection.GetByCulture(culture);
5454

55-
/// <inheritdoc cref="IReadOnlyFontCollection.Get(string, CultureInfo)" />
56-
public static FontFamily Get(string fontFamily, CultureInfo culture)
57-
=> Collection.Get(fontFamily, culture);
55+
/// <inheritdoc cref="IReadOnlyFontCollection.GetByCulture(string, CultureInfo)" />
56+
public static FontFamily GetByCulture(string fontFamily, CultureInfo culture)
57+
=> Collection.GetByCulture(fontFamily, culture);
5858

59-
/// <inheritdoc cref="IReadOnlyFontCollection.TryGet(string, CultureInfo, out FontFamily)" />
60-
public static bool TryGet(string fontFamily, CultureInfo culture, out FontFamily family)
61-
=> Collection.TryGet(fontFamily, culture, out family);
59+
/// <inheritdoc cref="IReadOnlyFontCollection.TryGetByCulture(string, CultureInfo, out FontFamily)" />
60+
public static bool TryGetByCulture(string fontFamily, CultureInfo culture, out FontFamily family)
61+
=> Collection.TryGetByCulture(fontFamily, culture, out family);
6262

6363
/// <summary>
6464
/// Create a new instance of the <see cref="Font"/> for the named font family with regular styling.
@@ -68,7 +68,7 @@ public static bool TryGet(string fontFamily, CultureInfo culture, out FontFamily
6868
/// <param name="size">The size of the font in PT units.</param>
6969
/// <returns>The new <see cref="Font"/>.</returns>
7070
public static Font CreateFont(string name, CultureInfo culture, float size)
71-
=> Collection.Get(name, culture).CreateFont(size);
71+
=> Collection.GetByCulture(name, culture).CreateFont(size);
7272

7373
/// <summary>
7474
/// Create a new instance of the <see cref="Font"/> for the named font family.
@@ -79,5 +79,5 @@ public static Font CreateFont(string name, CultureInfo culture, float size)
7979
/// <param name="style">The font style.</param>
8080
/// <returns>The new <see cref="Font"/>.</returns>
8181
public static Font CreateFont(string name, CultureInfo culture, float size, FontStyle style)
82-
=> Collection.Get(name, culture).CreateFont(size, style);
82+
=> Collection.GetByCulture(name, culture).CreateFont(size, style);
8383
}

tests/SixLabors.Fonts.Tests/SystemFontCollectionTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ public void SystemFonts_CanGetFont_ByCulture()
3434
FontFamily family = SystemFonts.Families.First();
3535

3636
Assert.False(family == default);
37-
Assert.Equal(family, SystemFonts.Get(family.Name, family.Culture));
37+
Assert.Equal(family, SystemFonts.GetByCulture(family.Name, family.Culture));
3838

39-
SystemFonts.TryGet(family.Name, family.Culture, out FontFamily family2);
39+
SystemFonts.TryGetByCulture(family.Name, family.Culture, out FontFamily family2);
4040

4141
Assert.Equal(family, family2);
4242
Assert.Contains(family, SystemFonts.GetByCulture(family.Culture));

0 commit comments

Comments
 (0)