sumatrapdfreader / sumatrapdf

SumatraPDF reader
http://www.sumatrapdfreader.org
GNU General Public License v3.0
13.66k stars 1.73k forks source link

Tamil text rendered in UI but not in epub content #4428

Closed 9viz closed 3 months ago

9viz commented 3 months ago

SumatraPDF version

Describe the bug Just like #4377, Tamil text in the TOC is rendered just fine but Tamil text in the epub content itself is rendered as tofu blocks. This is Windows 11.

To Reproduce

  1. Download epub file from https://freetamilebooks.com/ebooks/letters_of_peraringar_anna_6/
  2. Open it in SumatraPDF
  3. Scroll down to move past the cover image to witness the TOFU characters

Expected behavior Tamil text is rendered.

Screenshots Screenshot_2024-08-02_134348

GitHubRulesOK commented 3 months ago

There is no problem when the author defines the fonts for the reader to use so both the bigger PDF and MOBI work well they have clearly defined font or "fall back". the ePubs are often modified using Calibre where it normally supplies its own fonts and the files is often not including suitable resource or poorly defined. image

So a font has been included but is not applied by SumatraPDF ? image

image

Edge over a period of time had ePub support in Old Edge long time prior to version 111 and from version 111 was optional but seems to be removed again in 126 - 129 as it no longer works for me !

Will the new Microsoft Edge support ePub? Is that planned for? We are not supporting ePub in the new Microsoft Edge and there is no immediate plan to support it. Additionally, ePub support has been removed from Microsoft Edge Legacy. However, Microsoft has partnered with companies such as DAISY consortium to bring accessible ePub apps to the Microsoft Store. You can review the current set of recommended apps in the Microsoft Store collection.

9viz commented 3 months ago

FWIW, the problem remains even if the epub file does not provide a font (and no CSS file or any such directives to specify a font to use). I can share such a file if required, these are produced by me without the use of calibre or any such software.

GitHubRulesOK commented 3 months ago

@9viz That was my point unless the font is supplied & / or applied correctly the page does not include any characters, So the problem is how the font is to be applied. MuPDF is not like Edge or other ePub reader, but needs the fonts defined.

Edge is having to use Aptos ! image

but MuPDF does use the font included however SumatraPDF is not. image

9viz commented 3 months ago

MuPDF in my Linux laptop simply uses the system font if no font is specified. This is what I would expect from SumatraPDF as well.

kjk commented 3 months ago

@9viz Do you know which windows font is appropriate for Tamil language? I meant the file name of the font file?

I can implement the fallback of reading the system font but don't know which one is it or how to detect the right font.

9viz commented 3 months ago

@kjk Thanks! As per this page https://learn.microsoft.com/en-us/windows/apps/design/globalizing/loc-international-fonts, the only Tamil font is Nirmala UI which I can confirm.

9viz commented 3 months ago

I tested the latest prerelease and I can confirm that Tamil text is rendered whether or not a font to use is provided. Thanks for your quick response!