comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: calligraphic font
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: calligraphic font [message #84509] Tue, 21 May 2013 11:29
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> I suppose the real problem is that there is no way I know of to obtain
> the current true-type font programmatically, and I want to use true-type
> fonts in PS_Start, so I define a default one. Humm. :-(

OK, here is the real problem. I see I've dealt with this before.

The real problem is that to get the PostScript device to use a true-type
font, you have to specify the font from *within* the PostScript device.
In other words, this command:

Device, Set_Font='Times', /TT_FONT

Has to be issued after the SET_PLOT, "PS" command. It does no good to
issue it at the IDL command line if you want to make a PostScript file.

Since PS_Start is issued at the IDL "command line" normally and sets up
the PostScript file for you, that is why you have to use the TT_FONT
keyword to specify the font:

PS_Start, TT_Font='Times'

This allows it to issue the proper command after the PostScript device
has been entered.

Then, of course, the PostScript device is "sticky" and it stays
configured until you change it to something else. If I could figure out
which true-type font was in effect at the command line (I don't know of
any way to do this), I could keep the PostScript output in sync.

One way to handle this would be to write a cgSet_TTFont command that
would set the true-type font for both the display and for PostScript
output. That way, I could keep things in sync. But, how many people
would use it?

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: calligraphic font [message #84510 is a reply to message #84509] Tue, 21 May 2013 10:28 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> No joy whatsoever, even after restarting IDL, etc., etc. :-(

I think it is time to retire again. I'm not having ANY luck today.

It finally dawned on me this might be a problem with how PS_Start works.
Sure enough, I can get the calligraphy font if I read my own
documentation and set the PostScript file up like this:

ps_start, tt_font='Brush Script MT Italic', font=1, 'tester.ps'
cgplot, cgdemodata(1), title='This is a Callegraphy Font'
ps_end, /png

So, I guess it works OK. Just more work needed in PS_Start, I guess.

I suppose the real problem is that there is no way I know of to obtain
the current true-type font programmatically, and I want to use true-type
fonts in PS_Start, so I define a default one. Humm. :-(

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: calligraphic font [message #84511 is a reply to message #84510] Tue, 21 May 2013 10:03 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> Well, this definitely doesn't work on my Windows computer. I don't know
> why. :-(

You know, Windows has a very strange permission set-up. It may be that
even though it *looks* like I am able to write into this ExelisVis
directory that I really can't. (This has happened to me before when
trying to change a library routine.) If I can't, then it is always the
*old* ttfont.map file that is getting read, which is why nothing ever
changes for me.

Device, Set_Font=fontname, /TT_Font will complain if I pass a name that
is not in the C:/Windows/Fonts folder, so I think that part is working.
But, clearly, IDL doesn't know anything about the font when I try to use
it. This command works:

device, set_font='Brush Script MT Italic', /tt_font

The relevant line in my ttfonts.map file is this, after I copied
the font to the IDL true-type fonts folder:

"Brush Script MT Italic" brushsci.ttf 0.625 1.0

No joy whatsoever, even after restarting IDL, etc., etc. :-(

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: calligraphic font [message #84512 is a reply to message #84511] Tue, 21 May 2013 09:53 Go to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On 5/21/13 10:50 AM, David Fanning wrote:
> Michael Galloy writes:
>
>> Sure, here is an example using Brush Script MT:
>>
>> http://michaelgalloy.com/wp-content/uploads/2013/05/calligra phic-font.ps
>>
>> Converted to an image:
>>
>> http://michaelgalloy.com/wp-content/uploads/2013/05/calligra phic-font.png
>>
>> I used MG_FONTS to install Brush Script MT:
>>
>> https://github.com/mgalloy/mglib/blob/master/src/vis/util/mg _fonts.pro
>>
>> I also had to change the name of the font file to BrushScript.ttf
>> (removing a space).
>>
>> mg_fonts, install={ mg_fonts_tt, $
>> name: 'Brush Script', $
>> filename: filepath('BrushScript.ttf',
>> root='~/Desktop'), $
>> direct_size: 0.625, $
>> object_size: 1.0 }
>
> Well, this definitely doesn't work on my Windows computer. I don't know
> why. :-(

Mine was on OS X, IDL 8.2.2.

Mike
--
Michael Galloy
www.michaelgalloy.com
Modern IDL: A Guide to IDL Programming (http://modernidl.idldev.com)
Research Mathematician
Tech-X Corporation
Re: calligraphic font [message #84513 is a reply to message #84512] Tue, 21 May 2013 09:50 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Michael Galloy writes:

> Sure, here is an example using Brush Script MT:
>
> http://michaelgalloy.com/wp-content/uploads/2013/05/calligra phic-font.ps
>
> Converted to an image:
>
> http://michaelgalloy.com/wp-content/uploads/2013/05/calligra phic-font.png
>
> I used MG_FONTS to install Brush Script MT:
>
> https://github.com/mgalloy/mglib/blob/master/src/vis/util/mg _fonts.pro
>
> I also had to change the name of the font file to BrushScript.ttf
> (removing a space).
>
> mg_fonts, install={ mg_fonts_tt, $
> name: 'Brush Script', $
> filename: filepath('BrushScript.ttf',
> root='~/Desktop'), $
> direct_size: 0.625, $
> object_size: 1.0 }

Well, this definitely doesn't work on my Windows computer. I don't know
why. :-(

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: calligraphic font [message #84514 is a reply to message #84513] Tue, 21 May 2013 09:32 Go to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On 5/21/13 6:32 AM, David Fanning wrote:
> bing999 writes:
>
>> Is it possible to use a calligraphic font with postscript fonts (!
>> p.font=0) to output as a pdf?
>> I tried all the fonts available according to exelis (http://
>> www.exelisvis.com/docs/Using_Device_Fonts.html) but none corresponds
>> to what I am looking for...
>
> In theory, you ought to be able to do this with true-type fonts:
>
> Device, Set_Font='Brush Script MT Italic', /TT_Font
> PS_Start, 'script.ps'
> cgText, 0.5, 0.5, /Normal, Align=0.5, Font=1, $
> 'This is test script with handwriting font.'
> PS_End, /PNG
>
> But, I've read the documenation five times now, followed directions
> EXACTLY as specified (modifing the ttfont.map file, etc.), and can't get
> it to work.
>
> This leads me to believe this functionality must be broken in IDL 8.2.2.
>
> Cheers,
>
> David
>

Sure, here is an example using Brush Script MT:

http://michaelgalloy.com/wp-content/uploads/2013/05/calligra phic-font.ps

Converted to an image:

http://michaelgalloy.com/wp-content/uploads/2013/05/calligra phic-font.png

I used MG_FONTS to install Brush Script MT:

https://github.com/mgalloy/mglib/blob/master/src/vis/util/mg _fonts.pro

I also had to change the name of the font file to BrushScript.ttf
(removing a space).

mg_fonts, install={ mg_fonts_tt, $
name: 'Brush Script', $
filename: filepath('BrushScript.ttf',
root='~/Desktop'), $
direct_size: 0.625, $
object_size: 1.0 }

Mike
--
Michael Galloy
www.michaelgalloy.com
Modern IDL: A Guide to IDL Programming (http://modernidl.idldev.com)
Research Mathematician
Tech-X Corporation
Re: calligraphic font [message #84525 is a reply to message #84514] Tue, 21 May 2013 05:32 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
bing999 writes:

> Is it possible to use a calligraphic font with postscript fonts (!
> p.font=0) to output as a pdf?
> I tried all the fonts available according to exelis (http://
> www.exelisvis.com/docs/Using_Device_Fonts.html) but none corresponds
> to what I am looking for...

In theory, you ought to be able to do this with true-type fonts:

Device, Set_Font='Brush Script MT Italic', /TT_Font
PS_Start, 'script.ps'
cgText, 0.5, 0.5, /Normal, Align=0.5, Font=1, $
'This is test script with handwriting font.'
PS_End, /PNG

But, I've read the documenation five times now, followed directions
EXACTLY as specified (modifing the ttfont.map file, etc.), and can't get
it to work.

This leads me to believe this functionality must be broken in IDL 8.2.2.

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: ENVI_SVM_DOIT
Next Topic: IDL 8.2 legend problem

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Oct 09 07:54:43 PDT 2025

Total time taken to generate the page: 0.71732 seconds