Re: Beyond 7-bit ASCII [message #40725] |
Mon, 30 August 2004 10:47 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Karl Schultz writes:
> I think that you are looking at the vector font encodings and trying to
> apply them to TrueType fonts.
>
> So, you can go one way or the other:
>
> TrueType:
> text = Obj_New('IDLgrText', ENABLE_FORMATTING=1, $
> "(!10W!X) Greek Symbol Omega", color=[0,0,128])
> XObjView, text
>
>
> Hershey vector fonts:
>
> oFont = OBJ_NEW('IDLgrFont', 'Hershey')
> xobjview, obj_new('idlgrtext', '(!4!Z(58)!X) Greek Symbol Omega',
> FONT=oFont, /ENABLE_FORMATTING)
Oh, right. Thanks, Karl. I'll write myself a little note. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
Re: Beyond 7-bit ASCII [message #40727 is a reply to message #40725] |
Mon, 30 August 2004 10:40  |
Karl Schultz
Messages: 341 Registered: October 1999
|
Senior Member |
|
|
"David Fanning" <davidf@dfanning.com> wrote in message
news:MPG.1b9d06e4f09bcd5b98986a@news.frii.com...
> Karl Schultz writes:
>
>> This example combines the two using object graphics:
>>
>> IDL> oText = OBJ_NEW('IDLgrText', "I will !6do!X it ma!Z('F1'x)ana",
>> /ENABLE_FORMATTING)
>> IDL> xobjview, oText
>>
>> !6 switches to complex roman and !X gets you back to the entry font.
>
> Yes, I did get something like this working. What I couldn't
> figure out how to do (and I think this is what the original
> poster wanted) was how to get Greek symbols into his code.
> For example, I tried this:
>
> text = Obj_New('IDLgrText', ENABLE_FORMATTING=1, $
> "(!4!z(88)!X) Greek Symbol Omega", color=[0,0,128])
> XObjView, text
>
> Maybe I don't know how to read the octal table. But I see
> Font 4, the omega sign is 12x plus 10 octal is:
>
> IDL> Print, "120
> 88
>
> Why doesn't this work?
>
I think that you are looking at the vector font encodings and trying to
apply them to TrueType fonts.
So, you can go one way or the other:
TrueType:
text = Obj_New('IDLgrText', ENABLE_FORMATTING=1, $
"(!10W!X) Greek Symbol Omega", color=[0,0,128])
XObjView, text
Hershey vector fonts:
oFont = OBJ_NEW('IDLgrFont', 'Hershey')
xobjview, obj_new('idlgrtext', '(!4!Z(58)!X) Greek Symbol Omega',
FONT=oFont, /ENABLE_FORMATTING)
Karl
|
|
|
Re: Beyond 7-bit ASCII [message #40729 is a reply to message #40727] |
Mon, 30 August 2004 09:42  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Karl Schultz writes:
> This example combines the two using object graphics:
>
> IDL> oText = OBJ_NEW('IDLgrText', "I will !6do!X it ma!Z('F1'x)ana",
> /ENABLE_FORMATTING)
> IDL> xobjview, oText
>
> !6 switches to complex roman and !X gets you back to the entry font.
Yes, I did get something like this working. What I couldn't
figure out how to do (and I think this is what the original
poster wanted) was how to get Greek symbols into his code.
For example, I tried this:
text = Obj_New('IDLgrText', ENABLE_FORMATTING=1, $
"(!4!z(88)!X) Greek Symbol Omega", color=[0,0,128])
XObjView, text
Maybe I don't know how to read the octal table. But I see
Font 4, the omega sign is 12x plus 10 octal is:
IDL> Print, "120
88
Why doesn't this work?
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
Re: Beyond 7-bit ASCII [message #40730 is a reply to message #40729] |
Mon, 30 August 2004 09:25  |
Karl Schultz
Messages: 341 Registered: October 1999
|
Senior Member |
|
|
"Michael Wallace" <mwallace.no.spam@no.spam.swri.edu.invalid> wrote in
message news:10ivav36982atbd@corp.supernews.com...
> Is it possible to somehow reference characters in the 128 - 255 of a
> font table? I'm looking for an object graphics way to do this, not
> direct graphics if that matters.
>
> Also, is it possible to switch fonts with in an IDLgrText object? It
> appears that one and only font can apply to a text object at a time.
> I'd like to have a string that's normal English except for a couple
> Greek symbols in the middle. How can I do this? TIA,
>
This example combines the two using object graphics:
IDL> oText = OBJ_NEW('IDLgrText', "I will !6do!X it ma!Z('F1'x)ana",
/ENABLE_FORMATTING)
IDL> xobjview, oText
!6 switches to complex roman and !X gets you back to the entry font.
Karl
|
|
|
Re: Beyond 7-bit ASCII [message #40735 is a reply to message #40730] |
Mon, 30 August 2004 07:16  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Michael Wallace writes:
> Is it possible to somehow reference characters in the 128 - 255 of a
> font table? I'm looking for an object graphics way to do this, not
> direct graphics if that matters.
Typically, you access these character glyphs via their Unicode
value. For example, you are talking about tomorrow:
XYOUTS, 0.5, 0,5, Align=0.5, "I will do it ma!Z('F1'x)ana", $
Charsize=3, Normal=1
> Also, is it possible to switch fonts with in an IDLgrText object? It
> appears that one and only font can apply to a text object at a time.
> I'd like to have a string that's normal English except for a couple
> Greek symbols in the middle. How can I do this?
I don't know if this is possible. All of my experiments
have turned out negatively. :-(
Surely, there must be *some* way to do this! Karl!?
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
Re: Beyond 7-bit ASCII [message #40740 is a reply to message #40735] |
Sun, 29 August 2004 15:30  |
Mark Hadfield
Messages: 783 Registered: May 1995
|
Senior Member |
|
|
Michael Wallace wrote:
> Is it possible to somehow reference characters in the 128 - 255 of a
> font table? I'm looking for an object graphics way to do this, not
> direct graphics if that matters.
>
> Also, is it possible to switch fonts with in an IDLgrText object? It
> appears that one and only font can apply to a text object at a time. I'd
> like to have a string that's normal English except for a couple Greek
> symbols in the middle. How can I do this? TIA,
The following doesn't exactly answer either of your questions, but I
suggest you set the ENABLE_FORMATTING property on your IDLgrText object,
then read the documentation section entitled "Fonts/Embedded Formatting
Codes"
--
Mark Hadfield "Ka puwaha te tai nei, Hoea tatou"
m.hadfield@niwa.co.nz
National Institute for Water and Atmospheric Research (NIWA)
|
|
|