protected override void BeforeImageApply() { base.BeforeImageApply(); // do everything at the image level as we are delegating the processing down to other processors var style = new RendererOptions(this.Font, this.Options.DpiX, this.Options.DpiY, this.Location) { ApplyKerning = this.Options.ApplyKerning, TabWidth = this.Options.TabWidth, WrappingWidth = this.Options.WrapTextWidth, HorizontalAlignment = this.Options.HorizontalAlignment, VerticalAlignment = this.Options.VerticalAlignment, FallbackFontFamilies = this.Options.FallbackFonts, ColorFontSupport = this.definition.Options.RenderColorFonts ? ColorFontSupport.MicrosoftColrFormat : ColorFontSupport.None, }; // (this.definition.Options.RenderColorFonts) //{ this.textRenderer = new ColorCachingGlyphRenderer(this.Configuration.MemoryAllocator, this.Text.Length, this.Pen, this.Brush != null); // } // else // { // this.textRenderer = new CachingGlyphRenderer(this.Configuration.MemoryAllocator, this.Text.Length, this.Pen, this.Brush != null); // } this.textRenderer.Options = (GraphicsOptions)this.Options; var renderer = new TextRenderer(this.textRenderer); renderer.RenderText(this.Text, style); }
protected override void AfterImageApply() { base.AfterImageApply(); this.textRenderer?.Dispose(); this.textRenderer = null; }