Ugly non-US characters in Preview mode and PDF export

Bug #1942434 reported by psl
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
retext (Ubuntu)
New
Undecided
Unassigned

Bug Description

Linux Mint 19.3 (Ubuntu 18.04)
retext 7.0.1-1

I tried to write a text in Czech language and I see that "czech characters" are rendered in really ugly way. I see this problem in preview mode and in PDF export. HTML export is good, HTML browser renders non-US characters as expected.

I am not sure if this is Retext problem, it could be problem of fonts that are in Ubuntu. Anyway, the result is really bad :-(

DEMO markdown:

```
# Příliš žluťoučký kůň úpěl ďábelské ódy

## Příliš žluťoučký kůň úpěl ďábelské ódy

### Příliš žluťoučký kůň úpěl ďábelské ódy

Příliš žluťoučký kůň úpěl ďábelské ódy

*Příliš žluťoučký kůň úpěl ďábelské ódy*

**Příliš žluťoučký kůň úpěl ďábelské ódy**

***Příliš žluťoučký kůň úpěl ďábelské ódy***

`Příliš žluťoučký kůň úpěl ďábelské ódy`

*`Příliš žluťoučký kůň úpěl ďábelské ódy`*

**`Příliš žluťoučký kůň úpěl ďábelské ódy`**

***`Příliš žluťoučký kůň úpěl ďábelské ódy`***

```

Revision history for this message
psl (slansky) wrote :
Revision history for this message
psl (slansky) wrote :
Revision history for this message
psl (slansky) wrote :
Revision history for this message
Dmitry Shachnev (mitya57) wrote :

It is a problem with your font. In PDF file, the main font is CharterBT which seems to not support extended Latin. You can change it with Edit → Change preview font, please try that.

Revision history for this message
psl (slansky) wrote :

First, I was not able to find the way to change the font, I was looking to preferences and it is not there, so I assumed that my version of ReText cannot change font in an easy way and I was looking to creation of custom css file. Later I realized my mistake, I can change the editor and preview font, it is at different place, directly in menu.

I changed font to "DejaVu Serif" (this font works good), and it is written to config file:

```
$ cat ~/.config/ReText\ project/ReText.conf
```
```
[General]
font=DejaVu Serif
fontSize=12
recentFileList=/home/user/test-font-cz.mkd, /home/user/test-list.mkd
```

From my point of view, ReText should define some well known default font. Any idea why "exotic" font is selected when user doesn't define custom font?

Revision history for this message
psl (slansky) wrote :

I was too fast. Preview font is fixed but export to PDF uses different font (CharterBT?), no change here :-(

Revision history for this message
psl (slansky) wrote :

I was wrong. PDF export uses font "DejaVu Serif (/FontName /QMAAAA+DejaVuSerif) but result is not good, it could be problem with font. I will try to experiment with fonts...

Revision history for this message
psl (slansky) wrote :

When I define custom preview font in ReText, only 1 font is in PDF export:

$ pdffonts font-test-cz.pdf
name type encoding emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
DejaVuSerif CID TrueType Identity-H yes no yes 7 0

When no font was defined (default) many fonts are in PDF export:

$ pdffonts font-test-cz1.pdf
name type encoding emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
CharterBT-Bold CID TrueType Identity-H yes no yes 7 0
DejaVuSans-Bold CID TrueType Identity-H yes no yes 8 0
AbyssinicaSIL CID TrueType Identity-H yes no yes 9 0
DejaVuSans CID TrueType Identity-H yes no yes 10 0
CharterBT-Italic CID TrueType Identity-H yes no yes 11 0
CharterBT-BoldItalic CID TrueType Identity-H yes no yes 12 0

Revision history for this message
psl (slansky) wrote :

I am not typographer and I never took too much attention to fonts. I am surprised how bad it can be...

I have found good font, it is "Serif". PDF export has good quality with following settings:

$ cat ~/.config/ReText\ project/ReText.conf
[General]
font=Serif
fontSize=12
recentFileList=/home/user/test-font-cz.mkd, /home/user/test-list.mkd

$ pdffonts font-test-cz3.pdf
name type encoding emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
DejaVuSerif-Bold CID TrueType Identity-H yes no yes 7 0
DejaVuSerif CID TrueType Identity-H yes no yes 8 0

Revision history for this message
psl (slansky) wrote :

I see new issue. When I select preview font, I can set "font style", like regular, italic, bold, normal, oblique, etc. This information is not saved to ReText.conf file; only font name and size is stored. It means that once Retext is started in the future, it can show different style in preview mode (and in PDF export). It is also possible to select font effects, like strike or underline but these are not saved to ReText.conf.

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

> When no font was defined (default) many fonts are in PDF export

This is because the default font doesn't contain Czech characters, so ReText's text engine has to fallback to other fonts.

> I see new issue. When I select preview font, I can set "font style", like regular, italic, bold, normal, oblique, etc. This information is not saved to ReText.conf file; only font name and size is stored.

This will be fixed in the next release: https://github.com/retext-project/retext/commit/1f1b55725960a8b7. Unfortunately, it also means that old settings will not work after upgrading, and you will have to select font from the dialog again to get the updated settings.

> It means that once Retext is started in the future, it can show different style in preview mode (and in PDF export).

No, it shouldn't do that. It should always select the regular variant (non-bold, non-italic, etc.).

psl (slansky)
description: updated
psl (slansky)
description: updated
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.