Text Layout Configuration

In RegexMagic, a “text layout” is a combination of settings that control how text is displayed and how the text cursor navigates through that text. The settings include the font, text direction, text cursor behavior, text cursor appearance, which characters are word characters, and how the text should be spaced.

On the Editors tab in the Preferences, you can select up to four different text layouts that are used for various parts of RegexMagic. The Regex text layout is used for edit boxes for regular expressions and replacement texts. The Convert text layout is used for the warning and error messages on the Convert panel. The font from the Convert text layout is also used for the regex tree on the Create panel. The editors on the Test, Debug, Use, and GREP panels all use the same text layout. You’ll likely want to select a monospaced text layout for this one, so that columns line up correctly. The Forum text layout is used to edit messages on the built-in user forum.

You can select predefined text layouts from the drop-down lists. Or, you can click the Configure Text Layouts button to show the Text Layout Configuration window to customize the text layouts.

Text Layout Configuration

Select The Text Layout Configuration That You Want to Use

The Text Layout Configuration screen shows the details of the text layout configuration that you select in the list in the top left corner. Any changes you make on the screen are automatically applied to the selected layout and persist as you choose different layouts in the list. The changes become permanent when you click OK.

Click the New and Delete buttons to add or remove layouts. You must have at least one text layout configuration. If you have more than one, you can use the Up and Down buttons to change their order. The order does not affect anything other than the order in which the text layouts configurations appear in selection lists.

RegexMagic comes with a number of preconfigured text layouts. If you find the options on this screen bewildering then simply choose the preconfigured layout that matches your needs, and ignore all the other settings. You can fully edit all the predefined text layouts to adjust them to your needs. You can delete any preconfigured text layouts that you don’t need. Some text layouts may not be available if the fonts they need were not installed on your computer when you first ran RegexMagic.

You can rename a text layout, including any of the predefined text layouts, by editing the text in the box labeled “name of this text layout configuration”.

Text Layout and Direction

This setting has a significant impact on how the text layout arranges text. Consider the options carefully.

You can toggle “ASCII characters with full ideographic width” in combination with any of the four preceding options. With most fonts, ASCII characters (English letters, digits, and punctuation) are about half the width of ideographs. This option substitutes full-width characters for the ASCII characters so they are the same width as ideographs. Japanese Kana are also displayed as full-width characters. The substitution is only done for display purposes. The file you save retains the ASCII characters and Kana that you entered. If you turn this on in combination with “monospaced left-to-right only” then all characters are given the same width as ideographs. Columns that mix English letters and digits with ideographs will line up perfectly. With the other text layouts, all characters other than ASCII and Kana are spaced according to their original widths.

Fonts

While in many applications you can choose only a single font to display your text, in RegexMagic you can select a list of fonts. This is necessary when working with text written in multiple scripts. There are no fonts that can perfectly display all scripts. Even if another application appears to be able to display all text using a single font, most likely that application is allowing Windows to automatically substitute different fonts for text that your chosen font cannot display. But this does not always work, and gives you no control over the fonts that are substituted.

RegexMagic does not allow Windows to automatically substitute different fonts. If your text contains characters that cannot be displayed by any of the fonts in your text layout configuration, then RegexMagic displays a rectangle with an X in it to indicate it cannot display the character. This is your signal that you need to add fonts to your text layout configuration, or select a different configuration. Click the Add Font button to do so. The Choose a Font dialog box will help you to select a font that supports the missing characters. When you OK that dialog, the font you chose is added to the list below the font that you selected before you clicked the Add Font button.

The order of the fonts is important. Put your main font at the top. The fonts below are fallback fonts. They are only used for text that the main font cannot display. When the text layout and direction are set to one of the two “left-to-right only” options, RegexMagic picks fonts character by character. It displays each character with the highest font in the list that supports the character. When using one of the two “complex script” options, the text is broken into runs of characters that form a unit (typically a word) in the same script. RegexMagic then uses the highest font in the list that can display the entire run for each run. Changing the order of fonts will change the appearance of the text if you swap fonts that support the same characters. You may still want both fonts in your list as both may support some characters that the other does not.

Normally, plain text files should not contain control characters other than tabs and line breaks. RegexMagic has separate settings for visualizing tabs and line breaks. Most fonts are unable to display control characters. Therefore RegexMagic provides several options for visualizing control characters. The first 3 use ASCII characters from the first font in the font list. The last 2 require a font that supports the visualization characters.

Selecting one of the last two options enables the Font button next to the drop-down list. When you click this button, RegexMagic first goes through the list of fonts to see if it already contains a font that supports the IBM PC glyphs or the Unicode control pictures (according to your choice). If it does then RegexMagic selects this font in the list before showing the dialog box for choosing a font to visualize control characters. That font is then the default font in this dialog box. Otherwise Segoe UI Symbol is the default. This dialog box only shows fonts that support either the IBM PC glyphs or the Unicode control pictures. You can change the option in the dialog box. It shows a hex editor control with all the ASCII and ISO-8859 control characters. The right hand side lets you preview the visualization. If you select a font that is not already in your list and click OK then RegexMagic adds it to the list of fonts.

Line and Character Spacing

By default all the spacing options are set to zero. This tells RegexMagic to use the default spacing for the font you have selected.

If you find that lines are spaced apart too widely, specify a negative value for “increase (or decrease) the line height”. Also specify to “add 0 pixels of extra space between lines”.

If you find that lines are spaced too closely together, specify a positive value for “increase (or decrease) the line height” and/or “add ... pixels of extra space between lines”. The difference between the two is that when you select a line of text, increasing the line height increases the height of the selection highlighting, while adding extra space between lines does not. If you select multiple lines of text, extra space between lines shows up as gaps between the selected lines. Adding extra space between lines may make it easier to distinguish between lines.

The “increase (or decrease) the character width by ... pixels” setting is only used when you select “monospaced left-to-right only” in the “text layout and direction” group. You can specify a positive value to increase the character or column width, or a negative value to decrease it. This can be useful if your chosen font is not perfectly monospaced and because of that characters appear spaced too widely or too closely.

Text Cursor Movement

Characters to Treat as Word Characters

Double-clicking selects a word. Ctrl+Allow Left jumps to the start of the current word or the previous word. Ctrl+Arrow Right jumps to the start of the next word. Letters and digits are always considered to be word characters. Whitespace characters are always considered to be non-word characters. But for punctuation characters and symbols, you have a choice. When working with source code, you may want to select the kinds of characters that your programming language allows in identifiers.

If you tick the option “words determined by complex script analysis” and you also select the “bidirectional” text cursor movement option then Ctrl+Arrow Left and Ctrl+Arrow Right will allow you to place the cursor between two letters for languages such as Thai that don’t write spaces between words. If you are not using a bidirectional text cursor then this option has no effect. Then Ctrl+Arrow Left and Right skip over entire sentences when there are no spaces between words.

Selection of Words

Text Cursor Appearance

Select a predefined cursor or click the Configure button to show the text cursor configuration screen. There you can configure the looks of the blinking text cursor (and even make it stop blinking).

A text layout uses two cursors. One cursor is used for insert mode, where typing in text pushes ahead the text after the cursor. The other cursor is used for overwrite mode, where tying in text replaces the characters after the cursor. Pressing the Insert key on the keyboard toggles between insert and overwrite mode.

Sample Text

The sample text at the bottom of the window demonstrates your chosen text layout configuration. Any settings you change are automatically applied to the preview. If you need to select a different text layout to correctly or better display some specific text then you can paste it into the sample box. If you do not edit the sample text then RegexMagic automatically adapts the sample text to the text layout configuration that you choose in the list, at least if it recognizes the name of the configuration as one of the built-in ones. It changes the order of the sample sentences to put the most relevant ones at the top. Scripts that your selected text layout isn’t intended for are omitted. If you select a left-to-right only text layout, for example, then the sample text omits right-to-left and syllabic scripts.

For alphabetic languages, the samples are sentences like “The quick brown fox jumps over the lazy dog.” that use every letter in the alphabet at least once. This allows you to check that every letter is displayed to your liking.