Dear all, there were some discussions on pdf viewers on the list and I know that things are not always fine. I now have a problems with the Firefox pdf viewer and TeX Gyre Heros. The font looks uneven in FF, no problems elsewhere. When I scroll into the pdf to set the display to 150% or more the font shows up just fine. So it seems to be a display problems with firefox. I tried several pdf versions no change. My configuration: \definefontfamily[mainfont][serif][texgyreheros] \definefontfamily[mainfont][sans] [textgyreheros] \definefontfamily[mainfont][mono] [texgyrecursor][features=none] \definefontfamily[mainfont][math] [texgyrepagellamath] \definefallbackfamily [mainfont] [rm] [Latin Modern Math] [scale=0.925, range=0x22C0] \definefontfeature[smallcaps][script=latn, protrusion=quality, expansion=quality, smcp=yes, onum=yes, pnum=yes] \setupalign[hz,hanging] \setupitaliccorrection[global, always] Is there anything I can do? And the is another issue: To my big surprise ArialBold MT is included into the file. I am using the current lmtx. If you want to see the effect, download the pdf. https://www.hostsharing.net/publikationen/vereinshandbuch/ Just click on "Anonym herunterladen" no need to register. TIA juh -- Autoren-Homepage: ......... http://literatur.hasecke.com Satiren & Essays: ......... http://www.sudelbuch.de Privater Blog: ............ http://www.hasecke.eu Netzliteratur-Projekt: .... http://www.generationenprojekt.de
On 3/10/2022 1:44 PM, juh via ntg-context wrote:
Dear all,
there were some discussions on pdf viewers on the list and I know that things are not always fine. I now have a problems with the Firefox pdf viewer and TeX Gyre Heros.
The font looks uneven in FF, no problems elsewhere.
so a ff problem then
When I scroll into the pdf to set the display to 150% or more the font shows up just fine. So it seems to be a display problems with firefox.
I tried several pdf versions no change.
My configuration:
\definefontfamily[mainfont][serif][texgyreheros] \definefontfamily[mainfont][sans] [textgyreheros] \definefontfamily[mainfont][mono] [texgyrecursor][features=none] \definefontfamily[mainfont][math] [texgyrepagellamath]
\definefallbackfamily [mainfont] [rm] [Latin Modern Math] [scale=0.925, range=0x22C0]
\definefontfeature[smallcaps][script=latn, protrusion=quality, expansion=quality, smcp=yes, onum=yes, pnum=yes] \setupalign[hz,hanging] \setupitaliccorrection[global, always]
Is there anything I can do?
And the is another issue: To my big surprise ArialBold MT is included into the file. mtxrun --script pdf --fonts hostsharing-vereinshandbuch.pdf
the arial comes from an image ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
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 ------------------------------------ ----------------- ---------------- --- --- --- --------- BAAAAA+TeXGyreHeros-Regular Type 1 Builtin 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
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
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 waaaaaay 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
I reported the bug to Mozilla and they answered very fast. Sadly up too now without a good solution. They hint to LuaMetaTex as the cause of the problem. You can follow the discussion here. https://bugzilla.mozilla.org/show_bug.cgi?id=1781022 juh
On 7/25/22 14:00, juh+ntg-context--- via ntg-context wrote:
I reported the bug to Mozilla and they answered very fast.
Sadly up too now without a good solution.
Many thanks for the bug report.
They hint to LuaMetaTex as the cause of the problem. You can follow the discussion here.
I would like to compare the LMTX output with the one from LuaTeX. Sadly, as already reported, LuaTeX doesn’t work on Linux anymore.
From the two questions from Jonathan Kew, HTML with TeX Gyre Heros is displayed fine. I extracted the font from the PDF output document (with a source document similar to https://mailman.ntg.nl/pipermail/ntg-context/2022/106302.html) with "mutools extract", but some info may be missing and Firefox cannot use it to display the HTML file. I extracted the font with Fontforge and it was displayed perfectly fine. But I guess Fontforge is adding some info when generating the OTF font (font size is bigger: 4KB and 2.3KB when extracted with mutools). I’m no font expert, but what astonishes me is that it isn’t clear whether the font has lost the hinting information or not with LMTX (sorry if I got this wrong). I have no idea whether Identity-H may be preventing the FreeType autohinter from working properly. But ft-view (from freetype-demos) displays poorly the font extracted without FontForge (unlike the font extracted with it). I attach the first font. After switching hinting from on to auto, the autohinter displays the font way better. To reproduce the issue "ftview 20 font-0009.otf" and press "a". Just in case it might help, Pablo
On 7/25/2022 7:52 PM, Pablo Rodriguez via ntg-context wrote:
Just in case it might help, Hinting is optionally and not needed on todays high res screens anyway. I see no need to spend time of that at our end.
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 -----------------------------------------------------------------
On Mon, Jul 25, 2022 at 7:52 PM Pablo Rodriguez via ntg-context < ntg-context@ntg.nl> wrote:
Sadly, as already reported, LuaTeX doesn’t work on Linux anymore.
hm.... at least luatex on x86-64 is still ok, as far as I know. -- luigi
On 7/25/22 20:19, luigi scarso via ntg-context wrote:
On Mon, Jul 25, 2022 at 7:52 PM Pablo Rodriguez via ntg-context wrote:
Sadly, as already reported, LuaTeX doesn’t work on Linux anymore.
hm.... at least luatex on x86-64 is still ok, as far as I know.
Luigi, many thanks for your reply. I was totally wrong. LuaTeX in LMTX is working fine. It was my fault. I have just discovered that I wasn’t able to generate the format file, because texlive-luatex is a dependency in Fedora. "export PATH=~/context/tex/texmf-linux-64/bin" solves the clash of paths and it allows to generate the format file. Sorry for the noise and many thanks for your help, Pablo
On 7/25/22 14:00, juh+ntg-context--- via ntg-context wrote:
[...] They hint to LuaMetaTex as the cause of the problem. You can follow the discussion here.
Hi juh, this should have been fixed in current latest. So I think it may be safe to close the issue. Sorry, but I cannot access to my Mozilla account temporarily (and I think you may close your issue without having to ask administrators). Many thanks for your help, Pablo
Dear Pablo, Am Sun, Oct 16, 2022 at 08:43:25PM +0200 schrieb Pablo Rodriguez via ntg-context:
On 7/25/22 14:00, juh+ntg-context--- via ntg-context wrote:
[...] They hint to LuaMetaTex as the cause of the problem. You can follow the discussion here.
Hi juh,
this should have been fixed in current latest. So I think it may be safe to close the issue.
Sorry, but I cannot access to my Mozilla account temporarily (and I think you may close your issue without having to ask administrators).
Thanks for the hint. I will test the new upload and close the bug. A first look into pdfjs/firefox on my notebook is looking good. Many thanks to our developers to fix this so quickly. juh -- Autoren-Homepage: ......... http://literatur.hasecke.com Satiren & Essays: ......... http://www.sudelbuch.de Privater Blog: ............ http://www.hasecke.eu Netzliteratur-Projekt: .... http://www.generationenprojekt.de
participants (7)
-
Hans Hagen
-
Hans Hagen
-
juh
-
juh+ntg-context@mailbox.org
-
luigi scarso
-
Max Chernoff
-
Pablo Rodriguez