From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/66288 Path: news.gmane.org!not-for-mail From: Ulrike Fischer Newsgroups: gmane.comp.tex.context Subject: reencode fonts with fonts.trigger Date: Tue, 22 Feb 2011 16:22:00 +0100 Message-ID: <1o57kg5y2iy7y.dlg@nililand.de> Reply-To: news3@nililand.de, mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1298388182 23610 80.91.229.12 (22 Feb 2011 15:23:02 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 22 Feb 2011 15:23:02 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Tue Feb 22 16:22:57 2011 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Pru4n-0000e0-CT for gctc-ntg-context-518@m.gmane.org; Tue, 22 Feb 2011 16:22:57 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 065B5CAA51; Tue, 22 Feb 2011 16:22:57 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id PW8of4ad26z0; Tue, 22 Feb 2011 16:22:44 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id A288DCAA3B; Tue, 22 Feb 2011 16:22:44 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id AB4F4CAA3B for ; Tue, 22 Feb 2011 16:22:43 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id MCnxL0zp-XNb for ; Tue, 22 Feb 2011 16:22:23 +0100 (CET) Original-Received: from filter2-ams.mf.surf.net (filter2-ams.mf.surf.net [192.87.102.70]) by balder.ntg.nl (Postfix) with ESMTP id 2433CCAA34 for ; Tue, 22 Feb 2011 16:22:23 +0100 (CET) Original-Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by filter2-ams.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p1MFMLjf022589 for ; Tue, 22 Feb 2011 16:22:21 +0100 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Pru4A-0000Jl-KZ for ntg-context@ntg.nl; Tue, 22 Feb 2011 16:22:18 +0100 Original-Received: from p5b2a55be.dip.t-dialin.net ([91.42.85.190]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 22 Feb 2011 16:22:18 +0100 Original-Received: from news3 by p5b2a55be.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 22 Feb 2011 16:22:18 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 51 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: p5b2a55be.dip.t-dialin.net User-Agent: 40tude_Dialog/2.0.15.41de X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=80.91.229.12; country=NO; latitude=62.0000; longitude=10.0000; http://maps.google.com/maps?q=62.0000,10.0000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0rEb3mlix - 67312bb5076d - 20110222 X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.70 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 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 Xref: news.gmane.org gmane.comp.tex.context:66288 Archived-At: Hello, Khaled had another idea to manipulate (reencode) fonts: He suggested to put a function in fonts.trigger. (Example below). I have some questions regarding this example: 1. Is there a basic flaw in the idea? 2. Is the interface more or less stable or will it probably change in the future? If not 3. which tables/values in tfmdata must be copied/reassigned beside the indices information? (There seem to be quite a lot informations more than once in tfmdata. E.g. I find the boundingbox in two places (descriptions and shared.otfdata.glyphs)). 4. Which tables/values must be created if I try to move a char to a place which is currently empty (like the "z" in the example)? 5. What is the recommanded lua-code to copy/reassign/remap the tables? Does a library or some helper functions exist which would make it easier to move the tables around? \directlua{ local function chess(tfmdata,value) if value then tfmdata.characters[122]={} tfmdata.indices[75],tfmdata.indices[81],tfmdata.indices[122]=tfmdata.indices[81],tfmdata.indices[75],tfmdata.indices[81] table.tofile("filechess.lua", tfmdata, true) %show table end end table.insert(fonts.triggers,"chess") fonts.initializers.base.otf.chess = chess fonts.initializers.node.otf.chess = chess } \font\test="file:SkakNew-Figurine.otf:chess=yes" \starttext \test KQzK \stoptext \bye -- Ulrike Fischer ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________