[gtksourceview/gtksourceview-4-8] Merge branch 'master' into 'master'
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview/gtksourceview-4-8] Merge branch 'master' into 'master'
- Date: Fri, 16 Oct 2020 16:14:52 +0000 (UTC)
commit 75da6b8464c68f32267482e3bcecaeccbb227fd2
Author: Christian Hergert <christian hergert me>
Date: Fri Oct 16 16:14:32 2020 +0000
Merge branch 'master' into 'master'
Fix getting css from pango font description with style and variant and fix typo
See merge request GNOME/gtksourceview!168
(cherry picked from commit dcb3b99fc0aa506ea0dfdd5275cdbcb43095badb)
a642c9c6 Fix getting css from pango font description with style and variant and fix typo
gtksourceview/gtksourceutils.c | 29 +++++++++++++++++++++++++++--
1 file changed, 27 insertions(+), 2 deletions(-)
---
diff --git a/gtksourceview/gtksourceutils.c b/gtksourceview/gtksourceutils.c
index 9853284e..587fe2c9 100644
--- a/gtksourceview/gtksourceutils.c
+++ b/gtksourceview/gtksourceutils.c
@@ -353,6 +353,31 @@ _gtk_source_utils_pango_font_description_to_css (const PangoFontDescription *fon
}
if ((mask & PANGO_FONT_MASK_STYLE) != 0)
+ {
+ PangoStyle style;
+
+ style = pango_font_description_get_style (font_desc);
+
+ switch (style)
+ {
+ case PANGO_STYLE_NORMAL:
+ ADD_KEYVAL (FONT_STYLE, "normal");
+ break;
+
+ case PANGO_STYLE_OBLIQUE:
+ ADD_KEYVAL (FONT_STYLE, "oblique");
+ break;
+
+ case PANGO_STYLE_ITALIC:
+ ADD_KEYVAL (FONT_STYLE, "italic");
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ if ((mask & PANGO_FONT_MASK_VARIANT) != 0)
{
PangoVariant variant;
@@ -425,7 +450,7 @@ _gtk_source_utils_pango_font_description_to_css (const PangoFontDescription *fon
switch (pango_font_description_get_stretch (font_desc))
{
case PANGO_STRETCH_ULTRA_CONDENSED:
- ADD_KEYVAL (FONT_STRETCH, "untra-condensed");
+ ADD_KEYVAL (FONT_STRETCH, "ultra-condensed");
break;
case PANGO_STRETCH_EXTRA_CONDENSED:
@@ -457,7 +482,7 @@ _gtk_source_utils_pango_font_description_to_css (const PangoFontDescription *fon
break;
case PANGO_STRETCH_ULTRA_EXPANDED:
- ADD_KEYVAL (FONT_STRETCH, "untra-expanded");
+ ADD_KEYVAL (FONT_STRETCH, "ultra-expanded");
break;
default:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]