0

Sneak Peek 32.0: Modifying the Normal Stylesheet

 1 year ago
source link: https://www.textcontrol.com/blog/2023/07/04/sneak-peek-320-modifying-the-normal-stylesheet/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Modifying the Normal Stylesheet

Stylesheet (or styles) are used to apply consistent formatting to various parts of a document. By defining formatting rules, headings, subheadings, and content paragraphs can be formatted consistently to streamline formatting processing and improve the performance of the document creation process.

Unlike the current and older versions of TX Text Control, version 32.0 will allow you to manipulate the [Normal] style. This allows you to change the root style of the document, which is propagated through all inherited styles.

Global Changes

Applying a global change to the root style automatically updates the inherited styles. For example, if a user changes the font name of the [Normal] style, all inherited styles for headings or other elements throughout the document are updated.

The following screenshot shows a document with three styles:

  • [Normal]: Unchanged, the default setting is Arial, 10pt.
  • Heading 1: Based on [Normal] with an increased font size of 16.
  • Heading 2: Based on [Heading 1] with a decreased font size of 12.
Normal Style in TX Text Control

Changing the Root Style

In version 32.0 it will be possible to change the [Normal] style by setting the Font property at design time or runtime.

Any styles that are inherited will be automatically updated in the style chain.

Normal Style in TX Text Control

Persistency

When saving documents, the default [Normal] stylesheet is persistent, so you can use this feature to create a default template (similar to Normal.dot(m) in MS Word) that can be loaded with a default style. Alternatively, the default style can be set at design time before the control is created.

The same behavior will be compatible with the non-UI class ServerTextControl .

Stay tuned for more features!


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK