diff --git a/src/calibre/gui2/__init__.py b/src/calibre/gui2/__init__.py
index e658d756bc..0888f555a3 100644
--- a/src/calibre/gui2/__init__.py
+++ b/src/calibre/gui2/__init__.py
@@ -526,6 +526,7 @@ def create_defs():
}
defs['bookshelf_min_font_multiplier'] = 0.75
defs['bookshelf_max_font_multiplier'] = 1.3
+ defs['bookshelf_bold_font'] = False
# Migrate beta bookshelf_thumbnail
if isinstance(btv := gprefs.get('bookshelf_thumbnail'), bool):
diff --git a/src/calibre/gui2/library/bookshelf_view.py b/src/calibre/gui2/library/bookshelf_view.py
index ee03c92166..9a58bd9a45 100644
--- a/src/calibre/gui2/library/bookshelf_view.py
+++ b/src/calibre/gui2/library/bookshelf_view.py
@@ -1538,7 +1538,7 @@ class BookshelfView(MomentumScrollMixin, QAbstractScrollArea):
self.template_inited = False
self.min_font_size = max(0.1, min(gprefs['bookshelf_min_font_multiplier'], 1)) * self.base_font_size_pts
self.max_font_size = max(1, min(gprefs['bookshelf_max_font_multiplier'], 3)) * self.base_font_size_pts
- _, fm, _ = self.get_sized_font(self.min_font_size)
+ _, fm, _ = self.get_sized_font(self.min_font_size, bold=gprefs['bookshelf_bold_font'])
self.min_line_height = math.ceil(fm.height())
self.calculate_shelf_geometry()
self.palette_changed()
@@ -2086,11 +2086,12 @@ class BookshelfView(MomentumScrollMixin, QAbstractScrollArea):
first_rect, second_rect = calculate_rects(bool(second_line))
nfl, nsl, font, was_wrapped = self.get_text_metrics(
- first_line, second_line, first_rect.transposed().size(), allow_wrap=True)
+ first_line, second_line, first_rect.transposed().size(), allow_wrap=True, bold=gprefs['bookshelf_bold_font'])
if not nfl and not nsl: # two lines dont fit
second_line = ''
first_rect = QRect(rect.left(), first_rect.top(), rect.width(), first_rect.height())
- nfl, nsl, font, _ = self.get_text_metrics(first_line, second_line, first_rect.transposed().size())
+ nfl, nsl, font, _ = self.get_text_metrics(
+ first_line, second_line, first_rect.transposed().size(), bold=gprefs['bookshelf_bold_font'])
elif was_wrapped:
first_rect, second_rect = calculate_rects(True)
first_line, second_line, = nfl, nsl
diff --git a/src/calibre/gui2/preferences/look_feel_tabs/bookshelf_view.py b/src/calibre/gui2/preferences/look_feel_tabs/bookshelf_view.py
index 28db022aae..64e698b884 100644
--- a/src/calibre/gui2/preferences/look_feel_tabs/bookshelf_view.py
+++ b/src/calibre/gui2/preferences/look_feel_tabs/bookshelf_view.py
@@ -80,6 +80,7 @@ class BookshelfTab(QTabWidget, LazyConfigWidgetBase, Ui_Form):
r('bookshelf_make_space_for_second_line', gprefs)
r('bookshelf_min_font_multiplier', gprefs)
r('bookshelf_max_font_multiplier', gprefs)
+ r('bookshelf_bold_font', gprefs)
r('bookshelf_divider_text_right', gprefs)
r('bookshelf_start_with_divider', gprefs)
diff --git a/src/calibre/gui2/preferences/look_feel_tabs/bookshelf_view.ui b/src/calibre/gui2/preferences/look_feel_tabs/bookshelf_view.ui
index 57e6a05ebd..460701ba7f 100644
--- a/src/calibre/gui2/preferences/look_feel_tabs/bookshelf_view.ui
+++ b/src/calibre/gui2/preferences/look_feel_tabs/bookshelf_view.ui
@@ -458,6 +458,16 @@
+ -
+
+
+ <p>Use a bold font to draw text on the book spine
+
+
+ Use &bold font
+
+
+
-