public TextRenderMode SetTextRenderOptions(PDFTextRenderOptions options, PDFRect bounds)
        {
            TextRenderMode mode = TextRenderMode.NoOp;

            if (options == null)
            {
                throw new ArgumentNullException("options");
            }

            if (options.FillBrush != null)
            {
                mode = TextRenderMode.Fill;
                options.FillBrush.SetUpGraphics(this, bounds);
            }
            if (options.Stroke != null)
            {
                if (mode == TextRenderMode.Fill)
                {
                    mode = TextRenderMode.FillAndStroke;
                }
                else
                {
                    mode = TextRenderMode.Stroke;
                }

                options.Stroke.SetUpGraphics(this, bounds);
            }
            if (options.Font != null)
            {
                this.SetCurrentFont(options.Font);
            }

            if (options.TextDirection.HasValue)
            {
                this.TextDirection = options.TextDirection.Value;
            }
            else
            {
                this.TextDirection = Scryber.TextDirection.LTR;
            }

            SetTextLeading(options);
            SetTextSpacing(options);
            SetTextRenderMode(mode);
            return(mode);
        }
 public void SetTextRenderMode(TextRenderMode mode)
 {
     this.Writer.WriteOpCodeS(PDFOpCode.TxtRenderMode, (PDFNumber)(int)mode);
 }
 protected void RenderCurrentTextMode(TextRenderMode mode)
 {
     this.Writer.WriteOpCodeS(PDFOpCode.TxtRenderMode, new PDFNumber((int)mode));
 }