2022-08-19 15:13:19 +02:00
|
|
|
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;
|
|
|
|
}
|
2023-05-13 15:17:57 +02:00
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
2022-08-19 15:13:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public enum QuikFontType
|
|
|
|
{
|
|
|
|
Normal,
|
|
|
|
Italic,
|
|
|
|
Bold
|
|
|
|
}
|
|
|
|
}
|