From 2caf01f43b7153127f8d26b26da3f762cbf321d4 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 8 Mar 2015 23:56:42 -0400 Subject: embed fonts --- .../Drawing/UnplayedCountIndicator.cs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'MediaBrowser.Server.Implementations/Drawing/UnplayedCountIndicator.cs') diff --git a/MediaBrowser.Server.Implementations/Drawing/UnplayedCountIndicator.cs b/MediaBrowser.Server.Implementations/Drawing/UnplayedCountIndicator.cs index c10084c9b..65212a315 100644 --- a/MediaBrowser.Server.Implementations/Drawing/UnplayedCountIndicator.cs +++ b/MediaBrowser.Server.Implementations/Drawing/UnplayedCountIndicator.cs @@ -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) { -- cgit v1.2.3