ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* SVG fonts not working properly
@ 2021-02-05 17:29 Jairo A. del Rio
  2021-02-05 22:02 ` Hans Hagen
  0 siblings, 1 reply; 5+ messages in thread
From: Jairo A. del Rio @ 2021-02-05 17:29 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

The following examples doesn't work as expected:


\definefontfeature[emojis][default,color:svg][script=latn,language=dflt]

\definefont[gilbert][file:Gilbert-ColorBoldPreview5*emojis @ 13bp]

\starttext

{\gilbert abcdefghijklmnpqrstuvwxyz}

\stoptext

Letters are displayed correctly, but ascenders and descenders don't. It
looks like characters are inserted like images rather than actual
characters. Am I missing something? Thank you in advance.

Jairo :)

[-- Attachment #1.2: Type: text/html, Size: 1019 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] 5+ messages in thread

* Re: SVG fonts not working properly
  2021-02-05 17:29 SVG fonts not working properly Jairo A. del Rio
@ 2021-02-05 22:02 ` Hans Hagen
  2021-02-06  2:08   ` Jairo A. del Rio
  0 siblings, 1 reply; 5+ messages in thread
From: Hans Hagen @ 2021-02-05 22:02 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Jairo A. del Rio

On 2/5/2021 6:29 PM, Jairo A. del Rio wrote:
> The following examples doesn't work as expected:
> 
> 
> \definefontfeature[emojis][default,color:svg][script=latn,language=dflt]
> 
> \definefont[gilbert][file:Gilbert-ColorBoldPreview5*emojis @ 13bp]
> 
> \starttext
> 
> {\gilbert abcdefghijklmnpqrstuvwxyz}
> 
> \stoptext
> 
> Letters are displayed correctly, but ascenders and descenders don't. It 
> looks like characters are inserted like images rather than actual 
> characters. Am I missing something? Thank you in advance.
svg fonts are a bit of a mess adn there are not many (scaling, offset 
etc. and specs kind of fuzzy .. one needs for instance treat the visible 
area in a special way .. there is no metadata wrt the glyph involved so 
we need to experiment a bit (i don't want to end up with heuristics 
based on guesswork)

anyway, them being svg they are actually images (there was time that 
acrobat has svg on board but that was dropped) so what we end up is with 
is a pdf stream but in such a way that they are actual characters

you can try this:

\definefontfeature[color:svg]    [ccmp=yes,dist=yes,svg=fixdepth]

and patch lpdf-emb with

                              -- local y     = - b[4] - b[2] - (d.depth 
or 0)
                                 local y     = - (d.depth or 0)

and try some more (like emoji) ... no time now ... so you do the 
checking and later i will look at the result

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] 5+ messages in thread

* Re: SVG fonts not working properly
  2021-02-05 22:02 ` Hans Hagen
@ 2021-02-06  2:08   ` Jairo A. del Rio
  2021-02-06 20:45     ` Hans Hagen
  0 siblings, 1 reply; 5+ messages in thread
From: Jairo A. del Rio @ 2021-02-06  2:08 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users


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

svg=fixdepth breaks, with or without the patch.

fatal lua error:


run callback [6]: [string
"/home/coragyps/lmtx/tex/texmf-context/tex/con..."]:1587: attempt to
perform arithmetic on a nil value (field 'depth')

stack traceback:

[string "/home/coragyps/lmtx/tex/texmf-context/tex/con..."]:1587: in local
'glyphtopdf'

[string "/home/coragyps/lmtx/tex/texmf-context/tex/con..."]:1879: in local
'writer'

[string "/home/coragyps/lmtx/tex/texmf-context/tex/con..."]:2080: in field
'integer index'

[string "/home/coragyps/lmtx/tex/texmf-context/tex/con..."]:782: in upvalue
'run'

[string "/home/coragyps/lmtx/tex/texmf-context/tex/con..."]:811: in field
'finalizedocument'

[string "/home/coragyps/lmtx/tex/texmf-context/tex/con..."]:2958: in field
'?'

...mtx/tex/texmf-context/tex/context/base/mkiv/luat-run.lua:56: in function
<...mtx/tex/texmf-context/tex/context/base/mkiv/luat-run.lua:54>

Jairo

El vie, 5 de feb. de 2021 a la(s) 17:02, Hans Hagen (j.hagen@xs4all.nl)
escribió:

> On 2/5/2021 6:29 PM, Jairo A. del Rio wrote:
> > The following examples doesn't work as expected:
> >
> >
> > \definefontfeature[emojis][default,color:svg][script=latn,language=dflt]
> >
> > \definefont[gilbert][file:Gilbert-ColorBoldPreview5*emojis @ 13bp]
> >
> > \starttext
> >
> > {\gilbert abcdefghijklmnpqrstuvwxyz}
> >
> > \stoptext
> >
> > Letters are displayed correctly, but ascenders and descenders don't. It
> > looks like characters are inserted like images rather than actual
> > characters. Am I missing something? Thank you in advance.
> svg fonts are a bit of a mess adn there are not many (scaling, offset
> etc. and specs kind of fuzzy .. one needs for instance treat the visible
> area in a special way .. there is no metadata wrt the glyph involved so
> we need to experiment a bit (i don't want to end up with heuristics
> based on guesswork)
>
> anyway, them being svg they are actually images (there was time that
> acrobat has svg on board but that was dropped) so what we end up is with
> is a pdf stream but in such a way that they are actual characters
>
> you can try this:
>
> \definefontfeature[color:svg]    [ccmp=yes,dist=yes,svg=fixdepth]
>
> and patch lpdf-emb with
>
>                               -- local y     = - b[4] - b[2] - (d.depth
> or 0)
>                                  local y     = - (d.depth or 0)
>
> and try some more (like emoji) ... no time now ... so you do the
> checking and later i will look at the result
>
> 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
> -----------------------------------------------------------------
>

[-- Attachment #1.2: Type: text/html, Size: 4449 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] 5+ messages in thread

* Re: SVG fonts not working properly
  2021-02-06  2:08   ` Jairo A. del Rio
@ 2021-02-06 20:45     ` Hans Hagen
  2021-02-07  3:10       ` Jairo A. del Rio
  0 siblings, 1 reply; 5+ messages in thread
From: Hans Hagen @ 2021-02-06 20:45 UTC (permalink / raw)
  To: Jairo A. del Rio; +Cc: mailing list for ConTeXt users

On 2/6/2021 3:08 AM, Jairo A. del Rio wrote:
> svg=fixdepth breaks, with or without the patch.
> 
> fatal lua error:
> 
> 
> run callback [6]: [string 
> "/home/coragyps/lmtx/tex/texmf-context/tex/con..."]:1587: attempt to 
> perform arithmetic on a nil value (field 'depth')

did you remake the format?

-----------------------------------------------------------------
                                           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] 5+ messages in thread

* Re: SVG fonts not working properly
  2021-02-06 20:45     ` Hans Hagen
@ 2021-02-07  3:10       ` Jairo A. del Rio
  0 siblings, 0 replies; 5+ messages in thread
From: Jairo A. del Rio @ 2021-02-07  3:10 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users


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

Ah, sorry. I'll try again.

Jairo

El sáb., 6 de feb. de 2021 3:45 p. m., Hans Hagen <j.hagen@xs4all.nl>
escribió:

> On 2/6/2021 3:08 AM, Jairo A. del Rio wrote:
> > svg=fixdepth breaks, with or without the patch.
> >
> > fatal lua error:
> >
> >
> > run callback [6]: [string
> > "/home/coragyps/lmtx/tex/texmf-context/tex/con..."]:1587: attempt to
> > perform arithmetic on a nil value (field 'depth')
>
> did you remake the format?
>
> -----------------------------------------------------------------
>                                            Hans Hagen | PRAGMA ADE
>                Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>         tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -----------------------------------------------------------------
>

[-- Attachment #1.2: Type: text/html, Size: 1373 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] 5+ messages in thread

end of thread, other threads:[~2021-02-07  3:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-05 17:29 SVG fonts not working properly Jairo A. del Rio
2021-02-05 22:02 ` Hans Hagen
2021-02-06  2:08   ` Jairo A. del Rio
2021-02-06 20:45     ` Hans Hagen
2021-02-07  3:10       ` Jairo A. del Rio

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