ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Problem with "fontdata.cache" being set to "no" in font-def.lua
@ 2009-06-17  7:47 Yanrui Li
  2009-06-17 14:45 ` Hans Hagen
  0 siblings, 1 reply; 7+ messages in thread
From: Yanrui Li @ 2009-06-17  7:47 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi Hans,

I am testing comperssion of Chinese punctuations according
boundingbox. But I found that the "fontdata.cache" in font-def.lua is
set to "no", so I can't get the boundingbox information of those
punctuation glyphs in my module. I want to know why set to "no" as
default. Is it for efficiency?

-- 
Best regards,
Li Yanrui
___________________________________________________________________________________
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
___________________________________________________________________________________


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

* Re: Problem with "fontdata.cache" being set to "no" in font-def.lua
  2009-06-17  7:47 Problem with "fontdata.cache" being set to "no" in font-def.lua Yanrui Li
@ 2009-06-17 14:45 ` Hans Hagen
  2009-06-17 15:10   ` Yanrui Li
  0 siblings, 1 reply; 7+ messages in thread
From: Hans Hagen @ 2009-06-17 14:45 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Yanrui Li wrote:
> Hi Hans,
> 
> I am testing comperssion of Chinese punctuations according
> boundingbox. But I found that the "fontdata.cache" in font-def.lua is
> set to "no", so I can't get the boundingbox information of those
> punctuation glyphs in my module. I want to know why set to "no" as
> default. Is it for efficiency?

bbinfo sits in the shared descriptions (that travel with each font) and 
as such is unrelated to the cache

the cache option mentioned there is not meant for using, just for 
debugging (i.e. for myself)

Hans


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


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

* Re: Problem with "fontdata.cache" being set to "no" in font-def.lua
  2009-06-17 14:45 ` Hans Hagen
@ 2009-06-17 15:10   ` Yanrui Li
  2009-06-17 17:17     ` Hans Hagen
  0 siblings, 1 reply; 7+ messages in thread
From: Yanrui Li @ 2009-06-17 15:10 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

2009/6/17 Hans Hagen <pragma@wxs.nl>

> Yanrui Li wrote:
>
>> Hi Hans,
>>
>> I am testing comperssion of Chinese punctuations according
>> boundingbox. But I found that the "fontdata.cache" in font-def.lua is
>> set to "no", so I can't get the boundingbox information of those
>> punctuation glyphs in my module. I want to know why set to "no" as
>> default. Is it for efficiency?
>>
>
> bbinfo sits in the shared descriptions (that travel with each font) and as
> such is unrelated to the cache
>
> 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:

*** CJK Punct ***
checksum
direction
MathConstants
encodingbytes
filename
format
designsize
area
type
tounicode
characters
embedding
parameters
name
extend
used
slant
fullname
size

Only with "fontdata.cache = 'yes'", I can get:

 *** CJK Punct ***
direction
boundarychar_label
marks
encodingbytes
factor
filename
descriptions
... ...


-- 
Best regards,
Li Yanrui

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

[-- Attachment #2: Type: text/plain, Size: 487 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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Problem with "fontdata.cache" being set to "no" in font-def.lua
  2009-06-17 15:10   ` Yanrui Li
@ 2009-06-17 17:17     ` Hans Hagen
  2009-06-17 17:42       ` Yanrui Li
  2009-06-18  3:03       ` Yanrui Li
  0 siblings, 2 replies; 7+ messages in thread
From: Hans Hagen @ 2009-06-17 17:17 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________


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

* Re: Problem with "fontdata.cache" being set to "no" in font-def.lua
  2009-06-17 17:17     ` Hans Hagen
@ 2009-06-17 17:42       ` Yanrui Li
  2009-06-18  3:03       ` Yanrui Li
  1 sibling, 0 replies; 7+ messages in thread
From: Yanrui Li @ 2009-06-17 17:42 UTC (permalink / raw)
  To: mailing list for ConTeXt users

2009/6/18 Hans Hagen <pragma@wxs.nl>:
> 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)
>

Ok, I see. many thanks!

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

I am just playing with luatex and learning it. Then I want to do
something for Chinese temporarily with Wolfgang's simplefonts module
because I need it for some documents of mine now.

-- 
Best regards,
Li Yanrui
___________________________________________________________________________________
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
___________________________________________________________________________________

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

* Re: Problem with "fontdata.cache" being set to "no" in font-def.lua
  2009-06-17 17:17     ` Hans Hagen
  2009-06-17 17:42       ` Yanrui Li
@ 2009-06-18  3:03       ` Yanrui Li
  2009-06-18 14:04         ` Hans Hagen
  1 sibling, 1 reply; 7+ messages in thread
From: Yanrui Li @ 2009-06-18  3:03 UTC (permalink / raw)
  To: mailing list for ConTeXt users

2009/6/18 Hans Hagen <pragma@wxs.nl>
>
> 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
>

Is there a way to provide some key parameters to users and allow them
to adjust these parameters in tex for the specific cjk fonts? For
Chinese fonts (because I just understand Chinese) I don't think those
opentype features is very useful. In general situation, we just need:

1. insert glue between Chinese glyph nodes for linebreak
2. reduce the spaces between Chinese punctuations
3. process protruding of punctuations which appear in margin.

If users can set up some parameters to control these features
according specific situation, maybe we do not need correct standard
CJK fonts. What I mean is that we can make an abstract layer for CJK
fonts. I don't know wether your plan is that or not.

--
Best regards,
Li Yanrui
___________________________________________________________________________________
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
___________________________________________________________________________________

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

* Re: Problem with "fontdata.cache" being set to "no" in font-def.lua
  2009-06-18  3:03       ` Yanrui Li
@ 2009-06-18 14:04         ` Hans Hagen
  0 siblings, 0 replies; 7+ messages in thread
From: Hans Hagen @ 2009-06-18 14:04 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Yanrui Li wrote:

> 1. insert glue between Chinese glyph nodes for linebreak

there is a mechanism for that already

> 2. reduce the spaces between Chinese punctuations

this is on the todlist (once we have fonts and time)

> 3. process protruding of punctuations which appear in margin.

this is already possible

Hans

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


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

end of thread, other threads:[~2009-06-18 14:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-17  7:47 Problem with "fontdata.cache" being set to "no" in font-def.lua Yanrui Li
2009-06-17 14:45 ` Hans Hagen
2009-06-17 15:10   ` Yanrui Li
2009-06-17 17:17     ` Hans Hagen
2009-06-17 17:42       ` Yanrui Li
2009-06-18  3:03       ` Yanrui Li
2009-06-18 14:04         ` Hans Hagen

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).