[NTG-context] Any idea about copy or clone fieldstack?

Peter Rolf indiego at gmx.net
Thu Oct 19 14:11:08 CEST 2006

Hi Chen,

Zhichu Chen wrote:
> Hello everyone,
> I want to display dynamic system time on each page of my presentation.
> Displaying system time can be manipulated by JavaScript but, a field can
> be shown only once. So I used clone field and it works very well for me.
> But when I want to change the font (xxx presents the variable that gets
> the field):
> ------------------------------------------------
> xxx.textFont = font.LucidaBright ;
> ------------------------------------------------
> it can be compiled successfully, but when I open it with acrobat reader,
> there are many errors from javascript console. So I think that JS don't
> know the font, and I don't know how to embed the font into pdf file and
> make JS knows it.
Have you tried the method described on page 402-403 of the "Acrobat
JavaScript Scripting Reference" (AcroJS.pdf, 27.06.2005)? Search for
"Use of arbitrary fonts".
If I understand it right, all you need is the *right name* of the font
(as JS sees/names it).
[ Acrobat is required, but the trial version should work. Maybe also
"Adobe Type Manager Light" for the clean installation of a ps font under
XP. ]

To make sure that all clock relevant types are embeded, you can add
something like

\smashedhbox{\color[white]\<YOURCLOCKFONT> 0123456789:}

to your document.

This is all untested, so don't expect too much...
But let me know if it works ;)

> Then I turned to use field stacks. I use MetaPost to draw some needles
> and use JS to set_Field the fieldstack to the correct frame. But when I
> want to display the second clock, it seems that I should write another
> JS code to control the other fieldstack.
> So is there some command that clones the fieldstack just like
> \copyfield? Or how to assign the font of the field as I like?
As I know, there is no command that clones a complete fieldstack.
This is all a bit confusing without any example code.

HTH, Peter

> Thank you.
> -- 
> Sincerely yours,
> Chen
> ----------------------------------------------------------------
>           Zhi-chu Chen | Shanghai Synchrotron Radiation Facility
>          No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China
>              tel: 086 21 5955 3405 | zhichu.chen.googlepages.com
> <http://zhichu.chen.googlepages.com>
>                                                | www.sinap.ac.cn
> <http://www.sinap.ac.cn>
> ----------------------------------------------------------------
> ------------------------------------------------------------------------
> _______________________________________________
> ntg-context mailing list
> ntg-context at ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context

More information about the ntg-context mailing list