ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Dubious "checksum mismatch" message on log file
@ 2012-02-01  1:09 Vladimir Lomov
  2012-02-01  1:37 ` luigi scarso
  0 siblings, 1 reply; 21+ messages in thread
From: Vladimir Lomov @ 2012-02-01  1:09 UTC (permalink / raw)
  To: General mailing list for ConTeXt users

Hello,
please consider the following example:
<example file="ex8.tex">
\starttext

\font\test=txr \test abs

\stoptext
</example>

I process this document with context (context --version -> 2012.01.25)
nothing suspecious in terminal output but in log file I see "checksum mismatch",
<terminal>
$ grep 'checksum' ex8.log
checksum mismatch in font txr.vf ignored 
</terminal>

Simple plain tex file
<example file="ex9.tex">
\font\test=txr \test abs
\bye
</example>

processed by luatex and pdftex engines (both from TeX Live 2011, I don't know
how to generate formats for them in context suite) doesn't give same message.

Is it a "bug" in font system of context?

P.S. There is a thread on tex-live mailing list about "checksum mismatch",
I took a little investigation that reveals the source of problem:
'luaotfload', adaptation of context font system for latex world. As you
can see from "ex8.tex", current context have the same behaviour. I'm not
fully sure if it is save to ignore this message (I read briefly about vf
fonts here: http://www.tex.ac.uk/tex-archive/help/virtual-fonts.knuth)
but as both pdftex and luatex engines give nothing on "plain" example I
want to report about this issue.

--
WBR, Vladimir Lomov

-- 
That's the thing about people who think they hate computers.  What they
really hate is lousy programmers.
		-- Larry Niven and Jerry Pournelle in "Oath of Fealty"
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Dubious "checksum mismatch" message on log file
  2012-02-01  1:09 Dubious "checksum mismatch" message on log file Vladimir Lomov
@ 2012-02-01  1:37 ` luigi scarso
  2012-02-01  6:00   ` Vladimir Lomov
  0 siblings, 1 reply; 21+ messages in thread
From: luigi scarso @ 2012-02-01  1:37 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 950 bytes --]

On Wed, Feb 1, 2012 at 2:09 AM, Vladimir Lomov <lomov.vl@gmail.com> wrote:

> Hello,
> please consider the following example:
> <example file="ex8.tex">
> \starttext
>
> \font\test=txr \test abs
>
> \stoptext
> </example>
>
> I process this document with context (context --version -> 2012.01.25)
> nothing suspecious in terminal output but in log file I see "checksum
> mismatch",
> <terminal>
> $ grep 'checksum' ex8.log
> checksum mismatch in font txr.vf ignored
> </terminal>
>
> Simple plain tex file
> <example file="ex9.tex">
> \font\test=txr \test abs
> \bye
> </example>
>
> processed by luatex and pdftex engines (both from TeX Live 2011, I don't
> know
> how to generate formats for them in context suite) doesn't give same
> message.
>
> Is it a "bug" in font system of context?
>
> My standalone also says
LuaTeX warning (file rtxptmr): Font rtxptmr at 600 not found
i.e I have not the font.
Maybe the tl2011 has this font ?


-- 
luigi

[-- Attachment #1.2: Type: text/html, Size: 1435 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Dubious "checksum mismatch" message on log file
  2012-02-01  1:37 ` luigi scarso
@ 2012-02-01  6:00   ` Vladimir Lomov
  2012-02-01  7:45     ` luigi scarso
  0 siblings, 1 reply; 21+ messages in thread
From: Vladimir Lomov @ 2012-02-01  6:00 UTC (permalink / raw)
  To: ntg-context

Hello,
** luigi scarso [2012-02-01 02:37:20 +0100]:

> On Wed, Feb 1, 2012 at 2:09 AM, Vladimir Lomov <lomov.vl@gmail.com> wrote:

>> Hello,
>> please consider the following example:
>> <example file="ex8.tex">
>> \starttext

>> \font\test=txr \test abs

>> \stoptext
>> </example>

>> I process this document with context (context --version -> 2012.01.25)
>> nothing suspecious in terminal output but in log file I see "checksum
>> mismatch",
>> <terminal>
>> $ grep 'checksum' ex8.log
>> checksum mismatch in font txr.vf ignored
>> </terminal>

>> Simple plain tex file
>> <example file="ex9.tex">
>> \font\test=txr \test abs
>> \bye
>> </example>

>> processed by luatex and pdftex engines (both from TeX Live 2011, I don't
>> know
>> how to generate formats for them in context suite) doesn't give same
>> message.

>> Is it a "bug" in font system of context?

>> My standalone also says
> LuaTeX warning (file rtxptmr): Font rtxptmr at 600 not found
> i.e I have not the font.
> Maybe the tl2011 has this font ?

I specially chose that font (txr, txr.tfm and txr.vf files), it is
distributed by txfonts "package". May be you installation doesn't have
them because I installed context suite with './first-setup.sh --modules=all'.

Nevertheless, that 'Font ... at 600 ...' reminds me how pdftex (pdflatex
actually) deals with tfm/mf/pk fonts (generate pk and insert them into
pdf file).

---
WBR, Vladimir Lomov

-- 
Never eat anything bigger than your head.
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Dubious "checksum mismatch" message on log file
  2012-02-01  6:00   ` Vladimir Lomov
@ 2012-02-01  7:45     ` luigi scarso
  2012-02-01  9:21       ` Vladimir Lomov
  0 siblings, 1 reply; 21+ messages in thread
From: luigi scarso @ 2012-02-01  7:45 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Vladimir Lomov

On Wed, Feb 1, 2012 at 7:00 AM, Vladimir Lomov <lomov.vl@gmail.com> wrote:

> I specially chose that font (txr, txr.tfm and txr.vf files), it is
> distributed by txfonts "package". May be you installation doesn't have
> them because I installed context suite with './first-setup.sh --modules=all'.
>
> Nevertheless, that 'Font ... at 600 ...' reminds me how pdftex (pdflatex
> actually) deals with tfm/mf/pk fonts (generate pk and insert them into
> pdf file).
Even with --modules=all'
LuaTeX warning (file rtxptmr): Font rtxptmr at 600 not found
and
$> pdffonts test.pdf

name                                 type              emb sub uni object ID
------------------------------------ ----------------- --- --- --- ---------
Error: font resource is not a dictionary
JFRMQG+LMRoman10-Regular             CID Type 0C       yes yes yes     18  0

It seems that this font is not a font of the suite.

-- 
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Dubious "checksum mismatch" message on log file
  2012-02-01  7:45     ` luigi scarso
@ 2012-02-01  9:21       ` Vladimir Lomov
  2012-02-01  9:54         ` luigi scarso
  0 siblings, 1 reply; 21+ messages in thread
From: Vladimir Lomov @ 2012-02-01  9:21 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hello,
** luigi scarso [2012-02-01 08:45:18 +0100]:

> On Wed, Feb 1, 2012 at 7:00 AM, Vladimir Lomov <lomov.vl@gmail.com> wrote:

>> I specially chose that font (txr, txr.tfm and txr.vf files), it is
>> distributed by txfonts "package". May be you installation doesn't have
>> them because I installed context suite with './first-setup.sh --modules=all'.

>> Nevertheless, that 'Font ... at 600 ...' reminds me how pdftex (pdflatex
>> actually) deals with tfm/mf/pk fonts (generate pk and insert them into
>> pdf file).
> Even with --modules=all'
> LuaTeX warning (file rtxptmr): Font rtxptmr at 600 not found
> and
> $> pdffonts test.pdf

> name                                 type              emb sub uni object ID
> ------------------------------------ ----------------- --- --- --- ---------
> Error: font resource is not a dictionary
> JFRMQG+LMRoman10-Regular             CID Type 0C       yes yes yes     18  0

> It seems that this font is not a font of the suite.

Let me stess it in other words: this ("Font ... not found") is not the
topic of thread. It is completely inrelated (IMHO) with vf font
problem (vf font leads to that "checksum" message). I took that font
because it has corresponding vf file.

The message "Font ... not found" is on terminal output while "checksum
mismatch" only in log file.

Ok, IIRC, if I want to use font with plain tex (pdftex engine) I have to
have TFM, and may be VF files, then MF source _or_ type1 font (pfb
file), if I have only type1 font, i.e. pfb+tfm[+vf] files, I must
instruct pdftex to use pfb file for corresponding tfm, this is what MAP
file do, e.g. file 'original-ams-cmr.map':
cmr10	CMR10	<cmr10.pfb
(I don't remember the purpose of second column), the first is TFM
file/font, the last one is type1 file (obviously). If there isn't such
entry for a font, pk for is generated from MF source. It MF source is
missing similar message is printed.

---
WBR, Vladimir Lomov

-- 
War isn't a good life, but it's life.
		-- Kirk, "A Private Little War", stardate 4211.8
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Dubious "checksum mismatch" message on log file
  2012-02-01  9:21       ` Vladimir Lomov
@ 2012-02-01  9:54         ` luigi scarso
  2012-02-01 13:48           ` Vladimir Lomov
                             ` (2 more replies)
  0 siblings, 3 replies; 21+ messages in thread
From: luigi scarso @ 2012-02-01  9:54 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Wed, Feb 1, 2012 at 10:21 AM, Vladimir Lomov <lomov.vl@gmail.com> wrote:
> Hello,
> ** luigi scarso [2012-02-01 08:45:18 +0100]:
>
>> On Wed, Feb 1, 2012 at 7:00 AM, Vladimir Lomov <lomov.vl@gmail.com> wrote:
>
>>> I specially chose that font (txr, txr.tfm and txr.vf files), it is
>>> distributed by txfonts "package". May be you installation doesn't have
>>> them because I installed context suite with './first-setup.sh --modules=all'.
>
>>> Nevertheless, that 'Font ... at 600 ...' reminds me how pdftex (pdflatex
>>> actually) deals with tfm/mf/pk fonts (generate pk and insert them into
>>> pdf file).
>> Even with --modules=all'
>> LuaTeX warning (file rtxptmr): Font rtxptmr at 600 not found
>> and
>> $> pdffonts test.pdf
>
>> name                                 type              emb sub uni object ID
>> ------------------------------------ ----------------- --- --- --- ---------
>> Error: font resource is not a dictionary
>> JFRMQG+LMRoman10-Regular             CID Type 0C       yes yes yes     18  0
>
>> It seems that this font is not a font of the suite.
>
> Let me stess it in other words: this ("Font ... not found") is not the
> topic of thread. It is completely inrelated (IMHO) with vf font
> problem (vf font leads to that "checksum" message). I took that font
> because it has corresponding vf file.
ok it was just to have as much data as possible.

We have

$>vftovp txr.vf
(VTITLE )
(FAMILY TXR)
(FACE F MRR)
(CODINGSCHEME TEX TEXT)
(DESIGNSIZE R 10.0)
(COMMENT DESIGNSIZE IS IN POINTS)
(COMMENT OTHER SIZES ARE MULTIPLES OF DESIGNSIZE)
(CHECKSUM O 32212676346)

while from  luatex source

source/texk/web2c/luatexdir/font/vfovf.w:
@ process a local font in \.{VF} file
@c
static internal_font_number
vf_def_font(internal_font_number f, unsigned char *vf_buffer, int *vf_cr)
{
:
unsigned long checksum;
    cs.b0 = vf_buffer[(*vf_cr)];
    cs.b1 = vf_buffer[(*vf_cr) + 1];
    cs.b2 = vf_buffer[(*vf_cr) + 2];
    cs.b3 = vf_buffer[(*vf_cr) + 3];
    (*vf_cr) += 4;
    checksum = (unsigned)
        (cs.b0 * 256 * 256 * 256 + cs.b1 * 256 * 256 + cs.b2 * 256 + cs.b3);
:

if (checksum != 0 && font_checksum(k) != 0
            && checksum != font_checksum(k))
            vf_local_font_warning(f, k, "checksum mismatch", (int) checksum,
                                  (int) font_checksum(k));
        if (ds != font_dsize(k))
            vf_local_font_warning(f, k, "design size mismatch", ds,
                                  font_dsize(k));


It's not related to MKIV but to luatex, and it's a warning.
It doesn't even matter to have --modules==all, this vf file  in the
standard standalone.
Of course you must have the pfb/afm or otf or ttf file, as usual,
otherwise the pdf is wrong

-- 
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Dubious "checksum mismatch" message on log file
  2012-02-01  9:54         ` luigi scarso
@ 2012-02-01 13:48           ` Vladimir Lomov
  2012-02-01 14:04             ` luigi scarso
  2012-02-01 14:15           ` Ulrike Fischer
  2012-02-02 12:30           ` luigi scarso
  2 siblings, 1 reply; 21+ messages in thread
From: Vladimir Lomov @ 2012-02-01 13:48 UTC (permalink / raw)
  To: ntg-context

Hello,
** luigi scarso [2012-02-01 10:54:04 +0100]:

> On Wed, Feb 1, 2012 at 10:21 AM, Vladimir Lomov <lomov.vl@gmail.com> wrote:
>> Hello,
>> ** luigi scarso [2012-02-01 08:45:18 +0100]:

>>> On Wed, Feb 1, 2012 at 7:00 AM, Vladimir Lomov <lomov.vl@gmail.com> wrote:

>>>> I specially chose that font (txr, txr.tfm and txr.vf files), it is
>>>> distributed by txfonts "package". May be you installation doesn't have
>>>> them because I installed context suite with './first-setup.sh --modules=all'.

>>>> Nevertheless, that 'Font ... at 600 ...' reminds me how pdftex (pdflatex
>>>> actually) deals with tfm/mf/pk fonts (generate pk and insert them into
>>>> pdf file).
>>> Even with --modules=all'
>>> LuaTeX warning (file rtxptmr): Font rtxptmr at 600 not found
>>> and
>>> $> pdffonts test.pdf

>>> name                                 type              emb sub uni object ID
>>> ------------------------------------ ----------------- --- --- --- ---------
>>> Error: font resource is not a dictionary
>>> JFRMQG+LMRoman10-Regular             CID Type 0C       yes yes yes     18  0

>>> It seems that this font is not a font of the suite.

>> Let me stess it in other words: this ("Font ... not found") is not the
>> topic of thread. It is completely inrelated (IMHO) with vf font
>> problem (vf font leads to that "checksum" message). I took that font
>> because it has corresponding vf file.
>ok it was just to have as much data as possible.

> We have

> $>vftovp txr.vf
> (VTITLE )
> (FAMILY TXR)
> (FACE F MRR)
> (CODINGSCHEME TEX TEXT)
> (DESIGNSIZE R 10.0)
> (COMMENT DESIGNSIZE IS IN POINTS)
> (COMMENT OTHER SIZES ARE MULTIPLES OF DESIGNSIZE)
> (CHECKSUM O 32212676346)

> while from  luatex source

> source/texk/web2c/luatexdir/font/vfovf.w:
> @ process a local font in \.{VF} file
> @c
> static internal_font_number
> vf_def_font(internal_font_number f, unsigned char *vf_buffer, int *vf_cr)
> {
> :
> unsigned long checksum;
>     cs.b0 = vf_buffer[(*vf_cr)];
>     cs.b1 = vf_buffer[(*vf_cr) + 1];
>     cs.b2 = vf_buffer[(*vf_cr) + 2];
>     cs.b3 = vf_buffer[(*vf_cr) + 3];
>     (*vf_cr) += 4;
>     checksum = (unsigned)
>         (cs.b0 * 256 * 256 * 256 + cs.b1 * 256 * 256 + cs.b2 * 256 + cs.b3);
> :

> if (checksum != 0 && font_checksum(k) != 0
>             && checksum != font_checksum(k))
>             vf_local_font_warning(f, k, "checksum mismatch", (int) checksum,
>                                   (int) font_checksum(k));
>         if (ds != font_dsize(k))
>             vf_local_font_warning(f, k, "design size mismatch", ds,
>                                   font_dsize(k));

> It's not related to MKIV but to luatex, and it's a warning.
> It doesn't even matter to have --modules==all, this vf file  in the
> standard standalone.
> Of course you must have the pfb/afm or otf or ttf file, as usual,
> otherwise the pdf is wrong

I was not sure, that why I began this thread. I started with latex example,
then strip it down to plain tex one and after that came to context
minimal example.

AFAIU, context suite doesn't have "plain" pdftex and luatex formats,
therefore I compile minimal plain tex example with TeX Live 2011, and
luatex doesn't print such message though it reads vf file.

The problem indeed may be it luatex and how it works with vf fonts, but
as I said, I'm not sure (don't know very well either plain tex or context).

P.S. Unrelated: seems I completely lost, I read web sources, the
quoted extract from luatex source and I don't understand how this
number '32212676346' can be presented as

cs.b0 * 256 * 256 * 256 + cs.b1 * 256 * 256 + cs.b2 * 256 + cs.b3

If I don't lose my math skills the '32212676346' is
32212676346=7·256^{4}+128·256^{3}+6·256^{2}+110·256^{1}+250·256^{0}

---
WBR, Vladimir Lomov

-- 
If only God would give me some clear sign!  Like making a large deposit
in my name at a Swiss bank.
		-- Woody Allen, "Without Feathers"
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Dubious "checksum mismatch" message on log file
  2012-02-01 13:48           ` Vladimir Lomov
@ 2012-02-01 14:04             ` luigi scarso
  2012-02-02  1:28               ` Vladimir Lomov
  0 siblings, 1 reply; 21+ messages in thread
From: luigi scarso @ 2012-02-01 14:04 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Wed, Feb 1, 2012 at 2:48 PM, Vladimir Lomov <lomov.vl@gmail.com> wrote:
>> We have
>
>> $>vftovp txr.vf
>> (VTITLE )
>> (FAMILY TXR)
>> (FACE F MRR)
>> (CODINGSCHEME TEX TEXT)
>> (DESIGNSIZE R 10.0)
>> (COMMENT DESIGNSIZE IS IN POINTS)
>> (COMMENT OTHER SIZES ARE MULTIPLES OF DESIGNSIZE)
>> (CHECKSUM O 32212676346)
>
>> while from  luatex source
>
>> source/texk/web2c/luatexdir/font/vfovf.w:
>> @ process a local font in \.{VF} file
>> @c
>> static internal_font_number
>> vf_def_font(internal_font_number f, unsigned char *vf_buffer, int *vf_cr)
>> {
>> :
>> unsigned long checksum;
>>     cs.b0 = vf_buffer[(*vf_cr)];
>>     cs.b1 = vf_buffer[(*vf_cr) + 1];
>>     cs.b2 = vf_buffer[(*vf_cr) + 2];
>>     cs.b3 = vf_buffer[(*vf_cr) + 3];
>>     (*vf_cr) += 4;
>>     checksum = (unsigned)
>>         (cs.b0 * 256 * 256 * 256 + cs.b1 * 256 * 256 + cs.b2 * 256 + cs.b3);
>> :
>
>> if (checksum != 0 && font_checksum(k) != 0
>>             && checksum != font_checksum(k))
>>             vf_local_font_warning(f, k, "checksum mismatch", (int) checksum,
>>                                   (int) font_checksum(k));
>>         if (ds != font_dsize(k))
>>             vf_local_font_warning(f, k, "design size mismatch", ds,
>>                                   font_dsize(k));
>
>> It's not related to MKIV but to luatex, and it's a warning.
>> It doesn't even matter to have --modules==all, this vf file  in the
>> standard standalone.
>> Of course you must have the pfb/afm or otf or ttf file, as usual,
>> otherwise the pdf is wrong
>
> I was not sure, that why I began this thread. I started with latex example,
> then strip it down to plain tex one and after that came to context
> minimal example.
it's also in pdftex: see
function vf_def_font
in
src/texk/web2c/pdftexdir/pdftex.web

>
> AFAIU, context suite doesn't have "plain" pdftex and luatex formats,
> therefore I compile minimal plain tex example with TeX Live 2011, and
> luatex doesn't print such message though it reads vf file.
Hm, have a look at
tex/texmf-context/tex/generic/context/luatex

>
> The problem indeed may be it luatex and how it works with vf fonts, but
> as I said, I'm not sure (don't know very well either plain tex or context).
>
> P.S. Unrelated: seems I completely lost, I read web sources, the
> quoted extract from luatex source and I don't understand how this
> number '32212676346' can be presented as
>
> cs.b0 * 256 * 256 * 256 + cs.b1 * 256 * 256 + cs.b2 * 256 + cs.b3
>
> If I don't lose my math skills the '32212676346' is
> 32212676346=7·256^{4}+128·256^{3}+6·256^{2}+110·256^{1}+250·256^{0}
IIRC, 32212676346 should be the checksum stored inside the file, ie
the font_checksum.


-- 
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Dubious "checksum mismatch" message on log file
  2012-02-01  9:54         ` luigi scarso
  2012-02-01 13:48           ` Vladimir Lomov
@ 2012-02-01 14:15           ` Ulrike Fischer
  2012-02-01 14:22             ` Hans Hagen
                               ` (2 more replies)
  2012-02-02 12:30           ` luigi scarso
  2 siblings, 3 replies; 21+ messages in thread
From: Ulrike Fischer @ 2012-02-01 14:15 UTC (permalink / raw)
  To: ntg-context

Am Wed, 1 Feb 2012 10:54:04 +0100 schrieb luigi scarso:

> It's not related to MKIV but to luatex.

I think it is related to MKIV (or more precisely to the fontloader).

It is a bit difficult to demonstrate it with context (how to you use
luatex without mkiv there?) but latex (or plain) it is quite easy:

The followings examples load pplr7t.vf.  Both give the checksum
mismatch message in the log if and only if the lua-fontloader
luaotfload it also loaded:

%LaTeX
\documentclass{article}
\usepackage{luaotfload}
\begin{document}
\font\test=pplr7t \test abc
\end{document}

%plain
\input luaotfload.sty
\font\test=pplr7t \test abc
\bye

So the code from luaotfload (which is based on the context
fontloader code) changes a checksum (either in the vf or in the
tfm-information) and so the check in the luatex engines fails.

(Imho it is only a minor problem, vf-fonts are not much used with
luatex).  


-- 
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Dubious "checksum mismatch" message on log file
  2012-02-01 14:15           ` Ulrike Fischer
@ 2012-02-01 14:22             ` Hans Hagen
  2012-02-02  1:21               ` Vladimir Lomov
  2012-02-01 14:47             ` luigi scarso
  2012-02-01 15:23             ` Khaled Hosny
  2 siblings, 1 reply; 21+ messages in thread
From: Hans Hagen @ 2012-02-01 14:22 UTC (permalink / raw)
  To: news3, mailing list for ConTeXt users

On 1-2-2012 15:15, Ulrike Fischer wrote:
> Am Wed, 1 Feb 2012 10:54:04 +0100 schrieb luigi scarso:
>
>> It's not related to MKIV but to luatex.
>
> I think it is related to MKIV (or more precisely to the fontloader).
>
> It is a bit difficult to demonstrate it with context (how to you use
> luatex without mkiv there?) but latex (or plain) it is quite easy:
>
> The followings examples load pplr7t.vf.  Both give the checksum
> mismatch message in the log if and only if the lua-fontloader
> luaotfload it also loaded:
>
> %LaTeX
> \documentclass{article}
> \usepackage{luaotfload}
> \begin{document}
> \font\test=pplr7t \test abc
> \end{document}
>
> %plain
> \input luaotfload.sty
> \font\test=pplr7t \test abc
> \bye
>
> So the code from luaotfload (which is based on the context
> fontloader code) changes a checksum (either in the vf or in the
> tfm-information) and so the check in the luatex engines fails.
>
> (Imho it is only a minor problem, vf-fonts are not much used with
> luatex).

Afaik nothing is done with a checksum. There is a checksum field in the 
loaded tfm but I don't think one has to be passed to luatex. Maybe one 
should be passed when a regular tfm file is used but even then, loading 
a vf file is independent.

So, it's best to just ignore that message.

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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Dubious "checksum mismatch" message on log file
  2012-02-01 14:15           ` Ulrike Fischer
  2012-02-01 14:22             ` Hans Hagen
@ 2012-02-01 14:47             ` luigi scarso
  2012-02-01 15:51               ` Khaled Hosny
  2012-02-01 15:23             ` Khaled Hosny
  2 siblings, 1 reply; 21+ messages in thread
From: luigi scarso @ 2012-02-01 14:47 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Wed, Feb 1, 2012 at 3:15 PM, Ulrike Fischer <news3@nililand.de> wrote:
> Am Wed, 1 Feb 2012 10:54:04 +0100 schrieb luigi scarso:
>
>> It's not related to MKIV but to luatex.
>
> I think it is related to MKIV (or more precisely to the fontloader).
The message can be reproduced also with luatex --fmt=luatex-plain.fmt
The font structure has a key checksum, but luatex doesn't use e by
default is zero
                from vf from tfm used value type
checksum yes     yes          no    number     default: 0
So maybe font_checksum is zero, and checksum is 32212676346
(i.e. the opposite that I wrote).
-- 
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Dubious "checksum mismatch" message on log file
  2012-02-01 14:15           ` Ulrike Fischer
  2012-02-01 14:22             ` Hans Hagen
  2012-02-01 14:47             ` luigi scarso
@ 2012-02-01 15:23             ` Khaled Hosny
  2012-02-02  8:54               ` Ulrike Fischer
  2 siblings, 1 reply; 21+ messages in thread
From: Khaled Hosny @ 2012-02-01 15:23 UTC (permalink / raw)
  To: news3, mailing list for ConTeXt users

On Wed, Feb 01, 2012 at 03:15:14PM +0100, Ulrike Fischer wrote:
> So the code from luaotfload (which is based on the context
> fontloader code) changes a checksum (either in the vf or in the
> tfm-information) and so the check in the luatex engines fails.

I tried printing the tfm table we pass to the backed, and the checksum
matches the one in the VF file, so this is a bit confusing and may be,
for some reason, luatex is comparing the checksums for different fonts,
but since this does not happen without the font loader it is likely to
be the culprit.

Regards,
 Khaled
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Dubious "checksum mismatch" message on log file
  2012-02-01 14:47             ` luigi scarso
@ 2012-02-01 15:51               ` Khaled Hosny
  0 siblings, 0 replies; 21+ messages in thread
From: Khaled Hosny @ 2012-02-01 15:51 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Wed, Feb 01, 2012 at 03:47:32PM +0100, luigi scarso wrote:
> On Wed, Feb 1, 2012 at 3:15 PM, Ulrike Fischer <news3@nililand.de> wrote:
> > Am Wed, 1 Feb 2012 10:54:04 +0100 schrieb luigi scarso:
> >
> >> It's not related to MKIV but to luatex.
> >
> > I think it is related to MKIV (or more precisely to the fontloader).
> The message can be reproduced also with luatex --fmt=luatex-plain.fmt
> The font structure has a key checksum, but luatex doesn't use e by
> default is zero
>                 from vf from tfm used value type
> checksum yes     yes          no    number     default: 0
> So maybe font_checksum is zero, and checksum is 32212676346
> (i.e. the opposite that I wrote).

So now that is a question to Taco, if checksum is not used by luatex,
why id there a difference when the font is loaded in the old way (i.e.
no callbacks involved) and when it is loaded define_font callback?

Regards,
 Khaled
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Dubious "checksum mismatch" message on log file
  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
  0 siblings, 2 replies; 21+ messages in thread
From: Vladimir Lomov @ 2012-02-02  1:21 UTC (permalink / raw)
  To: ntg-context

Hello,
** Hans Hagen [2012-02-01 15:22:58 +0100]:

> On 1-2-2012 15:15, Ulrike Fischer wrote:
> >Am Wed, 1 Feb 2012 10:54:04 +0100 schrieb luigi scarso:

>>>It's not related to MKIV but to luatex.

>>I think it is related to MKIV (or more precisely to the fontloader).

>>It is a bit difficult to demonstrate it with context (how to you use
>>luatex without mkiv there?) but latex (or plain) it is quite easy:

>>The followings examples load pplr7t.vf.  Both give the checksum
>>mismatch message in the log if and only if the lua-fontloader
>>luaotfload it also loaded:

>>%LaTeX
>>\documentclass{article}
>>\usepackage{luaotfload}
>>\begin{document}
>>\font\test=pplr7t \test abc
>>\end{document}

>>%plain
>>\input luaotfload.sty
>>\font\test=pplr7t \test abc
>>\bye

>>So the code from luaotfload (which is based on the context
>>fontloader code) changes a checksum (either in the vf or in the
>>tfm-information) and so the check in the luatex engines fails.

>>(Imho it is only a minor problem, vf-fonts are not much used with
>>luatex).

> Afaik nothing is done with a checksum. There is a checksum field in
> the loaded tfm but I don't think one has to be passed to luatex.
> Maybe one should be passed when a regular tfm file is used but even
> then, loading a vf file is independent.

> So, it's best to just ignore that message.

Correct me if I'm wrong, but this how I understand TFM font and currect
state of tex engines (actually pdftex, xetex and luatex):
1. to use any font in tex one need a TFM file (file name = fontname.TFM),
that file actually contain informationabout font, not how exatly glyphs
are constructed;
2. when [original] tex read a document file it searches for TFM and VF
files, read them and write DVI file with information about that files;
3. after that user can send file to printer or publisher to print it on
printer. As I understand the purpose of checksum was to be sure that
publisher or printer would use exatly the same fonts as user. If user
converts DVI file to PS/PDF one on his/she computer using dvips or
dvipdfm* the checksum mostly useless, assuming files are not corrupted.

Nowadays pdftex, xetex and luatex are widely used and most time users
generate PDF files on the same computer they write documents, send PDF
files which have they own mechanism to check font consistency.

But still there are [plenty] DVI files around, as well as luatex engine
might generate DVI file. The convertion to PS/PDF is performed by
dvips/dvipdfm* programs, that's ok. But what about luatex with DVI
output?

My conclusion:
1. if PDF output is only interesting then it is Ok, ignore that message,
because font information is already in PDF and PDF programs should deal
with it;
2. if DVI output is concerned then luatex _must_ be consistent with
pdftex (also can write DVI files), which, imho (don't check), takes care
about both TFM and VF checksums.

---
WBR, Vladimir Lomov

-- 
The happiest time of a person's life is after his first divorce.
		-- J.K. Galbraith 
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Dubious "checksum mismatch" message on log file
  2012-02-01 14:04             ` luigi scarso
@ 2012-02-02  1:28               ` Vladimir Lomov
  2012-02-02  1:34                 ` luigi scarso
  0 siblings, 1 reply; 21+ messages in thread
From: Vladimir Lomov @ 2012-02-02  1:28 UTC (permalink / raw)
  To: ntg-context

Hello,
** luigi scarso [2012-02-01 15:04:07 +0100]:
[...]

>> I was not sure, that why I began this thread. I started with latex example,
>> then strip it down to plain tex one and after that came to context
>> minimal example.
> it's also in pdftex: see
> function vf_def_font
> in
> src/texk/web2c/pdftexdir/pdftex.web

Will look in it.

>> AFAIU, context suite doesn't have "plain" pdftex and luatex formats,
>> therefore I compile minimal plain tex example with TeX Live 2011, and
>> luatex doesn't print such message though it reads vf file.
> Hm, have a look at
> tex/texmf-context/tex/generic/context/luatex

In my installation this directory doesn't have fmt files. In any case I
will look in it.

>> The problem indeed may be it luatex and how it works with vf fonts, but
>> as I said, I'm not sure (don't know very well either plain tex or context).

>> P.S. Unrelated: seems I completely lost, I read web sources, the
>> quoted extract from luatex source and I don't understand how this
>> number '32212676346' can be presented as

>> cs.b0 * 256 * 256 * 256 + cs.b1 * 256 * 256 + cs.b2 * 256 + cs.b3

>> If I don't lose my math skills the '32212676346' is
>> 32212676346=7·256^{4}+128·256^{3}+6·256^{2}+110·256^{1}+250·256^{0}
> IIRC, 32212676346 should be the checksum stored inside the file, ie
> the font_checksum.

Yes, that's right, but I forgot that this is octal number, therefore
032212676346=3526065382=210·256^{3}+43·256^{2}+124·256^{1}+230·256^{0},
so 210,43,124,230 are written in file as D2, 2B, 7C, E6 (which I found
in VF file :).

---
WBR, Vladimir Lomov

-- 
"The molars, I'm sure, will be all right, the molars can take care of
themselves," the old man said, no longer to me.  "But what will become 
of the bicuspids?"
		-- The Old Man and his Bridge
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Dubious "checksum mismatch" message on log file
  2012-02-02  1:28               ` Vladimir Lomov
@ 2012-02-02  1:34                 ` luigi scarso
  0 siblings, 0 replies; 21+ messages in thread
From: luigi scarso @ 2012-02-02  1:34 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Thu, Feb 2, 2012 at 2:28 AM, Vladimir Lomov <lomov.vl@gmail.com> wrote:
> Hello,
> ** luigi scarso [2012-02-01 15:04:07 +0100]:
> [...]
>
>>> I was not sure, that why I began this thread. I started with latex example,
>>> then strip it down to plain tex one and after that came to context
>>> minimal example.
>> it's also in pdftex: see
>> function vf_def_font
>> in
>> src/texk/web2c/pdftexdir/pdftex.web
>
> Will look in it.
>
>>> AFAIU, context suite doesn't have "plain" pdftex and luatex formats,
>>> therefore I compile minimal plain tex example with TeX Live 2011, and
>>> luatex doesn't print such message though it reads vf file.
>> Hm, have a look at
>> tex/texmf-context/tex/generic/context/luatex
>
> In my installation this directory doesn't have fmt files. In any case I
> will look in it.
yes, but you can generate it with
luatex --ini luatex-plain.tex


-- 
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Dubious "checksum mismatch" message on log file
  2012-02-02  1:21               ` Vladimir Lomov
@ 2012-02-02  8:43                 ` Ulrike Fischer
  2012-02-02  8:45                 ` Hans Hagen
  1 sibling, 0 replies; 21+ messages in thread
From: Ulrike Fischer @ 2012-02-02  8:43 UTC (permalink / raw)
  To: ntg-context

Am Thu, 2 Feb 2012 10:21:03 +0900 schrieb Vladimir Lomov:


> 1. if PDF output is only interesting then it is Ok, ignore that message,
> because font information is already in PDF and PDF programs should deal
> with it;

It doesn't depend on the output format. The checksum of vf and
tfm-files are compared and these files are used by pdflatex too. 


-- 
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Dubious "checksum mismatch" message on log file
  2012-02-02  1:21               ` Vladimir Lomov
  2012-02-02  8:43                 ` Ulrike Fischer
@ 2012-02-02  8:45                 ` Hans Hagen
  1 sibling, 0 replies; 21+ messages in thread
From: Hans Hagen @ 2012-02-02  8:45 UTC (permalink / raw)
  To: Vladimir Lomov, ntg-context

On 2-2-2012 02:21, Vladimir Lomov wrote:

> Correct me if I'm wrong, but this how I understand TFM font and currect
> state of tex engines (actually pdftex, xetex and luatex):

sort of wrong

> 1. to use any font in tex one need a TFM file (file name = fontname.TFM),
> that file actually contain informationabout font, not how exatly glyphs
> are constructed;

indeed, and when we forget about opentype etc only the tfm is needed

> 2. when [original] tex read a document file it searches for TFM and VF
> files, read them and write DVI file with information about that files;

no, the vf is only needed when the backend (which happens to be included 
in pdftex/luatex) is going to embed the glyph data from the font; only 
then it needs to know of a glyph is actually a virtual one

however, in luatex, due to different internals, vf files are / can be 
read in earlier as the virtual font model is part of the front end

so, it can be in an earlier stage that some mismatch can happen

> 3. after that user can send file to printer or publisher to print it on
> printer. As I understand the purpose of checksum was to be sure that
> publisher or printer would use exatly the same fonts as user. If user
> converts DVI file to PS/PDF one on his/she computer using dvips or
> dvipdfm* the checksum mostly useless, assuming files are not corrupted.

no, the checksum only is some safeguard that vf and tfm match

if you go through dvi then dvips or dvipdfmx read the vf files

> Nowadays pdftex, xetex and luatex are widely used and most time users
> generate PDF files on the same computer they write documents, send PDF
> files which have they own mechanism to check font consistency.
>
> But still there are [plenty] DVI files around, as well as luatex engine
> might generate DVI file. The convertion to PS/PDF is performed by
> dvips/dvipdfm* programs, that's ok. But what about luatex with DVI
> output?

i never use luatex with dvi output

> My conclusion:
> 1. if PDF output is only interesting then it is Ok, ignore that message,
> because font information is already in PDF and PDF programs should deal
> with it;
> 2. if DVI output is concerned then luatex _must_ be consistent with
> pdftex (also can write DVI files), which, imho (don't check), takes care
> about both TFM and VF checksums.

luatex probably is consistent although in most cases the way that it 
deals with fonts (read: the macro package deals with fonts) is different 
from the way it's done with pdftex/xetex

if i had the time i'd probably run a few tests and see where the 
mismatch happens but it has a real low priority for me

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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Dubious "checksum mismatch" message on log file
  2012-02-01 15:23             ` Khaled Hosny
@ 2012-02-02  8:54               ` Ulrike Fischer
  0 siblings, 0 replies; 21+ messages in thread
From: Ulrike Fischer @ 2012-02-02  8:54 UTC (permalink / raw)
  To: ntg-context

Am Wed, 1 Feb 2012 17:23:09 +0200 schrieb Khaled Hosny:


> I tried printing the tfm table we pass to the backed, and the checksum
> matches the one in the VF file, so this is a bit confusing 

Well I actually don't know what test is actually done (and why
exactly) but some remarks:

1. If I try to convert the binary "pplr7t.vf" to the readable
vpl-file I need *two* tfm-files: pplr7t.tfm and pplr8r.tfm. 

2. vftovp tells me during the conversion:
   "Check sum in VF file being replaced by TFM check sum" 
which probably means that the vpl-file doesn't contain the original
checksum(s) of the vf-file.

3. The vpl file contains two checksums:

(CHECKSUM O 25136566211)

and a checksum in the mapfont entry:

(MAPFONT D 0
   (FONTNAME pplr8r)
   (FONTCHECKSUM O 36571141413)
   (FONTAT R 1.0)
   (FONTDSIZE R 10.0)
   )

So which of both is actually checked against which tfm checksum (and
gives the mismatch message)?


Btw: Two years ago I ran against a checksum mismatch message
concerning the width of characters. In this case the culprit was a
different calculation method for tfm and vf:

http://tug.org/mailman/htdig/pdftex/2009-May/008035.html


-- 
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Dubious "checksum mismatch" message on log file
  2012-02-01  9:54         ` luigi scarso
  2012-02-01 13:48           ` Vladimir Lomov
  2012-02-01 14:15           ` Ulrike Fischer
@ 2012-02-02 12:30           ` luigi scarso
  2012-02-02 14:47             ` luigi scarso
  2 siblings, 1 reply; 21+ messages in thread
From: luigi scarso @ 2012-02-02 12:30 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Wed, Feb 1, 2012 at 10:54 AM, luigi scarso <luigi.scarso@gmail.com> wrote:
> On Wed, Feb 1, 2012 at 10:21 AM, Vladimir Lomov <lomov.vl@gmail.com> wrote:
>> Hello,
>> ** luigi scarso [2012-02-01 08:45:18 +0100]:
>>
>>> On Wed, Feb 1, 2012 at 7:00 AM, Vladimir Lomov <lomov.vl@gmail.com> wrote:
>>
>>>> I specially chose that font (txr, txr.tfm and txr.vf files), it is
>>>> distributed by txfonts "package". May be you installation doesn't have
>>>> them because I installed context suite with './first-setup.sh --modules=all'.
>>
>>>> Nevertheless, that 'Font ... at 600 ...' reminds me how pdftex (pdflatex
>>>> actually) deals with tfm/mf/pk fonts (generate pk and insert them into
>>>> pdf file).
>>> Even with --modules=all'
>>> LuaTeX warning (file rtxptmr): Font rtxptmr at 600 not found
>>> and
>>> $> pdffonts test.pdf
>>
>>> name                                 type              emb sub uni object ID
>>> ------------------------------------ ----------------- --- --- --- ---------
>>> Error: font resource is not a dictionary
>>> JFRMQG+LMRoman10-Regular             CID Type 0C       yes yes yes     18  0
>>
>>> It seems that this font is not a font of the suite.
>>
>> Let me stess it in other words: this ("Font ... not found") is not the
>> topic of thread. It is completely inrelated (IMHO) with vf font
>> problem (vf font leads to that "checksum" message). I took that font
>> because it has corresponding vf file.
> ok it was just to have as much data as possible.
>
> We have
>
> $>vftovp txr.vf
> (VTITLE )
> (FAMILY TXR)
> (FACE F MRR)
> (CODINGSCHEME TEX TEXT)
> (DESIGNSIZE R 10.0)
> (COMMENT DESIGNSIZE IS IN POINTS)
> (COMMENT OTHER SIZES ARE MULTIPLES OF DESIGNSIZE)
> (CHECKSUM O 32212676346)
>
> while from  luatex source
>
> source/texk/web2c/luatexdir/font/vfovf.w:
> @ process a local font in \.{VF} file
> @c
> static internal_font_number
> vf_def_font(internal_font_number f, unsigned char *vf_buffer, int *vf_cr)
> {
> :
> unsigned long checksum;
>    cs.b0 = vf_buffer[(*vf_cr)];
>    cs.b1 = vf_buffer[(*vf_cr) + 1];
>    cs.b2 = vf_buffer[(*vf_cr) + 2];
>    cs.b3 = vf_buffer[(*vf_cr) + 3];
>    (*vf_cr) += 4;
>    checksum = (unsigned)
>        (cs.b0 * 256 * 256 * 256 + cs.b1 * 256 * 256 + cs.b2 * 256 + cs.b3);
> :
>
> if (checksum != 0 && font_checksum(k) != 0
>            && checksum != font_checksum(k))
>            vf_local_font_warning(f, k, "checksum mismatch", (int) checksum,
>                                  (int) font_checksum(k));
>        if (ds != font_dsize(k))
>            vf_local_font_warning(f, k, "design size mismatch", ds,
>                                  font_dsize(k));
>
Sorry, it's not the right point:
it's this one:

@ some of these things happen twice, adding a define is simplest

@c
#define test_checksum()  { vf_byte(tmp_b0); vf_byte(tmp_b1);    \
    vf_byte(tmp_b2); vf_byte(tmp_b3);         \
    if (((tmp_b0 != 0) || (tmp_b1 != 0) || (tmp_b2 != 0) || (tmp_b3 != 0)) && \
  ((font_check_0(f) != 0) || (font_check_1(f) != 0) ||    \
   (font_check_2(f) != 0) || (font_check_3(f) != 0)) &&   \
  ((tmp_b0 != font_check_0(f)) || (tmp_b1 != font_check_1(f)) ||  \
   (tmp_b2 != font_check_2(f)) || (tmp_b3 != font_check_3(f)))) { \
      print_nlp();              \
      tprint("checksum mismatch in font ");     \
      tprint(font_name(f));         \
      tprint(".vf ignored "); } }


-- 
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Dubious "checksum mismatch" message on log file
  2012-02-02 12:30           ` luigi scarso
@ 2012-02-02 14:47             ` luigi scarso
  0 siblings, 0 replies; 21+ messages in thread
From: luigi scarso @ 2012-02-02 14:47 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2012-02-02 14:47 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-01  1:09 Dubious "checksum mismatch" message on log file 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 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).