Book number appears cut when book is marked

Bug #1482993 reported by Raúl Núñez de Arenas Coronado on 2015-08-09
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
Undecided
Unassigned

Bug Description

Calibre 2.34 but this have been happening for previous versions, too.
Windows 10 x64

How to reproduce:
when viewing a list of books, in the main view, select a book. The number in the leftmost column changes format to bold and italic. Make sure the book you select has a long number. If you have, let's say, 100 books and you select book number "3", the number won't be cut. Select one with the maximum number of digits you can.

I'm including a capture showing the problem.

What should happen:
the number should appear entirely

What happens:
the number appears cut at the right, because the width of the column was calculated when the number was drawn in normal style, but bold and italic made it wider. I bet the real culprit is italic...

I dont think this can be fixed in calibre code. The layout calculation
is done in Qt (the graphics toolkit calibre uses). Also, it is
apparently dependent on the interface font used -- for instance, I cannot
reproduce it on my windows boxes.

I could try to hack around it by force adding some padding pixels, but
that would not be a good solution, since the number of pixels to be
added likely depends on the font and there is no good way to claculate
that -- and it would punish everyone by using up screen space in order
to fix a minor issue that happens only in some circumstances.

 status wontfix

Changed in calibre:
status: New → Won't Fix

Kovid, could you please tell me the font you're using in your Windows boxes? I supossed I was using the default font Calibre chooses but that may be the problem.

I agree, no sense in hacking around when the problem is in Qt, not Calibre. Also, it's minor and its cosmetic. It's much better if I change the font I'm using.

Thanks a lot for the reply.

Kovid Goyal (kovid) wrote :

I use the default system font. In the calibre preferences, that will
show up as MS Shell Dlg 2 (which is a Microsoft "virtual" font that resolves into the
system font specified in the OS preferences).

That's the same font my Calibre is using (to wit, "MS Shell Dlg 2 [8pt]"). I'll try to set some font by hand to see if the problem disappears. I haven't changed the default font in the OS, either, so maybe it's a problem in my box.

Thanks A LOT for the incredibly fast reply, Kovid.

Raúl

Kovid Goyal (kovid) wrote :

Actually, I figured out a robust way to override Qt's geometry
calculation for the headers. I dont know if it will actually fix your
issue, since I cannot preroduce it, but this way I can at least uarantee
that the correct font (bold/italic) font is being used for the size calculation.

Fixed in branch master. The fix will be in the next release. calibre is usually released every Friday.

 status fixreleased

Changed in calibre:
status: Won't Fix → Fix Released

You're incredible, Kovid.

I'll test the fix and I'll send you a note with the results. Thanks A LOT!

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers