[gtksourceview: 1/2] Fix getting css from pango font description with style and variant and fix typo
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview: 1/2] Fix getting css from pango font description with style and variant and fix typo
- Date: Fri, 16 Oct 2020 16:14:33 +0000 (UTC)
commit a642c9c6ca8dba2bde064ee110cf98e16e100028
Author: BwackNinja <BwackNinja gmail com>
Date: Fri Oct 16 10:01:05 2020 -0400
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 b0012450..ce3226dc 100644
--- a/gtksourceview/gtksourceutils.c
+++ b/gtksourceview/gtksourceutils.c
@@ -350,6 +350,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;
@@ -422,7 +447,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:
@@ -454,7 +479,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]