Zhichu Chen wrote:
Hello everyone,
Thanks for suggesting some great documents last time. But after looking up in AcroJS Guide, and PDF Reference , etc., I still don't know how can I use special fonts in a JavaScript field.
My JS code is: ------------------------------------------------------------------------------------------ function start_clock() { var thetime=new Date(); var nhours=thetime.getHours(); var nmins=thetime.getMinutes(); var nsecn=thetime.getSeconds(); if (nhours<0) nhours="0"+nhours; if (nsecn<10) nsecn="0"+nsecn; if (nmins<10) nmins="0"+nmins; font.Digital = font.CourBI ; vv = this.getField("time.clock") ; if (vv) { vv.value = nhours+":"+nmins+":"+nsecn; vv.readonly = true ; vv.textColor = color.red ; vv.textFont = font.Digital ; // font.TimesBI Cour HelvB Symbol ZapfD this.dirty = false }}
timeout=app.setInterval('start_clock()',1000); ------------------------------------------------------------------------------------------
I guess there are already some definitions about ``font.CourBI'' but where can I find the original code of the definition which I can imitate it to create a new font.
\startJScode{oeps} var f = this.getField("TestField") ; if (f) { if (f.textFont == "Times-Roman") { f.textFont = "LMRoman12-Regular"; } else { f.textFont = "Times-Roman"; } } \stopJScode \setupinteraction[state=start] \pdfcompresslevel=0 \starttext \definefield[TestField][text] [TestGroup][][some example text] \definefield[FontField][check][FontGroup][yes,no][no] \definesymbol[yes][\strut YES] \definesymbol[no] [\strut NO] \setupfield[TestGroup][none][width=10cm] \setupfield[FontGroup][none][width=3cm,height=2cm,clickin=JS(oeps)] \field[TestField] \field[FontField] abcdefghijklmnopqrstuvwxyz \stoptext The problem is that a subsetted font has no known name (prefix is random); however, when embedded full it does not work either ("Courier" does work). Maybe there is special trickery needed to let acrobat know what fonts can be used. We may as well need some new pdftex code for this. I cc to Hartmut who is the pdftex teams weird-font-issues wizzard. Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------