ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
To: news3@nililand.de, mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: manipulate ttf-fonts loaded with luatex
Date: Tue, 02 Nov 2010 16:40:13 +0100	[thread overview]
Message-ID: <4CD030DD.5020906@wxs.nl> (raw)
In-Reply-To: <w5kp80nr6xrw$.dlg@nililand.de>

On 2-11-2010 4:16, Ulrike Fischer wrote:

> and store it in a table. I need a way to reencode/reorder the font,
> so that the input "K" points to the glyph "c140". Pirat is not the
> only chessfont I have, I don't want to change the input if I change
> the font, so every chessfont should have the same internal order.

(1) you can write your own fontloader (which in the case of a symbol 
font is no big deal, i.e. just slots and dimensions and 1-to-1 mapping 
as no unicode is needed, and info about that can be found in the luatex 
manual)

(2) you can intercept the table just before it is passed to tex (for 
which you need to look into the bit of code that latex i.e. just before 
font.define is called and the table passed is the one that needs to be 
tweaked, that table conforms to the luatex spec)

> My main problem is that they are so few informations about the
> generic context font loader code. E.g. after the rereading of the
> luatex manual I came up with the following:

(3) some day I'll probably document the relevant (and public) part of 
the low level interface; till then the source is the documentation 
(probably of not much use outside context as we have a different font model)

> 1. Why is the spacing in \testb wrong if the chars have been already
> used after \test?

because the font is already loaded and frozen

> 2. Which values/tables in mytable should I reset/change too to get a
> "sane" font \testb?

whatever value you want, but before the font is passed to tex (so before 
font.define is called cq. the font define callback is finished in the 
latex code)

> 3. I can also use "mytable=fonts.ids[font.id('test')]". Is this
> better? What are the differences?

fonts.ids accessed the font info that lives at the tex end but changing 
values like widths won't have any effect on tex as they are frozen 
already (after all they end up in backend code as well)

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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:[~2010-11-02 15:40 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-27 10:37 Ulrike Fischer
2010-10-27 18:35 ` Aditya Mahajan
2010-10-27 20:01   ` Ulrike Fischer
2010-10-27 21:32     ` Aditya Mahajan
2010-10-28  8:34       ` Ulrike Fischer
2010-10-28 12:33         ` Hans Hagen
2010-10-28 12:57           ` Ulrike Fischer
2010-10-28 13:08             ` Taco Hoekwater
2010-10-28 13:29               ` Ulrike Fischer
2010-10-28 13:33               ` Khaled Hosny
2010-10-28 14:59                 ` Hans Hagen
2010-10-28 15:37                   ` Ulrike Fischer
2010-10-28 16:01                     ` Hans Hagen
2010-10-28 17:08                       ` Ulrike Fischer
2010-10-28 17:17                         ` Hans Hagen
2010-10-28 17:48                           ` Ulrike Fischer
2010-10-28 18:56                             ` Hans Hagen
2010-11-02 15:16                               ` Ulrike Fischer
2010-11-02 15:40                                 ` Hans Hagen [this message]
2010-10-28 19:35                             ` Hans Hagen
2010-10-28 19:46                               ` Khaled Hosny
2010-10-28 20:29                                 ` Hans Hagen
2010-10-28 15:48                   ` Taco Hoekwater
2010-10-28 15:59                     ` Khaled Hosny
2010-10-28 16:06                       ` Hans Hagen
2010-10-28 16:29                       ` Hans Hagen
2010-10-28 16:47                     ` Ulrike Fischer
2010-10-28 17:03                       ` taco
2010-10-28 19:48                         ` Khaled Hosny
2010-10-28 13:10             ` Hans Hagen
2010-10-28 13:34               ` Ulrike Fischer

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=4CD030DD.5020906@wxs.nl \
    --to=pragma@wxs.nl \
    --cc=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).