LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
falkpl

Subscript and superscript fonts

Status: New

How did a program made for engineers and scientists make it 20+ years and not allow for subscripts and superscripts to be displayed. 

E=MC2 is really not all that powerful.

Are there no chemistry math or physics applications developed.

 

One nice method for implementing this is to add an additional mode to string display called markup bhere simple tags could be added around characters to alter their appearance much like is done in HTML.

  

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
14 Comments
altenbach
Knight of NI

Well, E=mc² is a bad example, because most fonts have the square as plain character. (enter e.g. as E=mc\B2 in '\'-codes display and switch back to normal display). 😄

 

Still, I agree it could be useful if text would understand certain tags, such as html or rich text, etc.

falkpl
Trusted Enthusiast

Actually I missed this trick, WOW.  Can this be done with any text or just string controls?  Is there a list of escape characters, I use the normal ones all the time (/t /s // /r /n.....but never saw /B).  I will add this to my bag of tricks.  Still could use a markup mechanism to do this easily.

THANKS

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
altenbach
Knight of NI

No, it's not an escape character, but a real character from the extended ASCII set.

 

In windows you can open "charmap" and look at the first 256 characters of each font. for example \B0 is the degree sign, \B1 is "plus-minus, \B2 is squared, \B3 is cubed, and \B5 is the "micro" sign, \BD is 1/2, \C5 is Angstrom, etc. Some fonts have slightly different assignments, so be careful.

falkpl
Trusted Enthusiast
Yes figured that out playing with it.  so this is font dependant ASCII implementations.  Still good to know.
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
JackDunaway
Trusted Enthusiast
Necessary feature for sharp UI's. Nice suggestion!
yenknip
Active Participant

I make software for chemical rigs, and gasses need to be labeled properly with coposition subscripts (CH4 - methane) and so on. Currently, I have to make up a label graphic and drop that on the Front panel.

 

It really would be great if sub/super script was supported.

 
 
 
Message Edited by yenknip on 06-05-2009 01:46 PM
_____________________________
- Cheers, Ed
khan;;;;;;;;;;;;;;;;
Member

sorry iam not getting how to write subscripts and superscripts on front panel

jcrooke
Member

The way I understand it, you have to do it programmatically. For example, put a reference to your xy graph on the block diagram and wire a property node to it. Then select the text parameter that you want to have a superscript 2 and put it in write mode, e.g. the "xscale.namelbl.text" parameter. You may wire a text constant to it. Display your text constant in binary and put B2 in the place that you want a superscript 2 to show up. You can use a concatenate string function if you want to be able to read the rest of your string as normal text. Alternatively, after you have typed in the binary value for the superscript 2 character, convert your display format back to normal and enter any additional text by continuing to type into the string constant.

jc
Mac 10.4
LV7.1
CLD
Jolyon
Member

I could really do with a nice way to include units for charts, simple stuff like "cm-1" where the "-1" should be superscript.

This is the droid you're looking for...
neberry
Member

Matlab does this by superscripting any character with a ^ in front of it, and subscripting any character with a _ in front of it.  Not a difficult fix, and really easy to use.