ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Re: Typescript/fallbacks problem
       [not found] <CAMHZ1daucwXqw0aAuwS9UzODKAA-AiKkQjcPVKO1=nYt8rx-9w@mail.gmail.com>
@ 2017-05-26  3:52 ` Mohammad Hossein Bateni
  2017-05-27  9:39   ` Otared Kavian
  0 siblings, 1 reply; 5+ messages in thread
From: Mohammad Hossein Bateni @ 2017-05-26  3:52 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

The following email had large attachments (more than 100K).  I uploaded
everything here:
http://mhbateni.com/context/bug-04/

On Thu, May 25, 2017 at 11:40 PM, Mohammad Hossein Bateni <bateni@gmail.com>
wrote:

> Hello Hans,
>
> I'm going to explain a strange problem which came about, as far as I can
> tell, in beta 2017.04.27 01:00.  The same beta had introduced some other
> issues with fallbacks, which you fixed already.  Thanks a lot for that!
>
> I am now using the latest beta, version 2017.05.25 12:50.  Unfortunately I
> don't know what is going on precisely.  Here is a sort-of-minimal
> non-working example.
>
>
> %%%%%%%%%%%%%%%%%%%%%%%%%
>
> \definefontfeature[slanted][slant=.4]
>
>
> \starttypescript [serif][sahel][name]
>
>   \resetfontfallback [dejavudefault]
>
>   \definefontfallback[dejavudefault][dejavusans]
> [range=generalpunctuation,check=yes,force=no]
>
> %
>
>   \definefontsynonym [SahelReg]    [Sahel][features={arabic,
> tlig},fallbacks=dejavudef]
>
> %% NOTE 1
>
> %  \definefontsynonym [SahelReg] [Sahel][features={arabic,tlig}]
>
>   \definefontsynonym [SahelBd]       [SahelBold][features={arabic,
> tlig},fallbacks=dejavudef]
>
>   \definefontsynonym [SahelIt]         [Sahel][features={arabic,tlig,
> slanted},fallbacks=dejavudef]
>
>   \definefontsynonym [SahelBdIt]     [SahelBold][features={arabic,
> tlig,slanted},fallbacks=dejavudef]
>
> %
>
>   \definefontsynonym [Serif] [SahelReg]
>
>   \definefontsynonym [SerifBold] [SahelBd]
>
>   \definefontsynonym [SerifItalic] [SahelIt]
>
>   \definefontsynonym [SerifBoldItalic] [SahelBdIt]
>
> \stoptypescript
>
>
> \starttypescript [math] [modern] [name]
>
> \definefontsynonym [MathRoman] [name:modern] [features=math\mathsizesuffix]
>
> \stoptypescript
>
>
> \starttypescript [myfont]
>
> \definetypeface [myfont][rm] [serif][sahel] [default]
>
> %% NOTE 2
>
> \definetypeface [myfont][mm] [math] [modern][default]
>
> \stoptypescript
>
>
> \setupbodyfont[myfont,rm]
>
> %% NOTE 3
>
> %\definedfont[Serif]
>
>
> \def\Sample{{\lefttoright Salam} {\righttoleft سلام} }
>
>
> \starttext
>
> rm:\Sample
>
> {\bf bf:\Sample}
>
> {\it it:\Sample}
>
> {\bi bi:\Sample}
>
>
> %% NOTE 4
>
> \definedfont[SahelReg]\Sample
>
> \definedfont[Serif]\Sample
>
>
> \stoptext
> %%%%%%%%%%%%%%%%%%%%%%%%%
>
>
> *Background*:
>
> Commenting/uncommenting some of the lines produces three outputs, only one
> of which seems correct to me.  I have attached the three.  Betas before
> 4/27 always produced the correct solution.
>
> I am using a free open-source Farsi font, whose English glyphs come from
> Open Sans font.  I am attaching the specific versions of the Farsi font to
> reproduce the same results.
> [https://github.com/rastikerdar/sahel-font]
> [https://github.com/google/fonts/tree/master/apache/opensans]
>
>
> *Explanation*:
>
> Compiling the MWE above produces wrong-1.pdf in recent betas.  The serif
> font has not been set up properly on the first line of output.  Instead the
> default Latin Modern has been used, which looks different and misses the
> Farsi glyphs.
>
> Strangely there is nothing wrong with the second line of text, which shows
> Serif and SahelReg fonts are both set up just fine.  See "NOTE 4" in the
> MWE.
>
> Replacing the line above "NOTE 1" with the line below it—i.e., if I remove
> the fallbacks for definition of SahelReg—generates correct.pdf as output.
> I get the same correct output if uncomment the line below "NOTE 3," which
> should be a no-op in my opinion.  Notice that setting the fallback for
> bold, italic and bold italic has not caused any issues.  It's only the
> serif itself that's acting up weirdly.
>
> Finally when I comment the math definition below "NOTE 2," I get
> wrong-2.pdf as output.  Here everything seems okay except that the serif on
> the first line—but strangely not on the second line—misses the Arabic
> features: the letters are not joined.
>
>
> I spent quite some time investigating the changes to the GitHub
> repository on 4/27, to pinpoint what might have caused this issue, but my
> efforts didn't go anywhere.  I hope you can spot the issue.
>
>
> Thanks a lot for your attention!
> —MHB
>
>
>

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

[-- Attachment #2: Type: text/plain, Size: 492 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: Typescript/fallbacks problem
  2017-05-26  3:52 ` Typescript/fallbacks problem Mohammad Hossein Bateni
@ 2017-05-27  9:39   ` Otared Kavian
  2017-05-27 11:34     ` Hans Hagen
  0 siblings, 1 reply; 5+ messages in thread
From: Otared Kavian @ 2017-05-27  9:39 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Hi Mohammad Hossein,

Your report is beyond my knowledge, but I would like to ask you a question about the setup of fallback fonts: why are you referring to « dejavudef » in the commands such as

	 \definefontsynonym [SahelBd]       [SahelBold][features={arabic,tlig},fallbacks=dejavudef]

while you have defined before « dejavudefault » (and not « dejavudef ») in:

	\definefontfallback[dejavudefault][dejavusans] [range=generalpunctuation,check=yes,force=no]

Best regards: Otared K.

> On 26 May 2017, at 05:52, Mohammad Hossein Bateni <bateni@gmail.com <mailto:bateni@gmail.com>> wrote:
> 
> The following email had large attachments (more than 100K).  I uploaded everything here:
> http://mhbateni.com/context/bug-04/ <http://mhbateni.com/context/bug-04/>
> 
> On Thu, May 25, 2017 at 11:40 PM, Mohammad Hossein Bateni <bateni@gmail.com <mailto:bateni@gmail.com>> wrote:
> Hello Hans,
> 
> I'm going to explain a strange problem which came about, as far as I can tell, in beta 2017.04.27 01:00.  The same beta had introduced some other issues with fallbacks, which you fixed already.  Thanks a lot for that!
> 
> I am now using the latest beta, version 2017.05.25 12:50.  Unfortunately I don't know what is going on precisely.  Here is a sort-of-minimal non-working example.
> 
> 
> %%%%%%%%%%%%%%%%%%%%%%%%%
> \definefontfeature[slanted][slant=.4]
> 
> \starttypescript [serif][sahel][name]
>   \resetfontfallback [dejavudefault]
>   \definefontfallback[dejavudefault][dejavusans] [range=generalpunctuation,check=yes,force=no]
> %
>   \definefontsynonym [SahelReg]    [Sahel][features={arabic,tlig},fallbacks=dejavudef]
> %% NOTE 1
> %  \definefontsynonym [SahelReg] [Sahel][features={arabic,tlig}]
>   \definefontsynonym [SahelBd]       [SahelBold][features={arabic,tlig},fallbacks=dejavudef]
>   \definefontsynonym [SahelIt]         [Sahel][features={arabic,tlig,slanted},fallbacks=dejavudef]
>   \definefontsynonym [SahelBdIt]     [SahelBold][features={arabic,tlig,slanted},fallbacks=dejavudef]
> %
>   \definefontsynonym [Serif] [SahelReg]
>   \definefontsynonym [SerifBold] [SahelBd]
>   \definefontsynonym [SerifItalic] [SahelIt]
>   \definefontsynonym [SerifBoldItalic] [SahelBdIt]
> \stoptypescript
> 
> \starttypescript [math] [modern] [name]
> \definefontsynonym [MathRoman] [name:modern] [features=math\mathsizesuffix]
> \stoptypescript
> 
> \starttypescript [myfont]
> \definetypeface [myfont][rm] [serif][sahel] [default]
> %% NOTE 2
> \definetypeface [myfont][mm] [math] [modern][default]
> \stoptypescript
> 
> \setupbodyfont[myfont,rm]
> %% NOTE 3
> %\definedfont[Serif]
> 
> \def\Sample{{\lefttoright Salam} {\righttoleft سلام} }
> 
> \starttext
> rm:\Sample
> {\bf bf:\Sample}
> {\it it:\Sample}
> {\bi bi:\Sample}
> 
> %% NOTE 4
> \definedfont[SahelReg]\Sample
> \definedfont[Serif]\Sample
> 
> \stoptext
> %%%%%%%%%%%%%%%%%%%%%%%%%
> 
> 
> Background: 
> 
> Commenting/uncommenting some of the lines produces three outputs, only one of which seems correct to me.  I have attached the three.  Betas before 4/27 always produced the correct solution.
> 
> I am using a free open-source Farsi font, whose English glyphs come from Open Sans font.  I am attaching the specific versions of the Farsi font to reproduce the same results.
> [https://github.com/rastikerdar/sahel-font <https://github.com/rastikerdar/sahel-font>]
> [https://github.com/google/fonts/tree/master/apache/opensans <https://github.com/google/fonts/tree/master/apache/opensans>]
> 
> 
> Explanation:
> 
> Compiling the MWE above produces wrong-1.pdf in recent betas.  The serif font has not been set up properly on the first line of output.  Instead the default Latin Modern has been used, which looks different and misses the Farsi glyphs.
> 
> Strangely there is nothing wrong with the second line of text, which shows Serif and SahelReg fonts are both set up just fine.  See "NOTE 4" in the MWE.
> 
> Replacing the line above "NOTE 1" with the line below it—i.e., if I remove the fallbacks for definition of SahelReg—generates correct.pdf as output.  I get the same correct output if uncomment the line below "NOTE 3," which should be a no-op in my opinion.  Notice that setting the fallback for bold, italic and bold italic has not caused any issues.  It's only the serif itself that's acting up weirdly.
> 
> Finally when I comment the math definition below "NOTE 2," I get wrong-2.pdf as output.  Here everything seems okay except that the serif on the first line—but strangely not on the second line—misses the Arabic features: the letters are not joined.
> 
> 
> I spent quite some time investigating the changes to the GitHub repository on 4/27, to pinpoint what might have caused this issue, but my efforts didn't go anywhere.  I hope you can spot the issue.
> 
> 
> Thanks a lot for your attention!
> —MHB
> 
> 
> 
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
> 
> maillist : ntg-context@ntg.nl <mailto:ntg-context@ntg.nl> / http://www.ntg.nl/mailman/listinfo/ntg-context <http://www.ntg.nl/mailman/listinfo/ntg-context>
> webpage  : http://www.pragma-ade.nl <http://www.pragma-ade.nl/> / http://context.aanhet.net <http://context.aanhet.net/>
> archive  : https://bitbucket.org/phg/context-mirror/commits/ <https://bitbucket.org/phg/context-mirror/commits/>
> wiki     : http://contextgarden.net <http://contextgarden.net/>
> ___________________________________________________________________________________


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

[-- Attachment #2: Type: text/plain, Size: 492 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: Typescript/fallbacks problem
  2017-05-27  9:39   ` Otared Kavian
@ 2017-05-27 11:34     ` Hans Hagen
  2017-05-27 16:14       ` Mohammad Hossein Bateni
  0 siblings, 1 reply; 5+ messages in thread
From: Hans Hagen @ 2017-05-27 11:34 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Otared Kavian

On 5/27/2017 11:39 AM, Otared Kavian wrote:
> Hi Mohammad Hossein,
> 
> Your report is beyond my knowledge, but I would like to ask you a 
> question about the setup of fallback fonts: why are you referring to « 
> dejavudef » in the commands such as
> 
>   \definefontsynonym [SahelBd]       
> [SahelBold][features={arabic,tlig},fallbacks=dejavudef]
> 
> while you have defined before « dejavudefault » (and not « dejavudef ») in:
> 
> \definefontfallback[dejavudefault][dejavusans] 
> [range=generalpunctuation,check=yes,force=no]
indeed. but on top of that, the font reports itself as a math font so 
that confuses the fallback mechanism (we have fundamental different 
approaches for math and text fonts) ... i'll try to deal with it but to 
some extend consider spending time on crappy fonts a bit of a waste

-----------------------------------------------------------------
                                           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: Typescript/fallbacks problem
  2017-05-27 11:34     ` Hans Hagen
@ 2017-05-27 16:14       ` Mohammad Hossein Bateni
  2017-05-27 17:00         ` Hans Hagen
  0 siblings, 1 reply; 5+ messages in thread
From: Mohammad Hossein Bateni @ 2017-05-27 16:14 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Otared Kavian


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

Hans and Otared, thanks a lot for your attention.  I do appreciate your
time.

Otared:

The fallback was called "dejavudefault" on my machine when I was testing
it.  I changed the name in the email, to make the lines shorter, but
apparently I missed some instances—sorry—and that made it to the version I
uploaded also.

Hans:

I'm really sorry for wasting your time with these low-quality fonts... but
unfortunately these are among the few open-source Farsi fonts, and they are
simple enough to be extendible.  The font designer is not a professional,
but accepts bug reports, suggestions, etc.  So I spend some time finding
issues and fixing/reporting them.

Could you explain a bit about the "identifying as a math font" part?  What
is the sign of that?  To fix it, should I remove all the math-related
fields in the font?  Was the math thing only in the regular font or also in
bold?  Because I noticed the problem only in the regular shape.

On Sat, May 27, 2017 at 7:34 AM, Hans Hagen <pragma@wxs.nl> wrote:

> On 5/27/2017 11:39 AM, Otared Kavian wrote:
>
>> Hi Mohammad Hossein,
>>
>> Your report is beyond my knowledge, but I would like to ask you a
>> question about the setup of fallback fonts: why are you referring to «
>> dejavudef » in the commands such as
>>
>>   \definefontsynonym [SahelBd]       [SahelBold][features={arabic,
>> tlig},fallbacks=dejavudef]
>>
>> while you have defined before « dejavudefault » (and not « dejavudef »)
>> in:
>>
>> \definefontfallback[dejavudefault][dejavusans]
>> [range=generalpunctuation,check=yes,force=no]
>>
> indeed. but on top of that, the font reports itself as a math font so that
> confuses the fallback mechanism (we have fundamental different approaches
> for math and text fonts) ... i'll try to deal with it but to some extend
> consider spending time on crappy fonts a bit of a waste
>
> -----------------------------------------------------------------
>                                           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/list
> info/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : http://contextgarden.net
> ____________________________________________________________
> _______________________
>

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

[-- Attachment #2: Type: text/plain, Size: 492 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: Typescript/fallbacks problem
  2017-05-27 16:14       ` Mohammad Hossein Bateni
@ 2017-05-27 17:00         ` Hans Hagen
  0 siblings, 0 replies; 5+ messages in thread
From: Hans Hagen @ 2017-05-27 17:00 UTC (permalink / raw)
  To: ntg-context

On 5/27/2017 6:14 PM, Mohammad Hossein Bateni wrote:
> Hans and Otared, thanks a lot for your attention.  I do appreciate your 
> time.
> 
> Otared:
> 
> The fallback was called "dejavudefault" on my machine when I was testing 
> it.  I changed the name in the email, to make the lines shorter, but 
> apparently I missed some instances—sorry—and that made it to the version 
> I uploaded also.
> 
> Hans:
> 
> I'm really sorry for wasting your time with these low-quality fonts... 
> but unfortunately these are among the few open-source Farsi fonts, and 
> they are simple enough to be extendible.  The font designer is not a 
> professional, but accepts bug reports, suggestions, etc.  So I spend 
> some time finding issues and fixing/reporting them.
> 
> Could you explain a bit about the "identifying as a math font" part?  
> What is the sign of that?  To fix it, should I remove all the 
> math-related fields in the font?  Was the math thing only in the regular 
> font or also in bold?  Because I noticed the problem only in the regular 
> shape.

it has a math constants table and a math script feature (but no math 
support afaiks) and in soem cases context does checks for a font being a 
math font

anyway, the next beta should (sort of) work

> On Sat, May 27, 2017 at 7:34 AM, Hans Hagen <pragma@wxs.nl 
> <mailto:pragma@wxs.nl>> wrote:
> 
>     On 5/27/2017 11:39 AM, Otared Kavian wrote:
> 
>         Hi Mohammad Hossein,
> 
>         Your report is beyond my knowledge, but I would like to ask you
>         a question about the setup of fallback fonts: why are you
>         referring to « dejavudef » in the commands such as
> 
>            \definefontsynonym [SahelBd]     
>           [SahelBold][features={arabic,tlig},fallbacks=dejavudef]
> 
>         while you have defined before « dejavudefault » (and not «
>         dejavudef ») in:
> 
>         \definefontfallback[dejavudefault][dejavusans]
>         [range=generalpunctuation,check=yes,force=no]
> 
>     indeed. but on top of that, the font reports itself as a math font
>     so that confuses the fallback mechanism (we have fundamental
>     different approaches for math and text fonts) ... i'll try to deal
>     with it but to some extend consider spending time on crappy fonts a
>     bit of a waste
> 
>     -----------------------------------------------------------------
>                                                Hans Hagen | PRAGMA ADE
>                    Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>             tel: 038 477 53 69 | www.pragma-ade.nl
>     <http://www.pragma-ade.nl> | www.pragma-pod.nl
>     <http://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 <mailto:ntg-context@ntg.nl> /
>     http://www.ntg.nl/mailman/listinfo/ntg-context
>     <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/
>     <https://bitbucket.org/phg/context-mirror/commits/>
>     wiki     : http://contextgarden.net
>     ___________________________________________________________________________________
> 
> 
> 
> 
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________
> 


-- 

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

end of thread, other threads:[~2017-05-27 17:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CAMHZ1daucwXqw0aAuwS9UzODKAA-AiKkQjcPVKO1=nYt8rx-9w@mail.gmail.com>
2017-05-26  3:52 ` Typescript/fallbacks problem Mohammad Hossein Bateni
2017-05-27  9:39   ` Otared Kavian
2017-05-27 11:34     ` Hans Hagen
2017-05-27 16:14       ` Mohammad Hossein Bateni
2017-05-27 17:00         ` 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).