ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Any idea about copy or clone fieldstack?
@ 2006-10-18  1:17 Zhichu Chen
  2006-10-19 12:11 ` Peter Rolf
  0 siblings, 1 reply; 3+ messages in thread
From: Zhichu Chen @ 2006-10-18  1:17 UTC (permalink / raw)



[-- Attachment #1.1: Type: text/plain, Size: 1499 bytes --]

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.

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?

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
                                               | www.sinap.ac.cn
----------------------------------------------------------------

[-- Attachment #1.2: Type: text/html, Size: 2242 bytes --]

[-- Attachment #2: Type: text/plain, Size: 139 bytes --]

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Any idea about copy or clone fieldstack?
  2006-10-18  1:17 Any idea about copy or clone fieldstack? Zhichu Chen
@ 2006-10-19 12:11 ` Peter Rolf
  2006-10-20  2:12   ` Zhichu Chen
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Rolf @ 2006-10-19 12:11 UTC (permalink / raw)


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@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Any idea about copy or clone fieldstack?
  2006-10-19 12:11 ` Peter Rolf
@ 2006-10-20  2:12   ` Zhichu Chen
  0 siblings, 0 replies; 3+ messages in thread
From: Zhichu Chen @ 2006-10-20  2:12 UTC (permalink / raw)



[-- Attachment #1.1: Type: text/plain, Size: 1627 bytes --]

Thank you very much Peter

On 10/19/06, Peter Rolf <indiego@gmx.net> wrote:
>
> Hi Chen,
>
>
> 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 ;)
>
> As I know, there is no command that clones a complete fieldstack.
> This is all a bit confusing without any example code.
>
> HTH, Peter
>
>
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
>
I've only read the "AcroJSGuide.pdf", and I thought it's all. Thank you to
tell me that there is a more detailed reference. I'll try it now.



-- 
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
                                               | www.sinap.ac.cn
----------------------------------------------------------------

[-- Attachment #1.2: Type: text/html, Size: 2624 bytes --]

[-- Attachment #2: Type: text/plain, Size: 139 bytes --]

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-10-20  2:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-18  1:17 Any idea about copy or clone fieldstack? Zhichu Chen
2006-10-19 12:11 ` Peter Rolf
2006-10-20  2:12   ` Zhichu Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).