Dashboard/Quik/Typography/QuikFontStyle.cs
H. Utku Maden 9339295378 Push all uncommitted changes.
I have had a long break from this project due to other higher priority
things going on in my life. Big changes inbound.
2023-05-13 16:17:57 +03:00

50 lines
1.3 KiB
C#

namespace Quik.Typography
{
public class QuikFontStyle
{
public string Family { get; }
public QuikFontType Type { get; }
public float Size { get; }
public QuikFontStyle(string family, float size, QuikFontType type = QuikFontType.Normal)
{
Family = family;
Size = size;
Type = type;
}
public override int GetHashCode()
{
return
Family.GetHashCode() ^
(Type.GetHashCode() * 1303) ^
(Size.GetHashCode() * 2447);
}
public override bool Equals(object obj)
{
return
obj is QuikFontStyle other &&
other.Family == Family &&
other.Size == Size &&
other.Type == Type;
}
public static bool operator==(QuikFontStyle a, QuikFontStyle b)
{
return a.Size == b.Size && a.Type == b.Type && a.Family == b.Family;
}
public static bool operator !=(QuikFontStyle a, QuikFontStyle b)
{
return a.Size != b.Size || a.Type != b.Type || a.Family != b.Family;
}
}
public enum QuikFontType
{
Normal,
Italic,
Bold
}
}