Sunday, January 30, 2011

IDL : subscripts/superscripts

Changing Fonts within a String, special fonts


You can change fonts one or more times within a text string using the embedded font commands shown in the table below. The character following the exclamation mark can be either upper or lower case.

Examples of commands used to change fonts in mid-string are included in Formatting Command Examples.
Table H-33: Embedded Font Selection Commands

Table H-33: Embedded Font Selection Commands

Command

Hershey Vector Font

TrueType Font

PostScript Font

!3

Simplex Roman (default)

Helvetica

Helvetica

!4

Simplex Greek

Helvetica Bold

Helvetica Bold

!5

Duplex Roman

Helvetica Italic

Helvetica Narrow

!6

Complex Roman

Helvetica Bold Italic

Helvetica Narrow Bold Oblique

!7

Complex Greek

Times

Times Roman

!8

Complex Italic

Times Italic

Times Bold Italic

!9

Math/special characters

Symbol

Symbol

!M

Math/special characters (change effective for one character only)

Symbol

Symbol

!10

Special characters

Symbol *

Zapf Dingbats

!11(!G)

Gothic English

Courier

Courier

!12(!W)

Simplex Script

Courier Italic

Courier Oblique

!13

Complex Script

Courier Bold

Palatino

!14

Gothic Italian

Courier Bold Italic

Palatino Italic

!15

Gothic German

Times Bold

Palatino Bold

!16

Cyrillic

Times Bold Italic

Palatino Bold Italic

!17

Triplex Roman

Helvetica *

Avant Garde Book

!18

Triplex Italic

Helvetica *

New Century Schoolbook

!19

Helvetica *

New Century Schoolbook Bold

!20

Miscellaneous

Helvetica *

Undefined User Font

!X

Revert to the entry font

Revert to the entry font

Revert to the entry font

* The font assigned to this index may be replaced in a future release of IDL.



Writing Exponents :

IDL> xyouts, 0.5, 200, '!6E=mc!E2' On the plot, the string will reads: E = mc2
Positioning Commands Action
!A Shift above the division line.
!B Shift below the divisionline.
!C "Carriage return," begins a new line of text. Shift back to the starting position and down one line.
!D Shift down to the first level subscript and decrease the character size by a factor of 0.62.
!E Shift up to the exponent level and decrease the character size by a factor of 0.44.
!I Shift down to the index level and decrease the character size by a factor of 0.44.
!L Shift down to the second level subscript. Decrease the character size by a factor of 0.62.
!N Shift back to the normal level and original character size.
!R Restore position. The current position is set from the top of the saved position stack.
!S Save position. The currente position is saved on the top of the saved positions stack.
!U Shift to upper subscript level. Decrease the character size by a factor of 0.62.
!X Return to the entry font.
!! Display the ! symbol.



 To change to special characters: '!9'+string(#B)+'!X'
e.g. for integral sign in title: title='!9'+string(242B)+'!X'

Note: use !p.font=0 for post script

Further descripton:http://tinyurl.com/64sv245

Solar mass Sun symbol: 'Mass (M/M'+sunsymbol(font=0)+')'

Overbar on characters: 

TITLE='My Data !9`!S``!R!XAB'

Gives an overbar over AB. title='My Data !9`!S``!R!XV!Dr!U2!N!X A'

 gives an overbar over Vr^2 leaving out A

No comments:

Post a Comment