0

As the question says, how do I write subscript letters for example, Fnet (net is subscripted), in a string?

Is there any shortcut key for creating a subscript lowercase letter? I just found few subscript lowercase letters, ₐ ₑ ᵢ ⱼ ₒ ᵣ ᵤ ᵥ ₓ, other letters are missing.

newbieguy
  • 658
  • 2
  • 11
  • 29
  • 1
    Possible duplicate of [How to write superscript in a string and display using MessageBox.Show()?](http://stackoverflow.com/questions/17704169/how-to-write-superscript-in-a-string-and-display-using-messagebox-show) – xZ6a33YaYEfmv Oct 02 '15 at 10:20
  • Define "write". How do you output this text? – CodeCaster Oct 02 '15 at 10:22
  • 1
    Relevant link: [Unicode subscripts and superscripts](https://en.wikipedia.org/wiki/Unicode_subscripts_and_superscripts). Not all letters have a "pre-defined" Unicode code point for a subscript version. – Jeppe Stig Nielsen Oct 02 '15 at 10:23
  • oh so only those letters has a subscript version – newbieguy Oct 02 '15 at 10:31

2 Answers2

2

Instead of searching for direct subscript support in raw string, you should use a control like RichTextBox which has direct support of displaying subscripts. For other controls you can override OnPaint event and do custom text rendering using GDI+ API's.

neutrino2039
  • 126
  • 10
0

I don't believe you do.

If we were to change the question to "How do I write bold characters in a string" you would naturally tell me that you can't, and you have to apply some styling instead using CSS or something. Same situation here...

You're looking at formatting as opposed to content.

Martin Milan
  • 6,346
  • 2
  • 32
  • 44
  • I don't know about that, I do believe that sub/superscript characters exist as an independent part of the unicode table. – Kilazur Oct 02 '15 at 10:25
  • 1
    Isn't this misleading? Bold text is formatted normal text, yes, but subscript text actually have their own codepoints, right? "ₐ" is not just a formatted "a", they would return false on a string.Compare() and they have a different binary representation. – sara Oct 02 '15 at 10:26
  • The problem with using special unicode characters is two fold. First of all they have to be available for all the alphabets you deal in - and since some alphabets don't really use a concept of letters as such, that could be a problem for you... You also have a probelm if you then want to compare your subscripted characters (it terms of content) to normal text. – Martin Milan Oct 02 '15 at 12:36