ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Ulrike Fischer <news3@nililand.de>
To: ntg-context@ntg.nl
Subject: reencode fonts with fonts.trigger
Date: Tue, 22 Feb 2011 16:22:00 +0100	[thread overview]
Message-ID: <1o57kg5y2iy7y.dlg@nililand.de> (raw)

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
___________________________________________________________________________________


             reply	other threads:[~2011-02-22 15:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-22 15:22 Ulrike Fischer [this message]
2011-02-22 17:05 ` Hans Hagen
2011-02-23 16:46   ` Ulrike Fischer
2011-02-22 19:29 ` Hans Hagen
2011-02-23 17:05   ` Ulrike Fischer
2011-02-25 12:30     ` Hans Hagen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1o57kg5y2iy7y.dlg@nililand.de \
    --to=news3@nililand.de \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).