ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* \char not working with private unicodes
@ 2021-05-11 12:08 Jairo A. del Rio
  2021-05-11 13:16 ` Hans Hagen
  2021-05-13  6:46 ` Sergio Callegari
  0 siblings, 2 replies; 10+ messages in thread
From: Jairo A. del Rio @ 2021-05-11 12:08 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Hi, list! Following this thread:
https://tex.stackexchange.com/questions/596610/how-to-use-luatex-with-large-unicode-codepoint,
I tried to replicate it in ConTeXt. Both LMTX and LMTX fail to display the
right symbol and, as it's discussed in the linked page, there's an offset
by 14. Is this intentional (in ConTeXt)? A bug? Minimal (non-)working
example:


%Font available here: https://materialdesignicons.com/

\starttext

\definedfont[file:materialdesignicons-webfont.ttf]\char"F1372\relax

\stoptext

Thanks in advance.

Cordially,

Jairo

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

[-- Attachment #2: Type: text/plain, Size: 493 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: \char not working with private unicodes
  2021-05-11 12:08 \char not working with private unicodes Jairo A. del Rio
@ 2021-05-11 13:16 ` Hans Hagen
  2021-05-11 13:40   ` Taco Hoekwater
  2021-05-13  6:46 ` Sergio Callegari
  1 sibling, 1 reply; 10+ messages in thread
From: Hans Hagen @ 2021-05-11 13:16 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Jairo A. del Rio

On 5/11/2021 2:08 PM, Jairo A. del Rio wrote:
> Hi, list! Following this thread: 
> https://tex.stackexchange.com/questions/596610/how-to-use-luatex-with-large-unicode-codepoint 
> <https://tex.stackexchange.com/questions/596610/how-to-use-luatex-with-large-unicode-codepoint>, 
> I tried to replicate it in ConTeXt. Both LMTX and LMTX fail to display 
> the right symbol and, as it's discussed in the linked page, there's an 
> offset by 14. Is this intentional (in ConTeXt)? A bug? Minimal 
> (non-)working example:
> 
> 
> %Font available here: https://materialdesignicons.com/ 
> <https://materialdesignicons.com/>
> 
> \starttext
> 
> \definedfont[file:materialdesignicons-webfont.ttf]\char"F1372\relax
> 
> \stoptext
You need to employ a sense of humour for that font:

\starttext
     \definefontfeature[materialicons][default][rlig=yes]
     \definedfont[file:materialiconsregular.ttf*materialicons]
     baby_changing_station
\stoptext


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: \char not working with private unicodes
  2021-05-11 13:16 ` Hans Hagen
@ 2021-05-11 13:40   ` Taco Hoekwater
  2021-05-11 15:31     ` Hans Hagen
  2021-05-12  7:20     ` luigi scarso
  0 siblings, 2 replies; 10+ messages in thread
From: Taco Hoekwater @ 2021-05-11 13:40 UTC (permalink / raw)
  To: mailing list for ConTeXt users



> On 11 May 2021, at 15:16, Hans Hagen <j.hagen@xs4all.nl> wrote:
> 
> On 5/11/2021 2:08 PM, Jairo A. del Rio wrote:
>> Hi, list! Following this thread: https://tex.stackexchange.com/questions/596610/how-to-use-luatex-with-large-unicode-codepoint <https://tex.stackexchange.com/questions/596610/how-to-use-luatex-with-large-unicode-codepoint>, I tried to replicate it in ConTeXt. Both LMTX and LMTX fail to display the right symbol and, as it's discussed in the linked page, there's an offset by 14. Is this intentional (in ConTeXt)? A bug? Minimal (non-)working example:
>> %Font available here: https://materialdesignicons.com/ <https://materialdesignicons.com/>
>> \starttext
>> \definedfont[file:materialdesignicons-webfont.ttf]\char"F1372\relax
>> \stoptext
> You need to employ a sense of humour for that font:
> 
> \starttext
>    \definefontfeature[materialicons][default][rlig=yes]
>    \definedfont[file:materialiconsregular.ttf*materialicons]
>    baby_changing_station
> \stoptext

That only works with the regular font, not with the webfont version from the ‘easy download’ 
link (it is cool, though :)).

But that is not the issue. The issue is that you have this super-useful page online:

  https://pictogrammers.github.io/@mdi/font/5.4.55/

where you can just copy the code point and/or the encoding hex value. But those values
do not match the ones in ConTeXt because the duplicates are removed while creating the tma, 
which condenses the encoding, resulting in an encoding offset, and that in turns make cut&paste
useless. :(


Also, it is a bit of a shame that the XXX-webfont.ttf has postscript glyph names that map to the 
online cheat sheet, but these names are not preserved in the tma file (at least not in my lmtx 
version). Keeping those would make the whole typset-a-specific-glyph procedure be a lot less 
error-prone, at least.

Best wishes,
Taco

— 
Taco Hoekwater              E: taco@bittext.nl
genderfluid (all pronouns)



___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: \char not working with private unicodes
  2021-05-11 13:40   ` Taco Hoekwater
@ 2021-05-11 15:31     ` Hans Hagen
  2021-05-12 12:03       ` Taco Hoekwater
  2021-05-12  7:20     ` luigi scarso
  1 sibling, 1 reply; 10+ messages in thread
From: Hans Hagen @ 2021-05-11 15:31 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Taco Hoekwater

On 5/11/2021 3:40 PM, Taco Hoekwater wrote:
> 
> 
>> On 11 May 2021, at 15:16, Hans Hagen <j.hagen@xs4all.nl> wrote:
>>
>> On 5/11/2021 2:08 PM, Jairo A. del Rio wrote:
>>> Hi, list! Following this thread: https://tex.stackexchange.com/questions/596610/how-to-use-luatex-with-large-unicode-codepoint <https://tex.stackexchange.com/questions/596610/how-to-use-luatex-with-large-unicode-codepoint>, I tried to replicate it in ConTeXt. Both LMTX and LMTX fail to display the right symbol and, as it's discussed in the linked page, there's an offset by 14. Is this intentional (in ConTeXt)? A bug? Minimal (non-)working example:
>>> %Font available here: https://materialdesignicons.com/ <https://materialdesignicons.com/>
>>> \starttext
>>> \definedfont[file:materialdesignicons-webfont.ttf]\char"F1372\relax
>>> \stoptext
>> You need to employ a sense of humour for that font:
>>
>> \starttext
>>     \definefontfeature[materialicons][default][rlig=yes]
>>     \definedfont[file:materialiconsregular.ttf*materialicons]
>>     baby_changing_station
>> \stoptext
> 
> That only works with the regular font, not with the webfont version from the ‘easy download’
> link (it is cool, though :)).
> 
> But that is not the issue. The issue is that you have this super-useful page online:
> 
>    https://pictogrammers.github.io/@mdi/font/5.4.55/
> 
> where you can just copy the code point and/or the encoding hex value. But those values
> do not match the ones in ConTeXt because the duplicates are removed while creating the tma,
> which condenses the encoding, resulting in an encoding offset, and that in turns make cut&paste
> useless. :(
> 
> 
> Also, it is a bit of a shame that the XXX-webfont.ttf has postscript glyph names that map to the
> online cheat sheet, but these names are not preserved in the tma file (at least not in my lmtx
> version). Keeping those would make the whole typset-a-specific-glyph procedure be a lot less
> error-prone, at least.
i suppose you noted the message -)

can you confirm / check that we can safely assume zero length names to 
be okay?

                     local length = readbyte(f)
                     if length > 0 then
                         glyphs[mapping].name = readstring(f,length)
                     else
                      -- report("quit post name fetching at %a of %a: 
%s",i,maxnames,"overflow")
                      -- break
                     end

i bet this check is there because of some other font needed it in order 
to get loaded


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: \char not working with private unicodes
  2021-05-11 13:40   ` Taco Hoekwater
  2021-05-11 15:31     ` Hans Hagen
@ 2021-05-12  7:20     ` luigi scarso
  1 sibling, 0 replies; 10+ messages in thread
From: luigi scarso @ 2021-05-12  7:20 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

On Tue, May 11, 2021 at 3:41 PM Taco Hoekwater <taco@bittext.nl> wrote:

>
>
> > On 11 May 2021, at 15:16, Hans Hagen <j.hagen@xs4all.nl> wrote:
> >
> > On 5/11/2021 2:08 PM, Jairo A. del Rio wrote:
> >> Hi, list! Following this thread:
> https://tex.stackexchange.com/questions/596610/how-to-use-luatex-with-large-unicode-codepoint
> <
> https://tex.stackexchange.com/questions/596610/how-to-use-luatex-with-large-unicode-codepoint>,
> I tried to replicate it in ConTeXt. Both LMTX and LMTX fail to display the
> right symbol and, as it's discussed in the linked page, there's an offset
> by 14. Is this intentional (in ConTeXt)? A bug? Minimal (non-)working
> example:
> >> %Font available here: https://materialdesignicons.com/ <
> https://materialdesignicons.com/>
> >> \starttext
> >> \definedfont[file:materialdesignicons-webfont.ttf]\char"F1372\relax
> >> \stoptext
> > You need to employ a sense of humour for that font:
> >
> > \starttext
> >    \definefontfeature[materialicons][default][rlig=yes]
> >    \definedfont[file:materialiconsregular.ttf*materialicons]
> >    baby_changing_station
> > \stoptext
>
> That only works with the regular font, not with the webfont version from
> the ‘easy download’
> link (it is cool, though :)).
>
> But that is not the issue. The issue is that you have this super-useful
> page online:
>
>   https://pictogrammers.github.io/@mdi/font/5.4.55/
>
>
another link for the records, just in case
https://www.nerdfonts.com


-- 
luigi

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

[-- Attachment #2: Type: text/plain, Size: 493 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: \char not working with private unicodes
  2021-05-11 15:31     ` Hans Hagen
@ 2021-05-12 12:03       ` Taco Hoekwater
  2021-05-12 12:29         ` Taco Hoekwater
  0 siblings, 1 reply; 10+ messages in thread
From: Taco Hoekwater @ 2021-05-12 12:03 UTC (permalink / raw)
  To: mailing list for ConTeXt users



> On 11 May 2021, at 17:31, Hans Hagen <j.hagen@xs4all.nl> wrote:
> 
> On 5/11/2021 3:40 PM, Taco Hoekwater wrote:
>>> On 11 May 2021, at 15:16, Hans Hagen <j.hagen@xs4all.nl> wrote:
>>> 
>>> On 5/11/2021 2:08 PM, Jairo A. del Rio wrote:
>>>> Hi, list! Following this thread: https://tex.stackexchange.com/questions/596610/how-to-use-luatex-with-large-unicode-codepoint <https://tex.stackexchange.com/questions/596610/how-to-use-luatex-with-large-unicode-codepoint>, I tried to replicate it in ConTeXt. Both LMTX and LMTX fail to display the right symbol and, as it's discussed in the linked page, there's an offset by 14. Is this intentional (in ConTeXt)? A bug? Minimal (non-)working example:
>>>> %Font available here: https://materialdesignicons.com/ <https://materialdesignicons.com/>
>>>> \starttext
>>>> \definedfont[file:materialdesignicons-webfont.ttf]\char"F1372\relax
>>>> \stoptext
>>> You need to employ a sense of humour for that font:
>>> 
>>> \starttext
>>>    \definefontfeature[materialicons][default][rlig=yes]
>>>    \definedfont[file:materialiconsregular.ttf*materialicons]
>>>    baby_changing_station
>>> \stoptext
>> That only works with the regular font, not with the webfont version from the ‘easy download’
>> link (it is cool, though :)).
>> But that is not the issue. The issue is that you have this super-useful page online:
>>   https://pictogrammers.github.io/@mdi/font/5.4.55/
>> where you can just copy the code point and/or the encoding hex value. But those values
>> do not match the ones in ConTeXt because the duplicates are removed while creating the tma,
>> which condenses the encoding, resulting in an encoding offset, and that in turns make cut&paste
>> useless. :(
>> Also, it is a bit of a shame that the XXX-webfont.ttf has postscript glyph names that map to the
>> online cheat sheet, but these names are not preserved in the tma file (at least not in my lmtx
>> version). Keeping those would make the whole typset-a-specific-glyph procedure be a lot less
>> error-prone, at least.
> i suppose you noted the message -)
> 
> can you confirm / check that we can safely assume zero length names to be okay?
> 
>                    local length = readbyte(f)
>                    if length > 0 then
>                        glyphs[mapping].name = readstring(f,length)
>                    else
>                     -- report("quit post name fetching at %a of %a: %s",i,maxnames,"overflow")
>                     -- break
>                    end
> 
> i bet this check is there because of some other font needed it in order to get loaded


With that “break" removed glyph naming works and I can safely do:

 \getnamedglyphdirect{file:materialdesignicons-webfont.ttf}{access-point-check}

which is the font glyph encoded at “F1538. The above line produces the correct 
output now.

But \char”F1538 still shows the wrong icon (though probably a different wrong one). 

I did a bit of digging, and here is where it starts to goes wrong right now (tma excerpt):


  [983923]={
   ["boundingbox"]=1,
   ["index"]=883,
   ["name"]="minecraft",
   ["unicode"]=983923,
   ["width"]=512,
  },
  [983924]={
   ["boundingbox"]={ 0, 0, 406, 214 },
   ["index"]=884,
   ["name"]="minus",
   ["unicode"]=8722,
   ["width"]=512,
  },
  [983925]={
   ["boundingbox"]=6,
   ["index"]=885,
   ["name"]="minus-box",
   ["unicode"]=983925,
   ["width"]=512,
  },

That “minus" is moved back to the spot for Unicode MINUS SIGN, and then the rest 
of the encoding shifts down by one. That happens a few dozen times in total, for
various glyphs with “standard” names. So probably the name-based remapping of
glyphs is a bad idea for glyphs that are explicitly PUA-encoded in the font ...

Best wishes,
Taco


— 
Taco Hoekwater              E: taco@bittext.nl
genderfluid (all pronouns)



___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: \char not working with private unicodes
  2021-05-12 12:03       ` Taco Hoekwater
@ 2021-05-12 12:29         ` Taco Hoekwater
  0 siblings, 0 replies; 10+ messages in thread
From: Taco Hoekwater @ 2021-05-12 12:29 UTC (permalink / raw)
  To: mailing list for ConTeXt users



> On 12 May 2021, at 14:03, Taco Hoekwater <taco@bittext.nl> wrote:
> 
> But \char”F1538 still shows the wrong icon (though probably a different wrong one). 
> 
> I did a bit of digging, and here is where it starts to goes wrong right now (tma excerpt):
> 
> 
>  [….]


Never mind that, that was wrong of me and not the problem at all! Sorry!

Retry:

  [983943]={
   ["boundingbox"]=58,
   ["index"]=903,
   ["name"]="music-note",
   ["unicode"]=983943,
   ["width"]=512,
  },
  [983944]={
   ["boundingbox"]=187,
   ["index"]=904,
   ["name"]="music-note-half",
   ["unicode"]=983945,
   ["width"]=512,
  },

“music-note” appears twice in the font encoding, at F0387 and F0388. 
The cheat sheet says that the second of those should be “music-note-eight”,
but it has the wrong name, which is probably why ConTeXt removes it.

The next one is “checkbox-blank-circle-outline”, which is at F0766 and F043D.
The latter should have been named “radiobox-blank” according to the cheat sheet.

Etc.

On my earlier note: I still think it is bad to assign unicode code points
in ’this’ case. A logo that is encoded in the PUA and happens to be named 
“minus” is very unlikely to actually be a mathematical minus.


— 
Taco Hoekwater              E: taco@bittext.nl
genderfluid (all pronouns)



___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* \char not working with private unicodes
  2021-05-11 12:08 \char not working with private unicodes Jairo A. del Rio
  2021-05-11 13:16 ` Hans Hagen
@ 2021-05-13  6:46 ` Sergio Callegari
  2021-05-13  7:16   ` Hans Hagen
  1 sibling, 1 reply; 10+ messages in thread
From: Sergio Callegari @ 2021-05-13  6:46 UTC (permalink / raw)
  To: ntg-context

On 5/11/2021 2:08 PM, Jairo A. del Rio wrote:
> Hi, list! Following this thread:
> https://tex.stackexchange.com/questions/596610/how-to-use-luatex-with-large-unicode-codepoint 
>
> <https://tex.stackexchange.com/questions/596610/how-to-use-luatex-with-large-unicode-codepoint>, 
>
> I tried to replicate it in ConTeXt. Both LMTX and LMTX fail to display
> the right symbol and, as it's discussed in the linked page, there's an
> offset by 14. Is this intentional (in ConTeXt)? A bug?

Hi! As the original poster of the stackexchange question, I have found 
this thread and I am quite grateful for your attention on the topic!

In fact, I am a LaTeX user and this is just one more reason why I am 
quite grateful to the ConTeXt community, since some progress that is 
recently being enjoyed in LaTeX including the nice support for unicode 
fonts derives from ConTeXt, I understand.

I would like to add a pointer to the thread at 
https://github.com/latex3/luaotfload/issues/185#issuecomment-839640563.

For luaotfload the issue is currently being marked as wontfix, since the 
relevant code and the node shaper come from ConTeXt. If some improvement 
is made in ConTeXt, I am pretty sure that luaotfload will benefit from 
it though and I would like to thank in advance! I already see progress 
on retaining the glyph names is being made.

It is my understanding (please correct me if I am wrong) that the 
visible issues get triggered by multiple circumstances playing together 
at once:

- the fact that the current codebase does a name-based remapping of 
glyphs also for glyphs that are explicitly PUA-encoded;

- the fact that some errors with some glyphnames in the ttf font cause 
the current code-base to drop the names so that the chars cannot be 
accessed by name;

- the fact that some naming mistake seems to be present in the ttf font 
(at least with respect to the tabled 
codepoint-glyphname-glyphappearance) actually introducing some duplicates.

If this is correct, I wonder if it can make sense to open an issue on 
the font development site (and maybe keep today's version of the ttf as 
a test case should there be some change in ConTeXt wrt the glyph name 
handling and remapping).

Best

Sergio



___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: \char not working with private unicodes
  2021-05-13  6:46 ` Sergio Callegari
@ 2021-05-13  7:16   ` Hans Hagen
  2021-05-18 13:07     ` Sergio Callegari
  0 siblings, 1 reply; 10+ messages in thread
From: Hans Hagen @ 2021-05-13  7:16 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Sergio Callegari

On 5/13/2021 8:46 AM, Sergio Callegari wrote:
> On 5/11/2021 2:08 PM, Jairo A. del Rio wrote:
>> Hi, list! Following this thread:
>> https://tex.stackexchange.com/questions/596610/how-to-use-luatex-with-large-unicode-codepoint 
>>
>> <https://tex.stackexchange.com/questions/596610/how-to-use-luatex-with-large-unicode-codepoint>, 
>>
>> I tried to replicate it in ConTeXt. Both LMTX and LMTX fail to display
>> the right symbol and, as it's discussed in the linked page, there's an
>> offset by 14. Is this intentional (in ConTeXt)? A bug?
> 
> Hi! As the original poster of the stackexchange question, I have found 
> this thread and I am quite grateful for your attention on the topic!
> 
> In fact, I am a LaTeX user and this is just one more reason why I am 
> quite grateful to the ConTeXt community, since some progress that is 
> recently being enjoyed in LaTeX including the nice support for unicode 
> fonts derives from ConTeXt, I understand.
> 
> I would like to add a pointer to the thread at 
> https://github.com/latex3/luaotfload/issues/185#issuecomment-839640563.
> 
> For luaotfload the issue is currently being marked as wontfix, since the 
> relevant code and the node shaper come from ConTeXt. If some improvement 
> is made in ConTeXt, I am pretty sure that luaotfload will benefit from 
> it though and I would like to thank in advance! I already see progress 
> on retaining the glyph names is being made.
> 
> It is my understanding (please correct me if I am wrong) that the 
> visible issues get triggered by multiple circumstances playing together 
> at once:
> 
> - the fact that the current codebase does a name-based remapping of 
> glyphs also for glyphs that are explicitly PUA-encoded;
> 
> - the fact that some errors with some glyphnames in the ttf font cause 
> the current code-base to drop the names so that the chars cannot be 
> accessed by name;
> 
> - the fact that some naming mistake seems to be present in the ttf font 
> (at least with respect to the tabled 
> codepoint-glyphname-glyphappearance) actually introducing some duplicates.
> 
> If this is correct, I wonder if it can make sense to open an issue on 
> the font development site (and maybe keep today's version of the ttf as 
> a test case should there be some change in ConTeXt wrt the glyph name 
> handling and remapping).
A next upload will scan the names (read: i commented the possible catch 
for issues, let's see when the font that needed that pops up again).

The renaming of bad glyphs can technically be fixed but a runtime hack 
but i try to avoid that .. the more heuristics, the harder to fight.

You can try to patch luaotfload. Locate the 'report' line and comment 
those two as below.


                  local length = readbyte(f)
                    if length > 0 then
                        glyphs[mapping].name = readstring(f,length)
                    else
                     -- report("quit post name fetching at %a of %a: 
%s",i,maxnames,"overflow")
                     -- break
                    end

Did you try to use the regular variant:

\starttext
     \definefontfeature[materialicons][default][rlig=yes]
     \definedfont[file:materialiconsregular.ttf*materialicons]
     baby_changing_station % selects symbol as ligature
\stoptext

(in latex equivalent) .. keep in mind that 'web' fonts are often more 
minimalistic, so i never use them (when there's a real one).

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: \char not working with private unicodes
  2021-05-13  7:16   ` Hans Hagen
@ 2021-05-18 13:07     ` Sergio Callegari
  0 siblings, 0 replies; 10+ messages in thread
From: Sergio Callegari @ 2021-05-18 13:07 UTC (permalink / raw)
  To: Hans Hagen, mailing list for ConTeXt users

Hi,

On 13/05/21 09:16, Hans Hagen wrote:
> A next upload will scan the names (read: i commented the possible 
> catch for issues, let's see when the font that needed that pops up 
> again).
Good news! Looking forward to seeing luaotfload catch up on this.
>
> The renaming of bad glyphs can technically be fixed but a runtime hack 
> but i try to avoid that .. the more heuristics, the harder to fight.

If I understand correctly the matter, I'd like to still advocate for an 
attempt. If there is something bad that must be discarded to avoid 
renaming heuristics, that is OK, but at least it would be nice to "leave 
the gap" in the codepoints, to avoid breaking the codepoint->glyph 
published correspondence.

It is PUA, but "private" is not really "personal" and agreements about 
how some fonts put stuff here are probably expected to work across more 
than one individual, e.g. across organization or even at a wider level 
(think CSUR). I think that it is really important to assure that those 
work. The breakage of cut and paste seems particularly bad.

>
> You can try to patch luaotfload. Locate the 'report' line and comment 
> those two as below.
>
>
>                  local length = readbyte(f)
>                    if length > 0 then
>                        glyphs[mapping].name = readstring(f,length)
>                    else
>                     -- report("quit post name fetching at %a of %a: 
> %s",i,maxnames,"overflow")
>                     -- break
>                    end
>
I'll try that... With the names, there is the problem that as of today 
lualatex does not provide a LaTeX command to access the glyphs by name 
out of the box (as I understand it is the case in ConTeXt) so you need 
to write some Lua code. I'll make some experiment and if that works, 
I'll make a small package for that.
> Did you try to use the regular variant:
>
> \starttext
>     \definefontfeature[materialicons][default][rlig=yes]
>     \definedfont[file:materialiconsregular.ttf*materialicons]
>     baby_changing_station % selects symbol as ligature
> \stoptext
>
> (in latex equivalent) .. keep in mind that 'web' fonts are often more 
> minimalistic, so i never use them (when there's a real one).

The problem here is that the "regular variant" is the official one (I 
understand from google), while the "webfont" is a community project that 
incorporates the /official/ material design icons with many 
contributions drawn to be fully consistent with the official icons. And 
my problem is that I need to make use of some of these contributions.  
So I really have no choice.

In any case, I have opened a bug at the webfont developer to see if they 
can get more ConTeXt friendly by at least fixing the font->cheatsheet 
correspondence and the duplicate names. See 
https://github.com/Templarian/MaterialDesign-Webfont/issues/78

Thanks,

Sergio

___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2021-05-18 13:07 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-11 12:08 \char not working with private unicodes Jairo A. del Rio
2021-05-11 13:16 ` Hans Hagen
2021-05-11 13:40   ` Taco Hoekwater
2021-05-11 15:31     ` Hans Hagen
2021-05-12 12:03       ` Taco Hoekwater
2021-05-12 12:29         ` Taco Hoekwater
2021-05-12  7:20     ` luigi scarso
2021-05-13  6:46 ` Sergio Callegari
2021-05-13  7:16   ` Hans Hagen
2021-05-18 13:07     ` Sergio Callegari

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