Xui.Runtime.Software.Actual
Assembly: Xui.Runtime.Software · C# declarations · Assembly overview
Types
class SoftwareImageclass SoftwareImagePipelineclass SoftwareTextMeasureContextclass SvgDrawingContextclass SvgDrawingContext.NumericFormatrecord struct SvgDrawingContext.Resolvedenum SvgDrawingContext.SvgFontModeclass SvgDrawingContext.SvgFontResolver
class SoftwareImage
An image handle retaining the original PNG bytes for SVG embedding.
public sealed class SoftwareImage : IImage
{
public Size Size { get; }
public void Load(string uri);
public async Task LoadAsync(string uri);
public void LoadPixels(int width, int height, ReadOnlySpan<byte> bgra32Data);
}
void SoftwareImage.Load(string uri)
public void Load(string uri);
Task SoftwareImage.LoadAsync(string uri)
public async Task LoadAsync(string uri);
void SoftwareImage.LoadPixels(int width, int height, ReadOnlySpan<byte> bgra32Data)
public void LoadPixels(int width, int height, ReadOnlySpan<byte> bgra32Data);
Size SoftwareImage.Size
public Size Size { get; }
class SoftwareImagePipeline
Cached packaged PNG resources for deterministic, self-contained SVG rendering.
public sealed class SoftwareImagePipeline : IImagePipeline
{
public SoftwareImagePipeline(string? baseDirectory = null);
public IImage CreateImage();
}
SoftwareImagePipeline.SoftwareImagePipeline(string? baseDirectory = null)
public SoftwareImagePipeline(string? baseDirectory = null);
IImage SoftwareImagePipeline.CreateImage()
public IImage CreateImage();
class SoftwareTextMeasureContext
A lightweight Xui.Core.Canvas.ITextMeasureContext backed by the software font Xui.Runtime.Software.Font.Catalog. Used to provide text hit-testing for pointer events without needing a full drawing context.
public sealed class SoftwareTextMeasureContext : ITextMeasureContext
{
public SoftwareTextMeasureContext(Catalog catalog);
public TextMetrics MeasureText(string text);
public void SetFont(Xui.Core.Canvas.Font font);
}
SoftwareTextMeasureContext.SoftwareTextMeasureContext(Catalog catalog)
public SoftwareTextMeasureContext(Catalog catalog);
TextMetrics SoftwareTextMeasureContext.MeasureText(string text)
public TextMetrics MeasureText(string text);
void SoftwareTextMeasureContext.SetFont(Font font)
public void SetFont(Xui.Core.Canvas.Font font);
class SvgDrawingContext
public sealed partial class SvgDrawingContext
{
public CompositionGroup Group(scoped in GroupOptions options);
public void EndGroup();
}
public sealed partial class SvgDrawingContext
{
}
public sealed partial class SvgDrawingContext
{
public void DrawSymbol(SymbolContent content);
}
public sealed partial class SvgDrawingContext : IContext, IDisposable
{
public void SetFilter();
public void SetFilter(Brightness brightness);
public nfloat GlobalAlpha { get; set; }
public LineCap LineCap { get; set; }
public LineJoin LineJoin { get; set; }
public nfloat LineWidth { get; set; }
public nfloat MiterLimit { get; set; }
public nfloat LineDashOffset { get; set; }
public TextAlign TextAlign { get; set; }
public TextBaseline TextBaseline { get; set; }
public IReadOnlyDictionary<FontFace, FontUsage> FontUsage { get; }
public SvgDrawingContext(Size canvasSize, Stream output, IEnumerable<Uri> fontUris, SvgFontResolver? resolver = null, NumericFormat? numericFormat = null, bool keepOpen = false);
public SvgDrawingContext(Size canvasSize, Stream output, IFontSource fontSource, SvgFontResolver? resolver = null, NumericFormat? numericFormat = null, bool keepOpen = false);
public SvgDrawingContext(Size canvasSize, Stream output, bool keepOpen = false);
public SvgDrawingContext(Size canvasSize, Stream output, Catalog? catalog, SvgFontResolver? resolver = null, NumericFormat? numericFormat = null, bool keepOpen = false);
public void Dispose();
public abstract class NumericFormat
{
public abstract string Format(nfloat number);
public static NumericFormat Default { get; }
}
public class SvgFontResolver
{
public static readonly SvgFontResolver Default;
public static readonly SvgFontResolver Embedded;
public virtual Resolved Resolve(FontFace face, Uri? uri);
}
public record struct Resolved(SvgFontMode Mode, Uri? WebUri);
public enum SvgFontMode
{
System,
WebLink,
Embedded
}
}
SvgDrawingContext.SvgDrawingContext(Size canvasSize, Stream output, bool keepOpen = false)
public SvgDrawingContext(Size canvasSize, Stream output, bool keepOpen = false);
SvgDrawingContext.SvgDrawingContext(Size canvasSize, Stream output, IEnumerable<Uri> fontUris, SvgFontResolver? resolver = null, NumericFormat? numericFormat = null, bool keepOpen = false)
public SvgDrawingContext(Size canvasSize, Stream output, IEnumerable<Uri> fontUris, SvgFontResolver? resolver = null, NumericFormat? numericFormat = null, bool keepOpen = false);
SvgDrawingContext.SvgDrawingContext(Size canvasSize, Stream output, IFontSource fontSource, SvgFontResolver? resolver = null, NumericFormat? numericFormat = null, bool keepOpen = false)
public SvgDrawingContext(Size canvasSize, Stream output, IFontSource fontSource, SvgFontResolver? resolver = null, NumericFormat? numericFormat = null, bool keepOpen = false);
Creates an SVG context with lazily loaded application font resources.
SvgDrawingContext.SvgDrawingContext(Size canvasSize, Stream output, Catalog? catalog, SvgFontResolver? resolver = null, NumericFormat? numericFormat = null, bool keepOpen = false)
public SvgDrawingContext(Size canvasSize, Stream output, Catalog? catalog, SvgFontResolver? resolver = null, NumericFormat? numericFormat = null, bool keepOpen = false);
void SvgDrawingContext.Dispose()
public void Dispose();
void SvgDrawingContext.DrawSymbol(SymbolContent content)
public void DrawSymbol(SymbolContent content);
Writes one vector definition and a use element for each placement.
void SvgDrawingContext.EndGroup()
public void EndGroup();
Closes the innermost group. Called by Xui.Core.Canvas.Composition.Graphics.CompositionGroup.Dispose; prefer disposing the returned scope over calling this directly.
IReadOnlyDictionary<FontFace, FontUsage> SvgDrawingContext.FontUsage
public IReadOnlyDictionary<FontFace, FontUsage> FontUsage { get; }
Characters and adjacent pairs rendered for each resolved font face.
NFloat SvgDrawingContext.GlobalAlpha
public nfloat GlobalAlpha { get; set; }
CompositionGroup SvgDrawingContext.Group(scoped in GroupOptions options)
public CompositionGroup Group(scoped in GroupOptions options);
Emits an explicit SVG group, even with no transform or drawing. A new export always needs content, independently of HasUpdates and any other context's native cache.
LineCap SvgDrawingContext.LineCap
public LineCap LineCap { get; set; }
NFloat SvgDrawingContext.LineDashOffset
public nfloat LineDashOffset { get; set; }
LineJoin SvgDrawingContext.LineJoin
public LineJoin LineJoin { get; set; }
NFloat SvgDrawingContext.LineWidth
public nfloat LineWidth { get; set; }
NFloat SvgDrawingContext.MiterLimit
public nfloat MiterLimit { get; set; }
void SvgDrawingContext.SetFilter()
public void SetFilter();
void SvgDrawingContext.SetFilter(Brightness brightness)
public void SetFilter(Brightness brightness);
TextAlign SvgDrawingContext.TextAlign
public TextAlign TextAlign { get; set; }
TextBaseline SvgDrawingContext.TextBaseline
public TextBaseline TextBaseline { get; set; }
class SvgDrawingContext.NumericFormat
public abstract class NumericFormat
{
public abstract string Format(nfloat number);
public static NumericFormat Default { get; }
}
NumericFormat NumericFormat.Default
public static NumericFormat Default { get; }
string NumericFormat.Format(NFloat number)
public abstract string Format(nfloat number);
record struct SvgDrawingContext.Resolved
public record struct Resolved(SvgFontMode Mode, Uri? WebUri);
Resolved.Resolved(SvgFontMode Mode, Uri? WebUri)
public Resolved(SvgFontMode Mode, Uri? WebUri);
SvgFontMode Resolved.Mode
public SvgFontMode Mode { get; set; }
Uri? Resolved.WebUri
public Uri? WebUri { get; set; }
enum SvgDrawingContext.SvgFontMode
Determines how to emit fonts inside an SVG.
public enum SvgFontMode
{
System,
WebLink,
Embedded
}
SvgFontMode.Embedded
Embedded
Embed the font data as base64 using a data URI inside @font-face.
SvgFontMode.System
System
Assume the font is installed in the system; only use font-family="...".
SvgFontMode.WebLink
WebLink
Emit a link to an external font using @font-face with a resolved URI.
class SvgDrawingContext.SvgFontResolver
Delegate-based resolver that provides how a specific font should be handled in an SVG.
public class SvgFontResolver
{
public static readonly SvgFontResolver Default;
public static readonly SvgFontResolver Embedded;
public virtual Resolved Resolve(FontFace face, Uri? uri);
}
SvgFontResolver SvgFontResolver.Default
public static readonly SvgFontResolver Default;
SvgFontResolver SvgFontResolver.Embedded
public static readonly SvgFontResolver Embedded;
Embed only used glyphs and kerning pairs from each resolved font face.
Resolved SvgFontResolver.Resolve(FontFace face, Uri? uri)
public virtual Resolved Resolve(FontFace face, Uri? uri);