From: luigi scarso <luigi.scarso@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Dubious "checksum mismatch" message on log file
Date: Thu, 2 Feb 2012 15:47:43 +0100 [thread overview]
Message-ID: <CAG5iGsCo_V-67oOaszcbCKiK00y3coaAYzorapyZq=Jt1xsY8A@mail.gmail.com> (raw)
In-Reply-To: <CAG5iGsC-o97gYNXdZHLg0zr=sS83dorh7SOsMOY-TfV6c4aFyQ@mail.gmail.com>
Basically it seems coherent with the luatex manual (ch. 7 Font structure):
luatex read the txr.tfm file and set the checksum to the unsigned int 0
(luafont.w ,int font_from_lua(lua_State * L, int f)) (but see Note below)
Then read the vf
(dofont.w, do_vf(f) inside static int do_define_font(int f, const char
*cnom, scaled s, int natural_dir))
do_vf(f) calculate the checksum of the vf file vua test_checksum() macro,
and find that the vf file has checksum
210 43 124 230 =>(210*2^24)+(43*2^16)+(124*2^8)+230=3526065382= oct 32212676346
vs
128 0 0 0
and hence the warning of mismatch.
Note:
The last sequence 128 0 0 0 (i.e. 0) it is due to
i = numeric_field(L, "checksum", 0);
set_font_checksum(f, (unsigned) i);
where
static int numeric_field(lua_State * L, const char *name, int dflt)
{
int i = dflt;
lua_pushstring(L, name);
lua_rawget(L, -2);
if (lua_isnumber(L, -1)) {
i = lua_roundnumber(L, -1);
}
lua_pop(L, 1);
return i;
}
and
#define lua_roundnumber(a,b) (int)floor((double)lua_tonumber(L,-1)+0.5)
I think one can avoid the warning if set the checksum field to the
correct value by the define_font callback on the lua side.
--
luigi
___________________________________________________________________________________
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
___________________________________________________________________________________
prev parent reply other threads:[~2012-02-02 14:47 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-01 1:09 Vladimir Lomov
2012-02-01 1:37 ` luigi scarso
2012-02-01 6:00 ` Vladimir Lomov
2012-02-01 7:45 ` luigi scarso
2012-02-01 9:21 ` Vladimir Lomov
2012-02-01 9:54 ` luigi scarso
2012-02-01 13:48 ` Vladimir Lomov
2012-02-01 14:04 ` luigi scarso
2012-02-02 1:28 ` Vladimir Lomov
2012-02-02 1:34 ` luigi scarso
2012-02-01 14:15 ` Ulrike Fischer
2012-02-01 14:22 ` Hans Hagen
2012-02-02 1:21 ` Vladimir Lomov
2012-02-02 8:43 ` Ulrike Fischer
2012-02-02 8:45 ` Hans Hagen
2012-02-01 14:47 ` luigi scarso
2012-02-01 15:51 ` Khaled Hosny
2012-02-01 15:23 ` Khaled Hosny
2012-02-02 8:54 ` Ulrike Fischer
2012-02-02 12:30 ` luigi scarso
2012-02-02 14:47 ` luigi scarso [this message]
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='CAG5iGsCo_V-67oOaszcbCKiK00y3coaAYzorapyZq=Jt1xsY8A@mail.gmail.com' \
--to=luigi.scarso@gmail.com \
--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).