namespace RioJoy.Core.Overlay;

/// <summary>The pixel size of a rendered string (its bounding box).</summary>
public readonly record struct TextExtent(double Width, double Height);

/// <summary>
/// Measures rendered text. Abstracts the rasterizer (SkiaSharp, GDI, …) so the
/// overlay layout math (<see cref="FontFitter"/>, <see cref="OverlayLayoutEngine"/>)
/// stays pure and unit-testable against a fake measurer — the same split the rest
/// of the codebase uses for output sinks. The legacy pipeline measured with GIMP's
/// <c>gimp-text-get-extents-fontname</c> (see docs/reference/customBackground/sg-goobie-MFD.scm).
/// </summary>
public interface ITextMeasurer
{
    /// <summary>Bounding-box size of <paramref name="text"/> at the given font/size, in pixels.</summary>
    TextExtent Measure(string text, string fontFamily, double fontSizePx);
}
