summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Davenport <qball@blame.services>2022-07-30 15:05:28 +0200
committerDave Davenport <qball@blame.services>2022-07-30 15:05:28 +0200
commit9d001aaaf7e9c35a003236dbc69cfb3a870cf708 (patch)
treea850aea81fbbf6e7c0b92d63f33e9db9b6552d99
parent77af850200e303b9f66fc3c70c1cb8fbe9232d92 (diff)
[Theme] Do a pango version check.
-rw-r--r--INSTALL.md2
-rw-r--r--doc/rofi-theme.58
-rw-r--r--doc/rofi-theme.5.markdown4
-rw-r--r--source/helper.c7
4 files changed, 19 insertions, 2 deletions
diff --git a/INSTALL.md b/INSTALL.md
index 429d86bf..f62ffbfc 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -24,7 +24,7 @@ You can also use [Meson](https://mesonbuild.com/) as an alternative.
### External libraries
-* libpango
+* libpango >= 1.50
* libpangocairo
* libcairo
* libcairo-xcb
diff --git a/doc/rofi-theme.5 b/doc/rofi-theme.5
index 30ebfea3..f19cdf03 100644
--- a/doc/rofi-theme.5
+++ b/doc/rofi-theme.5
@@ -776,12 +776,20 @@ should be applied.
\fB\fCunderline\fR: put a line under the text.
.IP \(bu 2
\fB\fCstrikethrough\fR: put a line through the text.
+
+.RE
+
+.PP
+The following options are available on pango 1.50.0 and up:
+
+.RS
.IP \(bu 2
\fB\fCuppercase\fR: Uppercase the text.
.IP \(bu 2
\fB\fClowercase\fR: Lowercase the text.
.IP \(bu 2
\fB\fCcapitalize\fR: Capitalize the text.
+This is currently disabled because of a Pango bug.
.RE
diff --git a/doc/rofi-theme.5.markdown b/doc/rofi-theme.5.markdown
index 1a9716d3..acbd131d 100644
--- a/doc/rofi-theme.5.markdown
+++ b/doc/rofi-theme.5.markdown
@@ -500,9 +500,13 @@ should be applied.
* `italic`: put the highlighted text in script type (slanted).
* `underline`: put a line under the text.
* `strikethrough`: put a line through the text.
+
+The following options are available on pango 1.50.0 and up:
+
* `uppercase`: Uppercase the text.
* `lowercase`: Lowercase the text.
* `capitalize`: Capitalize the text.
+ This is currently disabled because of a Pango bug.
## Line style
diff --git a/source/helper.c b/source/helper.c
index 2662b2b2..583d128c 100644
--- a/source/helper.c
+++ b/source/helper.c
@@ -424,6 +424,7 @@ void helper_token_match_set_pango_attr_on_style(PangoAttrList *retv, int start,
pa->end_index = end;
pango_attr_list_insert(retv, pa);
}
+#if PANGO_VERSION_CHECK(1, 50, 0)
if (th.style & ROFI_HL_UPPERCASE) {
PangoAttribute *pa =
pango_attr_text_transform_new(PANGO_TEXT_TRANSFORM_UPPERCASE);
@@ -439,12 +440,16 @@ void helper_token_match_set_pango_attr_on_style(PangoAttrList *retv, int start,
pango_attr_list_insert(retv, pa);
}
if (th.style & ROFI_HL_CAPITALIZE) {
+#if 0
PangoAttribute *pa =
- pango_attr_text_transform_new(PANGO_TEXT_TRANSFORM_CAPITALIZE);
+ pango_attr_text_transform_new(PANGO_TEXT_TRANSFORM_CAPITALIZE);
pa->start_index = start;
pa->end_index = end;
pango_attr_list_insert(retv, pa);
+#endif
+ // Disabled because of bug in pango
}
+#endif
if (th.style & ROFI_HL_UNDERLINE) {
PangoAttribute *pa = pango_attr_underline_new(PANGO_UNDERLINE_SINGLE);
pa->start_index = start;