Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 09-17-2026, 02:38 PM   #46
BeckyEbook
Wizard
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 1,047
Karma: 3883259
Join Date: Jan 2017
Location: Poland
Device: Various
For Windows:
1. delete .qmake.stash
2. in file "SelectCharacter.cpp" in line 111 set path to file "characters.txt". Notice: use double backslashes, eg.
QString custom_path = "W:\\Develop\\special_char\\characters.txt";
3. run console (x64 Native Tools Command Prompt for VS)
4. run qmake (will create new .qmake.stash file)
5. run nmake and wait (remember: NMAKE)
6. in subfolder "release" should be "flowlayout.exe" file
7. run this exe file

It works, and overall it's OK. This is exactly the effect I was going for – wrapping the characters to fit the width of the window while keeping the groups fixed.
I'd probably condense the spacing between the groups a bit, but that's just an aesthetic detail.
Attached Thumbnails
Click image for larger version

Name:	isc-test-win10.png
Views:	10
Size:	32.8 KB
ID:	226013  

Last edited by BeckyEbook; 09-17-2026 at 02:48 PM.
BeckyEbook is online now   Reply With Quote
Old 09-17-2026, 02:59 PM   #47
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 10,070
Karma: 7518950
Join Date: Nov 2009
Device: many
Yes the spacing between groups by default is 0 since the linebreak is really an invisible QWidget and without layout spacing/margins there is no gap at all.

So I hardcoded an additional height of 15 in the dolayout routine in FlowLayout.cpp. Just look for the "if" that isLineBreak and tweak what gets added to y height.

The problem with a flowlayout is that two back to back linebreaks adds no intergroup spacing at all without that hard coded addition.


I thought the make distclean removed the qmake stash.

And yes, fix the path to characters.txt in SelectCharacter.cpp not windows.cpp. My bad!


Thanks for getting it working on Windows. Please make what tweaks you want and then I will start the conversion to xml.

Thanks

Kevin

Last edited by KevinH; 09-17-2026 at 03:06 PM.
KevinH is online now   Reply With Quote
Old 09-17-2026, 03:41 PM   #48
BeckyEbook
Wizard
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 1,047
Karma: 3883259
Join Date: Jan 2017
Location: Poland
Device: Various
I think it's enough to remove the extra "+15" from the height, since the groups already clearly separate the blocks. I've been experimenting with making the group names bold, and I think that's worth considering as well.

Code:
y = y + lineHeight + verticalSpacing();

Code:
            QLabel* lbl = new QLabel(insert_text);
            QFont labelFont = lbl->font();
            labelFont.setBold(true);
            lbl->setFont(labelFont);
Attached Thumbnails
Click image for larger version

Name:	isc-test-win10-dark.png
Views:	15
Size:	46.5 KB
ID:	226018  
BeckyEbook is online now   Reply With Quote
Old 09-17-2026, 05:44 PM   #49
BeckyEbook
Wizard
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 1,047
Karma: 3883259
Join Date: Jan 2017
Location: Poland
Device: Various
Maybe we could also include the color in the group name? I have to admit that in my mind, this window looked very similar.
Attached Thumbnails
Click image for larger version

Name:	isc-label-color-light.png
Views:	17
Size:	39.7 KB
ID:	226019   Click image for larger version

Name:	isc-label-color-dark.png
Views:	15
Size:	41.4 KB
ID:	226020  
BeckyEbook is online now   Reply With Quote
Old 09-17-2026, 06:23 PM   #50
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 10,070
Karma: 7518950
Join Date: Nov 2009
Device: many
Without that 15 added in there is no spacing at all between the groups on MacOS, so we will need to do something platform specific here. Literally, the top of the heading touches the bottom of the preceding line text.

Let's worry about heading colours at some later point. Hard coding colours to work in all platforms under both dark and light is hard especially on Linux. Those types of tweaks can come later.

Functionally, is this proof of concept working enough to go ahead and convert it to xml?

Last edited by KevinH; 09-17-2026 at 06:26 PM.
KevinH is online now   Reply With Quote
Old 09-17-2026, 07:49 PM   #51
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 54,523
Karma: 182340323
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by KevinH View Post
Functionally, is this proof of concept working enough to go ahead and convert it to xml?
Other than the joy of figuring out that I misspelled QT_PLUGIN_PATH (you don't spell plugin with two g's?), it looks good here. I added my personal selection as another group and continued looking good.
DNSB is online now   Reply With Quote
Old 09-18-2026, 12:53 AM   #52
BeckyEbook
Wizard
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 1,047
Karma: 3883259
Join Date: Jan 2017
Location: Poland
Device: Various
Yes, OK for me.
BeckyEbook is online now   Reply With Quote
Old 09-18-2026, 09:15 AM   #53
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 29,769
Karma: 212614993
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by KevinH View Post
Let's worry about heading colours at some later point. Hard coding colours to work in all platforms under both dark and light is hard especially on Linux. Those types of tweaks can come later.
Remember that qss has a palette() function that takes Qt's color roles as a parameter. No need to hardcode a single color that has to work with all platforms/all themes.
DiapDealer is online now   Reply With Quote
Old 09-18-2026, 01:04 PM   #54
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 10,070
Karma: 7518950
Join Date: Nov 2009
Device: many
Okay, I have modified the FlowLayout to have its own addLineBreak() routine to better encapsulate that code and remove SelectCharacter's GenFlowLineBreak routine. Then I modified the FlowLayout code to be smarter about vertical spacing for all platforms including the Mac, and removed the hard coded + 15.

I am finally seeing on the Mac something much closer to what BeckEbook's images show.

I will now start the process of converting it to xml, next.
KevinH is online now   Reply With Quote
Old Yesterday, 02:39 PM   #55
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 10,070
Karma: 7518950
Join Date: Nov 2009
Device: many
Been tied up with bug fixes for AdjustImage and so just started looking at this now.

I would like to keep the 4 internal strings for each special char, but it would be nice to simplify what gets read in from special_characters.xml and auto generate things we can.

so instead of trying to use what we have now but in xml format:

Code:
<char str=" " label="nbsp"  entity="&#x00A0 ;" desc="non-breaking space" />
Especially since the str value must be saved and edited as utf-8 sequence in xml,
I would like to simplify this to the following:

Code:
<cp hex="A0" label="nbsp" desc="non-breaking space" />
where cp tepresents a codepoint with attribute desc being fully optional, and attribute label if empty is filled automatically by the converted codepoint hex, and entity is also auto generated from the codepoint hex code. All labels and desc values are considered to be in the Sigil user's language so no huge set of 65k+ descriptions are needed by translators.

Also any group headings are also considered to be in the users language as well.

Thoughts?

Last edited by KevinH; Yesterday at 02:41 PM.
KevinH is online now   Reply With Quote
Old Yesterday, 03:07 PM   #56
BeckyEbook
Wizard
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 1,047
Karma: 3883259
Join Date: Jan 2017
Location: Poland
Device: Various
That's fine with me.
BeckyEbook is online now   Reply With Quote
Old Yesterday, 06:16 PM   #57
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 10,070
Karma: 7518950
Join Date: Nov 2009
Device: many
Okay, I took a quick and dirty approach to reading in and using a special_characters.xml file.

This is just for proof of concept and so that you can see and work with the xml format. It needs to be greatly cleaned up.

To help speed things up, I have included a cvrt.py python program that will read in local characters.txt and create a local special_characters.xml file.

I just threw the cvrt.py together so no nasty comments about crap python code!

I have improved the FlowLayout code to not need the extra macOS + 15 offset.

It should use qmake and make / nmake.

I have attached the new special_char.zip file with all changes.

Please play around with the new xml code format and let me know what you think. Right now if it is not well formed, QXmlStreamReader will fail and a debug message is written out as qDebug.

So you can turn on debug log files and capture any xml error. We can make this easier to do in the future. Any failure in load results in the old grid layout being used instead.

Just like any other xml it is very picky.

Check out cvrt.py to see how it was auto generated.
Attached Files
File Type: zip special_char.zip (37.2 KB, 3 views)

Last edited by KevinH; Yesterday at 06:21 PM.
KevinH is online now   Reply With Quote
Old Yesterday, 10:25 PM   #58
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 10,070
Karma: 7518950
Join Date: Nov 2009
Device: many
Because file formats change over time. We should probably add a version= attribute to the starting parent specialchars tag, then we can use its value to handle parsing changes in a backwards compatible way.
KevinH is online now   Reply With Quote
Old Today, 08:06 AM   #59
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 10,070
Karma: 7518950
Join Date: Nov 2009
Device: many
If anyone plays around with this xml version, please let me know your thoughts. If okay, I will work to cleanup all the code and integrate it into the version of SelectCharacter.cpp actually used inside Sigil and commit it to my personal repo until everyone is happy.
KevinH is online now   Reply With Quote
Old Today, 08:40 AM   #60
BeckyEbook
Wizard
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 1,047
Karma: 3883259
Join Date: Jan 2017
Location: Poland
Device: Various
As far as I'm concerned, the proposed XML format is fine.
I just removed the empty label="" – why make the file unnecessarily larger? Besides, XML prefers minimalism.
Attached Thumbnails
Click image for larger version

Name:	sigil-insert-new-flow-xml.png
Views:	6
Size:	13.6 KB
ID:	226081  
BeckyEbook is online now   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PageEdit 2.1.0 - Insert Special Character not working BetterRed Sigil 0 05-17-2024 10:01 PM
Add title="" to h* based on existing TOC -- suggestion for new feature (or plugin?) Mister L Sigil 82 09-11-2020 09:09 AM
"insert special character" in editor rjwse@aol.com Editor 5 08-27-2019 08:31 PM
Insert special character: some niggles Phssthpok Editor 2 11-19-2016 12:55 PM
Feature Request: configurable space setting for "Insert blank line" in "Look & Feel" therealjoeblow Calibre 15 07-25-2011 03:14 PM


All times are GMT -4. The time now is 12:47 PM.


MobileRead.com is a privately owned, operated and funded community.