Skip to content

Commit

Permalink
(#63) Type naming and visibility fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ForNeVeR committed Jan 16, 2023
1 parent e52f296 commit fdd7b54
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions src/WpfMath.Shared/CharInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace WpfMath
/// <summary>Single character together with information about font and metrics.</summary>
public class CharInfo
{
public CharInfo(char character, IFontTypeface font, double size, int fontId, TexFontMetrics metrics)
public CharInfo(char character, IFontTypeface font, double size, int fontId, TeXFontMetrics metrics)
{
this.Character = character;
Font = font;
Expand All @@ -31,7 +31,7 @@ public double Size
set;
}

public TexFontMetrics Metrics
public TeXFontMetrics Metrics
{
get;
set;
Expand Down
4 changes: 2 additions & 2 deletions src/WpfMath.Shared/DefaultTexFont.cs
Original file line number Diff line number Diff line change
Expand Up @@ -328,11 +328,11 @@ public double GetDefaultLineThickness(TexStyle style)
return GetParameter("defaultrulethickness") * GetSizeFactor(style) * TexFontUtilities.PixelsPerPoint;
}

private Result<TexFontMetrics> GetMetrics(CharFont charFont, double size)
private Result<TeXFontMetrics> GetMetrics(CharFont charFont, double size)
{
var fontInfo = fontInfoList[charFont.FontId];
var metrics = fontInfo.GetMetrics(charFont.Character);
return metrics.Map(m => new TexFontMetrics(
return metrics.Map(m => new TeXFontMetrics(
m[TexFontUtilities.MetricsWidth],
m[TexFontUtilities.MetricsHeight],
m[TexFontUtilities.MetricsDepth],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
namespace WpfMath
{
// Specifies font metrics for single character.
public class TexFontMetrics
/// <summary>Specifies font metrics for single character.</summary>
public class TeXFontMetrics
{
public TexFontMetrics(double width, double height, double depth, double italicWidth, double scale)
public TeXFontMetrics(double width, double height, double depth, double italicWidth, double scale)
{
this.Width = width * scale;
this.Height = height * scale;
Expand Down
10 changes: 5 additions & 5 deletions src/WpfMath/Fonts/WpfSystemFont.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@

namespace WpfMath.Fonts;

internal class SystemFont : ITeXFont
internal class WpfSystemFont : ITeXFont
{
private readonly FontFamily fontFamily;
private readonly Lazy<Typeface> _typeface;

public SystemFont(double size, FontFamily fontFamily)
public WpfSystemFont(double size, FontFamily fontFamily)
{
this.fontFamily = fontFamily;
Size = size;
Expand Down Expand Up @@ -115,10 +115,10 @@ public Result<CharInfo> GetCharInfo(string name, TexStyle style) =>
private static TexNotSupportedException MethodNotSupported(string callerMethod)
{
return new TexNotSupportedException(
$"Call of method {callerMethod} on {nameof(SystemFont)} is not supported");
$"Call of method {callerMethod} on {nameof(WpfSystemFont)} is not supported");
}

private TexFontMetrics GetFontMetrics(char c, Typeface typeface)
private TeXFontMetrics GetFontMetrics(char c, Typeface typeface)
{
var formattedText = new FormattedText(c.ToString(),
CultureInfo.CurrentUICulture,
Expand All @@ -130,6 +130,6 @@ private TexFontMetrics GetFontMetrics(char c, Typeface typeface)
, 1
#endif
);
return new TexFontMetrics(formattedText.Width, formattedText.Height, 0.0, formattedText.Width, 1.0);
return new TeXFontMetrics(formattedText.Width, formattedText.Height, 0.0, formattedText.Width, 1.0);
}
}
4 changes: 2 additions & 2 deletions src/WpfMath/Rendering/WpfBrush.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace WpfMath.Rendering;

internal record WpfBrush : GenericBrush<Brush>
public record WpfBrush : GenericBrush<Brush>
{
private WpfBrush(Brush brush) : base(brush)
{
Expand All @@ -12,7 +12,7 @@ private WpfBrush(Brush brush) : base(brush)
public static WpfBrush FromBrush(Brush value) => new(value);
}

internal class WpfBrushFactory : IBrushFactory
public class WpfBrushFactory : IBrushFactory
{
public static WpfBrushFactory Instance = new();
public IBrush FromColor(RgbaColor color) =>
Expand Down
2 changes: 1 addition & 1 deletion src/WpfMath/Rendering/WpfBrushExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace WpfMath.Rendering;

internal static class WpfBrushExtensions
public static class WpfBrushExtensions
{
public static Brush? ToWpf(this IBrush? brush) => ((WpfBrush?)brush)?.Value;
[return: NotNullIfNotNull(nameof(brush))]
Expand Down
4 changes: 2 additions & 2 deletions src/WpfMath/Rendering/WpfTeXEnvironment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ public static TexEnvironment Create(
foreground.ToPlatform());
}

private static SystemFont GetSystemFont(string fontName, double size)
private static WpfSystemFont GetSystemFont(string fontName, double size)
{
var fontFamily = System.Windows.Media.Fonts.SystemFontFamilies.First(
ff => ff.ToString() == fontName || ff.FamilyNames.Values?.Contains(fontName) == true);
return new SystemFont(size, fontFamily);
return new WpfSystemFont(size, fontFamily);
}
}

0 comments on commit fdd7b54

Please sign in to comment.