mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-27 12:34:56 +01:00
embed fonts
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System.Globalization;
|
||||
using ImageMagickSharp;
|
||||
using ImageMagickSharp;
|
||||
using MediaBrowser.Common.Configuration;
|
||||
using MediaBrowser.Model.Drawing;
|
||||
using System.Globalization;
|
||||
|
||||
namespace MediaBrowser.Server.Implementations.Drawing
|
||||
{
|
||||
@@ -8,6 +9,13 @@ namespace MediaBrowser.Server.Implementations.Drawing
|
||||
{
|
||||
private const int OffsetFromTopRightCorner = 38;
|
||||
|
||||
private readonly IApplicationPaths _appPaths;
|
||||
|
||||
public UnplayedCountIndicator(IApplicationPaths appPaths)
|
||||
{
|
||||
_appPaths = appPaths;
|
||||
}
|
||||
|
||||
public void DrawUnplayedCountIndicator(MagickWand wand, ImageSize imageSize, int count)
|
||||
{
|
||||
var x = imageSize.Width - OffsetFromTopRightCorner;
|
||||
@@ -25,7 +33,7 @@ namespace MediaBrowser.Server.Implementations.Drawing
|
||||
pixel.Opacity = 0;
|
||||
pixel.Color = "white";
|
||||
draw.FillColor = pixel;
|
||||
draw.Font = "Sans-Serif";
|
||||
draw.Font = PlayedIndicatorDrawer.ExtractFont("robotoregular.ttf", _appPaths);
|
||||
draw.FontStyle = FontStyleType.NormalStyle;
|
||||
draw.TextAlignment = TextAlignType.CenterAlign;
|
||||
draw.FontWeight = FontWeightType.RegularStyle;
|
||||
@@ -36,7 +44,7 @@ namespace MediaBrowser.Server.Implementations.Drawing
|
||||
|
||||
if (text.Length == 1)
|
||||
{
|
||||
x += 2;
|
||||
x += 1;
|
||||
}
|
||||
else if (text.Length == 2)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user