![]() |
#1 |
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Oct 2024
Device: reMarkable
|
Noto Sans Mono CJK font missing in code view font
Hello!
Thanks for creating and maintaining Sigil which is an amazing piece of software. Today, when editing XHTML, I found that the mono font in the code view does not line up Kanji/汉字 and English characters. From searching online, I found that using Noto Sans Mono CJK will solve the issue. Since I ran Sigil on a Linux-based system, this font is already available on my system. However, I cannot set the Noto Sans Mono CJK on "Preferences->Code view" despite the font being available in "Preferences->Main UI". The font is listed under "Insert Special Characters" but not under "Monospaced Code font". I think this should be an easy fix. Maybe listing all the fonts with "mono" in their name under the font selection. Cheers. |
![]() |
![]() |
![]() |
#2 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,771
Karma: 6000000
Join Date: Nov 2009
Device: many
|
Then for some reason Qt does not think it is a monospaced font. Thre really is not anything we can do to fix this from our end. You will need to use font-forge to "fix" that font to make it properly indicate it is a monospaced font if that is indeed the case. The actual font family name or file name is not sufficient.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,577
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
The font files themselves need to tell Sigil/Qt that they're a monospaced font. Noto Sans Mono CJK must not be doing that properly. We're probably not going to change Sigil to overcome a font's shortcomings by trying to parse file names.
|
![]() |
![]() |
![]() |
#4 |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 46,288
Karma: 169098402
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
For what it may be worth, the Noto Sans Mono fonts have glyphs that do not fit the fixed width. A check using fc-scan does not show the expected spacing = 100 for a monospaced font. Using FontForge under Windows under Font Information => OS/2 => Panose => Proportion does not show Monospaced.
There have been quite a few discussions about how QT decided a font is monospaced and issues with the Noto San Mono fonts. If anyone is suffering from insomnia, you can check Noto Sans Mono doesn't declare spacing property on GitHub especially the last comment. And continuing on, this item from QT's bugs: Qt fails to consider dual-width fonts mono with fontconfig. Last edited by DNSB; 10-26-2024 at 12:30 AM. Reason: Added link to GitHub discussion |
![]() |
![]() |
![]() |
#5 | ||
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Oct 2024
Device: reMarkable
|
Thank you for your reply.
After some searching, I found this gnome thread also listing a similar issue: https://gitlab.gnome.org/GNOME/gnome.../-/issues/7960 Quote:
Quote:
![]() The text is going to look terrible if we change the font to fit the "spacing property of 100" criteria AND it is going to take a long time for people to change this criterion because of how the open-source community works. It could be helpful to make a toggle for the mono font filter, as suggested in the gnome thread above. This will also solve the issue in this thread of 2019: https://www.mobileread.com/forums/sh...d.php?t=320386. But I understand that this issue is not very urgent, and the developer's time is limited. I spent some time finding the correct field for the font family settings in the sigil.ini, it is under a different name compared to the 2019 thread above, the names are as follows: Code:
$ ack font '~/.var/app/com.sigil_ebook.Sigil/data/sigil-ebook/sigil/' ~/.var/app/com.sigil_ebook.Sigil/data/sigil-ebook/sigil/sigil.ini 516:cv_dark_font_family_standard=Nimbus Mono PS 517:cv_dark_font_size=14 537:original_ui_font="Cantarell,11,-1,5,50,0,0,0,0,0" 542:preview_font_family_sans_serif=C059 543:preview_font_family_serif=Times New Roman 544:preview_font_family_standard=C059 545:preview_font_size=16
Now the text looks much better, before this the code view had different line spacing, is like a giant building with each window having a different width and height. |
||
![]() |
![]() |
Advert | |
|
![]() |
Thread Tools | Search this Thread |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Code view what font? | JSWolf | Editor | 2 | 11-23-2023 09:47 AM |
Code View font choices | tetrault | Sigil | 3 | 05-28-2019 03:11 PM |
Italic missing with Sans font | Armaell | Conversion | 4 | 11-20-2015 03:34 AM |
How do I change the syntax colouring and increase the font size in the Code View? | nicciglen | Sigil | 5 | 02-08-2012 09:34 AM |
Changing font for code view mode | matthewyi | Sigil | 2 | 11-05-2009 02:20 PM |