From: Hans Hagen <pragma@wxs.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Problem with "fontdata.cache" being set to "no" in font-def.lua
Date: Wed, 17 Jun 2009 19:17:43 +0200 [thread overview]
Message-ID: <4A392537.7060802@wxs.nl> (raw)
In-Reply-To: <c3f901470906170810p428a7502ufa7be3021409690@mail.gmail.com>
Yanrui Li wrote:
>> the cache option mentioned there is not meant for using, just for debugging
>> (i.e. for myself)
> I have printed the the shared descriptions with the following code fragment:
>
> function f4zhcn.pre_linebreak_filter (head, groupcode)
> for t in node.traverse(head) do
> if is_cjk_ideo (t) then
> texio.write_nl ('*** CJK Ideo ***')
> elseif is_cjk_puncts (t) then
> texio.write_nl ('*** CJK Punct ***')
> for k in pairs(font.fonts[t.font]) do
> texio.write_nl (k)
> end
> end
> end
> return true
> end
>
> With "fontdata.cache = 'no'", I just got:
as we cache fonts at the lua end we don't want interference at the tex
end (not duplicate table creation); the no tells luatex not to manage a
cache at the tex end (i.e. no free not creation)
the "no" tells luatex not to keep a reference to the table it gets
passed and when you then use font.fonts it will recreate a table from
the data at the tex end and descriptions (and of course all other extra
that i create and manage at the lua end is not available)
at the lua end you can use fonts.ids[id] instead and then you will get a
descriptions (and leave the fontdata.cache key untouched unless you want
to waste memory and runtime)
Hans
ps. i will look into this bbox based compensation once we have a proper
set of guaranteed correct standard cjk fonts in tex live and i've
figured out a robust way to deal with it; i had code for it but threw it
away out when i ran into conflicts with opentype features that do
similar things and fonts that were inconsistent
-----------------------------------------------------------------
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
-----------------------------------------------------------------
___________________________________________________________________________________
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 : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
next prev parent reply other threads:[~2009-06-17 17:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-17 7:47 Yanrui Li
2009-06-17 14:45 ` Hans Hagen
2009-06-17 15:10 ` Yanrui Li
2009-06-17 17:17 ` Hans Hagen [this message]
2009-06-17 17:42 ` Yanrui Li
2009-06-18 3:03 ` Yanrui Li
2009-06-18 14:04 ` 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=4A392537.7060802@wxs.nl \
--to=pragma@wxs.nl \
--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).