29 lines
840 B
C#
29 lines
840 B
C#
using System.Windows;
|
|
using System.Windows.Media;
|
|
|
|
namespace Qrakhen.Qamp.Editor;
|
|
|
|
public static class TextHelper // temp
|
|
{
|
|
public static double Size { get; set; } = 14;
|
|
public static double LineHeight { get; set; } = 18;
|
|
public static Brush DefaultColor { get; set; } = Brushes.AntiqueWhite;
|
|
public static Typeface Typeface { get; set; } = new(
|
|
new FontFamily("Consolas"),
|
|
FontStyles.Normal,
|
|
FontWeights.Normal,
|
|
FontStretches.Normal);
|
|
|
|
public static FormattedText GetText(string text, double size, Brush? brush = null, double dpiScale = 1f)
|
|
{
|
|
return new FormattedText(
|
|
text,
|
|
System.Globalization.CultureInfo.CurrentCulture,
|
|
FlowDirection.LeftToRight,
|
|
Typeface,
|
|
size,
|
|
brush ?? DefaultColor,
|
|
dpiScale
|
|
);
|
|
}
|
|
} |