~ubuntu-branches/ubuntu/jaunty/gimp/jaunty-security

« back to all changes in this revision

Viewing changes to app/text/gimptext-compat.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2007-05-02 16:33:03 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070502163303-bvzhjzbpw8qglc4y
Tags: 2.3.16-1ubuntu1
* Resynchronized with Debian, remaining Ubuntu changes:
  - debian/rules: i18n magic.
* debian/control.in:
  - Maintainer: Ubuntu Core Developers <ubuntu-devel@lists.ubuntu.com>
* debian/patches/02_help-message.patch,
  debian/patches/03_gimp.desktop.in.in.patch,
  debian/patches/10_dont_show_wizard.patch: updated.
* debian/patches/04_composite-signedness.patch,
  debian/patches/05_add-letter-spacing.patch: dropped, used upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* The GIMP -- an image manipulation program
 
1
/* GIMP - The GNU Image Manipulation Program
2
2
 * Copyright (C) 1995 Spencer Kimball and Peter Mattis
3
3
 *
4
4
 * GimpText
47
47
 
48
48
 
49
49
GimpLayer *
50
 
text_render (GimpImage    *gimage,
51
 
             GimpDrawable *drawable,
 
50
text_render (GimpImage    *image,
 
51
             GimpDrawable *drawable,
52
52
             GimpContext  *context,
53
 
             gint          text_x,
54
 
             gint          text_y,
55
 
             const gchar  *fontname,
56
 
             const gchar  *text,
57
 
             gint          border,
58
 
             gboolean      antialias)
 
53
             gint          text_x,
 
54
             gint          text_y,
 
55
             const gchar  *fontname,
 
56
             const gchar  *text,
 
57
             gint          border,
 
58
             gboolean      antialias)
59
59
{
60
60
  PangoFontDescription *desc;
61
61
  GimpText             *gtext;
64
64
  gchar                *font;
65
65
  gdouble               size;
66
66
 
67
 
  g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
 
67
  g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
68
68
  g_return_val_if_fail (drawable == NULL || GIMP_IS_DRAWABLE (drawable), NULL);
69
69
  g_return_val_if_fail (drawable == NULL ||
70
70
                        gimp_item_is_attached (GIMP_ITEM (drawable)), NULL);
89
89
                        "text",      text,
90
90
                        "font",      font,
91
91
                        "font-size", size,
92
 
                        "antialias", antialias,
 
92
                        "antialias", antialias,
93
93
                        "border",    border,
94
94
                        "color",     &color,
95
95
                        NULL);
96
96
 
97
97
  g_free (font);
98
98
 
99
 
  layer = gimp_text_layer_new (gimage, gtext);
 
99
  layer = gimp_text_layer_new (image, gtext);
100
100
 
101
101
  g_object_unref (gtext);
102
102
 
104
104
    return NULL;
105
105
 
106
106
  /*  Start a group undo  */
107
 
  gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_TEXT,
 
107
  gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_TEXT,
108
108
                               _("Add Text Layer"));
109
109
 
110
110
  /*  Set the layer offsets  */
115
115
   *  this might not always be desired, but in general,
116
116
   *  it seems like the correct behavior.
117
117
   */
118
 
  if (! gimp_channel_is_empty (gimp_image_get_mask (gimage)))
119
 
    gimp_channel_clear (gimp_image_get_mask (gimage), NULL, TRUE);
 
118
  if (! gimp_channel_is_empty (gimp_image_get_mask (image)))
 
119
    gimp_channel_clear (gimp_image_get_mask (image), NULL, TRUE);
120
120
 
121
121
  /*  If the drawable is NULL, create a new layer  */
122
122
  if (drawable == NULL)
123
 
    gimp_image_add_layer (gimage, layer, -1);
 
123
    gimp_image_add_layer (image, layer, -1);
124
124
  /*  Otherwise, instantiate the text as the new floating selection */
125
125
  else
126
126
    floating_sel_attach (layer, drawable);
127
127
 
128
128
  /*  end the group undo  */
129
 
  gimp_image_undo_group_end (gimage);
 
129
  gimp_image_undo_group_end (image);
130
130
 
131
131
  return layer;
132
132
}
133
133
 
134
134
gboolean
135
135
text_get_extents (const gchar *fontname,
136
 
                  const gchar *text,
137
 
                  gint        *width,
138
 
                  gint        *height,
139
 
                  gint        *ascent,
140
 
                  gint        *descent)
 
136
                  const gchar *text,
 
137
                  gint        *width,
 
138
                  gint        *height,
 
139
                  gint        *ascent,
 
140
                  gint        *descent)
141
141
{
142
142
  PangoFontDescription *font_desc;
143
143
  PangoContext         *context;