diff options
author | Matthias Clasen <mclasen@redhat.com> | 2022-01-12 02:49:27 +0000 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2022-01-12 02:49:27 +0000 |
commit | 8fc2af7bb3096225277bf52903a5e721fc94da5b (patch) | |
tree | 00e539e18a0f0b7274fe0a0bcc54eeca04fa6339 | |
parent | 7e9935e38140a5a04e9679b0c399e6f4627956c3 (diff) | |
parent | b4eeada025140afa2c5b4a59cdfe2abce132d7e8 (diff) | |
download | gtk+-8fc2af7bb3096225277bf52903a5e721fc94da5b.tar.gz |
Merge branch 'fontchooser-fix-3' into 'gtk-3-24'
docs: Fix gtk_tree_selection_get_selected_rows()
See merge request GNOME/gtk!4354
-rw-r--r-- | gtk/gtkfontchooserwidget.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/gtk/gtkfontchooserwidget.c b/gtk/gtkfontchooserwidget.c index 8eb5b2ecde..bcccacbc96 100644 --- a/gtk/gtkfontchooserwidget.c +++ b/gtk/gtkfontchooserwidget.c @@ -1622,12 +1622,13 @@ static struct { * We actually don't bother about the FT_Face here, but we use this so that we can have a single * version of add_axis() taylored to PangoFT2 or Pango with HarfBuzz integrated */ -static void * +static void get_font_name (FT_Face face, FT_Var_Axis *ax, - const char *result) + char *buffer, + guint buffer_len) { - result = ax->name; + g_strlcpy (buffer, ax->name, buffer_len); } static const float @@ -1662,13 +1663,10 @@ get_axis_float_default (FT_Var_Axis *ax) static void get_font_name (hb_face_t *face, hb_ot_var_axis_info_t *ax, - const char *name) + char *buffer, + unsigned int buffer_len) { - char buffer[20]; - unsigned int buffer_len = 20; - hb_ot_name_get_utf8 (face, ax->name_id, HB_LANGUAGE_INVALID, &buffer_len, buffer); - name = buffer; } #define get_float_value(x) x @@ -1713,7 +1711,8 @@ add_axis (GtkFontChooserWidget *fontchooser, { GtkFontChooserWidgetPrivate *priv = fontchooser->priv; Axis *axis; - const char *name; + char buffer[20]; + char *name; int i; axis = g_new (Axis, 1); @@ -1721,7 +1720,8 @@ add_axis (GtkFontChooserWidget *fontchooser, axis->fontchooser = GTK_WIDGET (fontchooser); axis->default_value = get_axis_float_default (ax); - get_font_name (face, ax, name); + get_font_name (face, ax, buffer, 20); + name = buffer; for (i = 0; i < G_N_ELEMENTS (axis_names); i++) { |