Browse Source

add graphics engine text halo (#2528)

pull/2529/head
Jason Dove 10 months ago committed by GitHub
parent
commit
4e43817f8e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      CHANGELOG.md
  2. 9
      ErsatzTV.Core/Graphics/TextGraphicsElement.cs
  3. 15
      ErsatzTV.Infrastructure/Streaming/Graphics/Text/TextElement.cs

2
CHANGELOG.md

@ -14,6 +14,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Positive and negative margins can be used to offset from center as desired - Positive and negative margins can be used to offset from center as desired
- Add `line_height` property to text element style definition - Add `line_height` property to text element style definition
- This is a multiplier that defaults to 1.0 when unspecified - This is a multiplier that defaults to 1.0 when unspecified
- Add `halo_color`, `halo_width` and `halo_blur` properties to text element style definition
- These can be used to "outline" text with the configured color (e.g. `#000000`), width (e.g. `10`) and amount of blur (e.g. `2`)
- Add `Block Playout Troubleshooting` tool to help investigate block playout history - Add `Block Playout Troubleshooting` tool to help investigate block playout history
- Add sequential schedule file and scripted schedule file names to playouts table - Add sequential schedule file and scripted schedule file names to playouts table
- Add empty (but already up-to-date) sqlite3 database to greatly speed up initial startup for fresh installs - Add empty (but already up-to-date) sqlite3 database to greatly speed up initial startup for fresh installs

9
ErsatzTV.Core/Graphics/TextGraphicsElement.cs

@ -83,4 +83,13 @@ public class StyleDefinition
[YamlMember(Alias = "line_height", ApplyNamingConventions = false)] [YamlMember(Alias = "line_height", ApplyNamingConventions = false)]
public float? LineHeight { get; set; } public float? LineHeight { get; set; }
[YamlMember(Alias = "halo_color", ApplyNamingConventions = false)]
public string HaloColor { get; set; }
[YamlMember(Alias = "halo_width", ApplyNamingConventions = false)]
public float? HaloWidth { get; set; }
[YamlMember(Alias = "halo_blur", ApplyNamingConventions = false)]
public float? HaloBlur { get; set; }
} }

15
ErsatzTV.Infrastructure/Streaming/Graphics/Text/TextElement.cs

@ -223,6 +223,21 @@ public partial class TextElement(
TextColor = SKColor.TryParse(def.TextColor, out SKColor color) ? color : SKColors.White TextColor = SKColor.TryParse(def.TextColor, out SKColor color) ? color : SKColors.White
}; };
if (SKColor.TryParse(def.HaloColor, out SKColor parsedHaloColor))
{
style.HaloColor = parsedHaloColor;
}
foreach (float haloWidth in Optional(def.HaloWidth))
{
style.HaloWidth = haloWidth;
}
foreach (float haloBlur in Optional(def.HaloBlur))
{
style.HaloBlur = haloBlur;
}
foreach (float fontSize in Optional(def.FontSize)) foreach (float fontSize in Optional(def.FontSize))
{ {
style.FontSize = fontSize; style.FontSize = fontSize;

Loading…
Cancel
Save