diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-03-08 23:56:42 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-03-08 23:56:42 -0400 |
| commit | 2caf01f43b7153127f8d26b26da3f762cbf321d4 (patch) | |
| tree | 32c5bfe1628652f7cff718c956e32fcfb1a7bfa4 /MediaBrowser.Server.Implementations/Drawing/UnplayedCountIndicator.cs | |
| parent | e70e06f0ac57efc66db5701f4f2a01d157eb8c8a (diff) | |
embed fonts
Diffstat (limited to 'MediaBrowser.Server.Implementations/Drawing/UnplayedCountIndicator.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Drawing/UnplayedCountIndicator.cs | 16 |
1 files changed, 12 insertions, 4 deletions
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) { |
