-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Добавил возможность написать моноширинным подчерком хе-хе
- Loading branch information
Showing
2 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using System.Linq; | ||
using Robust.Client.Graphics; | ||
using Robust.Client.ResourceManagement; | ||
using Robust.Client.UserInterface.RichText; | ||
using Robust.Shared.IoC; | ||
using Robust.Shared.Prototypes; | ||
using Robust.Shared.Utility; | ||
|
||
namespace Content.Client.ADT.UserInterface.RichText; | ||
|
||
public sealed class MonospaceTag : IMarkupTag | ||
{ | ||
public const string MonospaceFont = "Monospace"; | ||
|
||
[Dependency] private readonly IResourceCache _resourceCache = default!; | ||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!; | ||
|
||
public string Name => "mono"; | ||
|
||
/// <inheritdoc/> | ||
public void PushDrawContext(MarkupNode node, MarkupDrawingContext context) | ||
{ | ||
var font = FontTag.CreateFont( | ||
context.Font, | ||
node, | ||
_resourceCache, | ||
_prototypeManager, | ||
MonospaceFont | ||
); | ||
context.Font.Push(font); | ||
} | ||
|
||
/// <inheritdoc/> | ||
public void PopDrawContext(MarkupNode node, MarkupDrawingContext context) | ||
{ | ||
context.Font.Pop(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters