✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
public record Glyph(char Code, Font Font);
public class GlyphFactory
{
private readonly Dictionary<(char, string), Glyph> _pool = new();
public Glyph Get(char c, Font f)
=> _pool.TryGetValue((c, f.Name), out var g)
? g : _pool[(c, f.Name)] = new Glyph(c, f);
}
Що робить GlyphFactory?