From f069cb1f57a3ae41a24f5104b26aad94f0946374 Mon Sep 17 00:00:00 2001 From: KrithikaGanesan Date: Fri, 17 Oct 2025 12:27:42 +0530 Subject: [PATCH 1/2] 985360: Updated ReadMe file of this repository --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7613451..7d0b967 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # This document describes how to change the font size of editor texts after config.xml file has been loaded -We can change the font style, font family, font size and font color of editor texts using ISnippetFormat and Lexems by deriving the language used and changing the above-mentioned properties of font and adding that Lexems for that language in config.xml. +This repository explains how to modify the font size of editor texts after the config.xml file has been loaded in a syntax editor control. The customization of text appearance in the editor is achieved using the ISnippetFormat interface and Lexems, which allow developers to define how specific language elements should be displayed. By identifying the language used in the editor and applying formatting properties such as font style, font family, font size, and font color, developers can enhance the readability and visual appeal of code snippets. +For example, in a C# application, you can define a custom format for keywords using ISnippetFormat. You can set the font color to red and apply an italic style with a specific font size. Then, using ConfigLexem, you can define a regular expression pattern to match keywords and associate it with the custom format. This lexem is added to the language configuration, and the editor caches are reset to apply the changes. ## C# ISnippetFormat keywordFormat = this.editControl1.Language.Add("Keyword"); keywordFormat.FontColor = Color.Red; From 17471c534a4e567349c98e9159efbf66d7996344 Mon Sep 17 00:00:00 2001 From: Manivannan-E <92844213+Manivannan-E@users.noreply.github.com> Date: Thu, 6 Nov 2025 15:32:50 +0530 Subject: [PATCH 2/2] Update README.md --- README.md | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 7d0b967..680a3d0 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,30 @@ -# This document describes how to change the font size of editor texts after config.xml file has been loaded +# How to Change the Font Size of Editor Texts After config.xml Has Been Loaded +## Overview +This repository demonstrates how to modify the font size of editor texts in a syntax editor control after the config.xml file has been loaded. -This repository explains how to modify the font size of editor texts after the config.xml file has been loaded in a syntax editor control. The customization of text appearance in the editor is achieved using the ISnippetFormat interface and Lexems, which allow developers to define how specific language elements should be displayed. By identifying the language used in the editor and applying formatting properties such as font style, font family, font size, and font color, developers can enhance the readability and visual appeal of code snippets. -For example, in a C# application, you can define a custom format for keywords using ISnippetFormat. You can set the font color to red and apply an italic style with a specific font size. Then, using ConfigLexem, you can define a regular expression pattern to match keywords and associate it with the custom format. This lexem is added to the language configuration, and the editor caches are reset to apply the changes. -## C# - ISnippetFormat keywordFormat = this.editControl1.Language.Add("Keyword"); - keywordFormat.FontColor = Color.Red; - keywordFormat.Font = new Font(FontFamily.GenericSansSerif, 14,FontStyle.Italic); +Customization of text appearance is achieved using the ISnippetFormat interface and Lexems, which allow developers to define how specific language elements should be displayed. By identifying the language used in the editor and applying formatting properties such as font style, font family, font size, and font color, developers can enhance the readability and visual appeal of code snippets. - ConfigLexem configLex = new ConfigLexem("[A-Z]+", "", FormatType.Custom, false); +## Example: C# Implementation +In a C# application, you can define a custom format for keywords using ISnippetFormat. For instance, you can set the font color to red, apply an italic style, and specify a font size. Then, using ConfigLexem, you define a regular expression pattern to match keywords and associate it with the custom format. +``` C# +ISnippetFormat keywordFormat = this.editControl1.Language.Add("Keyword"); +keywordFormat.FontColor = Color.Red; +keywordFormat.Font = new Font(FontFamily.GenericSansSerif, 14, FontStyle.Italic); - configLex.IsBeginRegex = true; - configLex.IsEndRegex = true; - configLex.FormatName = "Keyword"; +ConfigLexem configLex = new ConfigLexem("[A-Z]+", "", FormatType.Custom, false); +configLex.IsBeginRegex = true; +configLex.IsEndRegex = true; +configLex.FormatName = "Keyword"; +editControl1.Language.Lexems.Add(configLex); +editControl1.Language.ResetCaches(); +``` - editControl1.Language.Lexems.Add(configLex); - editControl1.Language.ResetCaches(); - +## Key Steps +- Create a custom format using ISnippetFormat. +- Define a Lexem with a regex pattern to match specific text (e.g., keywords). +- Associate the Lexem with the custom format. +- Add the Lexem to the language configuration. +- Reset the editor caches to apply the changes. +