Re: [NTG-context] debugging lmtx and firefox (was: TeXGyre Heros on Firefox)

2022-07-22 Thread Max Chernoff via ntg-context


> the firefox pdf viewer has problems with at least two sans serif
> fonts.
> 
> Using this mwe I get a bad display in ff with Gyre font and Alegreya
> Font.
> 

What do you mean by "bad display"? Are the fonts blurry, or are the
shapes all slightly distorted? Your test file displays fine on my
system.

> But there are many Firefox users out there who never use a real 
> pdf-viewer. I would like to show them a good result.

I've been using Firefox (and pdf.js) as my PDF viewer almost exclusively
for the past ~2 years, and I've been using ConTeXt LMTX for about the
same amount of time. I haven't noticed any font issues, so I suspect
that this issue is system-dependant. I've mostly been on Windows for the
past few years, but I'm now on Linux, and I haven't noticed any issues
with either.

> I have no idea if the difference is the cause of the bad display.
> 
> Luckily chrome based browsers shows the fonts without any flaws.

Ok, random guess time (so I may be waay off here):

I think that this is a hinting problem. The TeX Gyre fonts are all
professionally hinted, so what might be happening be that when ConTeXt
is subsetting the fonts, it is removing all of the hinting information,
while LibreOffice is keeping all of the hints. I've opened PDFs from
ConTeXt and LibreOffice in FontForge and the hints are still there, so I
don't think that this is the case, but maybe? The hinting format is also
wildly different between Type 1 and CFF/OTF, so maybe there is just a
bug in one of the font renderers. 

Chrome uses an internal backend to render all of its text, but Firefox
uses system-dependant backends (I think). Most renderers these days will
autohint unhinted fonts using an embedded FreeType so that they still
display somewhat-well. You can adjust the "hinting strength" in
FreeType, which I would guess would usually be set to the maximum. So
LibreOffice includes the font hints and things display fine, and Chrome
uses a bundled FreeType with maximum hinting so things display fine.

Firefox on Windows would need to bundle its own FreeType since there
isn't a system one, and it renders fine in my experience. But Firefox on
Linux would just use the system FreeType. I think that you are on Linux
(?) and the default in Linux is for minimal/no hinting. Now, I've
specifically enabled maximum hinting on my system, and I'm not seeing
any problems with rendering. If you're using Gnome, can you try enabling
"full" hinting in Gnome Tweaks, reboot, then test again? No idea how to
configure this with other DEs, but I'm sure that it's possible. 

Another related guess is that older versions of FreeType maybe had a bug
with parsing/displaying hints. I think that Chrome bundles its own
FreeType which would be recent, but if you're using Firefox on Linux, it
is probably using the system FreeType library. If you're on an older LTS
distro, then the system FreeType may be really old and buggy.

If you're using macOS, I can't really help you too much except for to
say that text rendering on macOS is usually pretty bad unless you have a
really high resolution screen.

So those are my random guesses. Maybe one of them is helpful somehow.

-- Max
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] debugging lmtx and firefox (was: TeXGyre Heros on Firefox)

2022-07-22 Thread Pablo Rodriguez via ntg-context
On 7/22/22 12:37, juh+ntg-context--- via ntg-context wrote:
> Dear all,
>
> the firefox pdf viewer has problems with at least two sans serif fonts.
> [...]
>
> Where Libreoffice has type "Type 1", lmtx has "CID Type 0C".
>
> Where Libreoffice has encoding "Builtin", lmtx has "Identity-H".
>
> I have no idea if the difference is the cause of the bad display.

Dear Jan Ulrich,

it may be the font type, the enconding (or who knows what).

> Any ideas how I can achieve this?

I’d rather report the issue (attaching both PDF documents and both
outputs from pdffonts) at https://github.com/mozilla/pdf.js/issues/new.

I reported an issue with PDF.js not displaying the cover of
http://www.pragma-ade.com/general/manuals/xml-mkiv.pdf.

The day after my report the fix was merged.

Just in case it may help,

Pablo
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] debugging lmtx and firefox (was: TeXGyre Heros on Firefox)

2022-07-22 Thread juh+ntg-context--- via ntg-context

Dear all,

the firefox pdf viewer has problems with at least two sans serif fonts.

Using this mwe I get a bad display in ff with Gyre font and Alegreya Font.

%\definefontfamily[mainfont][sans][AlegreyaSans]
\definefontfamily[mainfont][sans][texgyreheros]
\setupbodyfont  [mainfont,12pt]
\startdocument
  \starttext
  \input lorem
\stoptext
\stopdocument

When I create a pdf from LibreOffice with these fonts I have a good display.

pdffonts shows different font inclusion:


pdffonts libreoffice.pdf
name type  encoding 
emb sub uni object ID
 -  
--- --- --- -
BA+TeXGyreHeros-Regular  Type 1Builtin 
yes yes yes  9  0


pdffonts mwe.pdf
name type  encoding 
emb sub uni object ID
 -  
--- --- --- -
SOVKKO+TeXGyreHeros-Regular  CID Type 0C   Identity-H 
yes yes yes  1  0



Where Libreoffice has type "Type 1", lmtx has "CID Type 0C".

Where Libreoffice has encoding "Builtin", lmtx has "Identity-H".

I have no idea if the difference is the cause of the bad display.

Luckily chrome based browsers shows the fonts without any flaws.

But there are many Firefox users out there who never use a real 
pdf-viewer. I would like to show them a good result.


Any ideas how I can achieve this?

juh

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] overfull lines

2022-07-22 Thread Steffen Wolfrum via ntg-context


> Am 22.07.2022 um 10:05 schrieb Hans Hagen via ntg-context 
> :
> 
> On 7/21/2022 5:02 PM, Steffen Wolfrum via ntg-context wrote:
>> Hi,
>> the command \version[temporary] shows an overfullrule when lines are set 
>> overfull.
>> How does this work also in footnotes?
>> MWE:
>> \setuppapersize[A10]
>> \overfullrule5\points
>> %\version[temporary]
>> \starttext
>> \showframe
>> XX\footnote{xxx}
>> \stoptext
> \let\dontcomplain\relax

… no, I can't complain ;o)

Thank you! Steffen
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] overfull lines

2022-07-22 Thread Hans Hagen via ntg-context

On 7/21/2022 5:02 PM, Steffen Wolfrum via ntg-context wrote:

Hi,

the command \version[temporary] shows an overfullrule when lines are set 
overfull.

How does this work also in footnotes?

MWE:

\setuppapersize[A10]

\overfullrule5\points
%\version[temporary]

\starttext

\showframe

XX\footnote{xxx}

\stoptext

\let\dontcomplain\relax


-
  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 / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___