From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/31931 Path: news.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: Still have no idea about how to specify fonts in JavaScript fields. Date: Wed, 22 Nov 2006 15:03:14 +0100 Message-ID: <456458A2.9040104@wxs.nl> References: <769ba7780611220414m4ff61678rf3050912f086a8d9@mail.gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1164205772 10648 80.91.229.2 (22 Nov 2006 14:29:32 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 22 Nov 2006 14:29:32 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Wed Nov 22 15:29:29 2006 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by ciao.gmane.org with esmtp (Exim 4.43) id 1Gmt5y-00024J-1M for gctc-ntg-context-518@m.gmane.org; Wed, 22 Nov 2006 15:29:02 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 6E97B1FB8F; Wed, 22 Nov 2006 15:27:54 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 14275-04-6; Wed, 22 Nov 2006 15:27:47 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 5D6D71FB74; Wed, 22 Nov 2006 15:27:47 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 939721FA4C for ; Wed, 22 Nov 2006 15:27:44 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 13897-04-24 for ; Wed, 22 Nov 2006 15:27:41 +0100 (CET) Original-Received: from mail.pragma-ade.net (dsl-083-247-100-017.solcon.nl [83.247.100.17]) by ronja.ntg.nl (Postfix) with SMTP id 1F4FE1FF4B for ; Wed, 22 Nov 2006 15:02:09 +0100 (CET) Original-Received: from [10.100.1.104] (unverified [10.100.1.104]) by controller-1 (SurgeMail 3.7b8) with ESMTP id 19603 for multiple; Wed, 22 Nov 2006 15:03:14 +0100 User-Agent: Thunderbird 1.5.0.8 (Windows/20061025) Original-To: mailing list for ConTeXt users , Hartmut Henkel In-Reply-To: <769ba7780611220414m4ff61678rf3050912f086a8d9@mail.gmail.com> X-Server: High Performance Mail Server - http://surgemail.com r=-274017400 X-Authenticated-User: hagen@controller-1 X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.7 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:31931 Archived-At: 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 -----------------------------------------------------------------