Formatting of individual words

Hello.
I have a question for you. Is it possible to change formatting of individual words within the shape's annotation? For example, I want to make word "sample" bold in this sentence "This is a sample."

1 Reply 1 reply marked as answer

GG Gowtham Gunashekar Syncfusion Team June 3, 2021 12:35 PM UTC

Hi Dan, 
 
On the further analysis of the shared details, we understood you want to reader a sentence in annotation content in the node and in the sentence, you want to make a single work as bold. In the case of the annotation content, we can apply the same styles like bold, color, font size, etc. for the entire content. We suggest you split the sentence into two sentences based on the style and add the sentence as two annotations and place the annotation using offset and margin. In the sample we have split the word “This is” as one annotation and the word “Sample” as another annotation and added bold style for the second annotation and achieved your requirement. We have added the sample link below for your references.  
 
Code snippet: 
let nodes = [ 
   { 
     id: 'Terminator', offsetX:100, offsetY:100, width: 150, height: 60, shape: { type: 'Flow', shape: 'Terminator' }, 
     annotations:[ 
       {content:"This is ", margin:{right:20},style:{fontSize:15}}, 
       {content:"sample", margin:{left:35},style:{bold:true,fontSize:15}} 
       ]  
  }, 
]; 
 
 
 
Regards, 
Gowtham 


Marked as answer
Loader.
Up arrow icon