Edit this page
Available for: UI for ASP.NET AJAX | UI for ASP.NET MVC | UI for WPF | UI for WinForms | UI for Silverlight

Text and Graphic Properties

When using the methods of FixedContentEditor or Block classes they will create different content elements. You can control the look of the newly created elements with the following properties:

GraphicProperties

These properties are used to hold the current graphics control parameters. The following parameters can be modified using the GraphicProperties:

  • IsFilled: Specifies whether content elements should be filled.

  • IsStroked: Specified whether content elements should be stroked.

  • FillColor: The color which will be used to fill the content elements.

  • StrokeColor: The color which will be used to stroke the content elements.

  • StrokeThickness: The width of the stroke outline of content elements.

  • MiterLimit: Specifies the miter limit for graphic elements.

  • StrokeDashOffset: The dash array for graphic elements.

  • StrokeDashArray: The stroke dash array for graphic elements.

  • StrokeLineJoin: The stroke line join for graphic elements.

  • StrokeLineCap: The stroke line cap for graphic elements.

TextProperties

These properties hold the parameters used for text fragments. The following parameters can be modified using the TextProperties:

  • UnderlinePattern: The underline pattern. Two patterns are supported.

    • None: There is no underline. This is the default value.
    • Single: The underline is a single line.
  • CharacterSpacing: The character spacing for text fragments.

  • WordSpacing: The word spacing for text fragments.

  • HorizontalScaling: The horizontal scaling for text fragments.

  • FontSize: The font size for text fragments.

  • RenderingMode: The rendering mode for text fragments.

  • BaselineAlignment: Describes how the baseline for a text-based element is positioned on the vertical axis, relative to the established baseline for text.

    • Baseline: A baseline that is aligned at the actual baseline of the containing box.
    • Subscript: A baseline that is aligned at the subscript position of the containing box.
    • Superscript: A baseline that is aligned at the superscript position of the containing box.
  • Font: The font for the inserted text.

  • HorizontalAlignment: The horizontal positioning of the inserted text in the text block.

  • VerticalAlignment: The vertical positioning of the inserted text in the text block.

The TextProperties also exposes the following methods, which can be used for changing the current font:

TextProperties.TrySetFont(FontFamily fontFamily);

TextProperties.TrySetFont(fontFamily, fontStyle, fontWeight);

Preserving Current State

Both Text and Graphic properties contain methods that can preserve and restore the current state.

properties.Save();

properties.Restore();

The Save() method returns IDisposable object that will execute Restore() as soon as the dispose method is called and can be used in a using statement.

See Also