Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
4bb49624
Commit
4bb49624
authored
May 20, 2010
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Creation of pango context removed
parent
24162415
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
14 deletions
+5
-14
xtt/lib/glow/gtk/glow_draw_gtk.cpp
xtt/lib/glow/gtk/glow_draw_gtk.cpp
+5
-14
No files found.
xtt/lib/glow/gtk/glow_draw_gtk.cpp
View file @
4bb49624
...
...
@@ -3439,10 +3439,8 @@ int GlowDrawGtk::text_pango( GlowWind *wind, int x, int y, char *text, int len,
continue
;
}
PangoContext
*
pctx
=
gdk_pango_context_get_for_screen
(
screen
);
PangoLayout
*
layout
=
pango_layout_new
(
pctx
);
char
*
textutf8
=
g_convert
(
text
,
-
1
,
"UTF-8"
,
"ISO8859-1"
,
NULL
,
NULL
,
NULL
);
pango_layout_set_text
(
layout
,
textutf8
,
-
1
);
PangoLayout
*
layout
=
gtk_widget_create_pango_layout
(
w
->
toplevel
,
textutf8
);
g_free
(
textutf8
);
PangoFontDescription
*
desc
=
pango_font_description_from_string
(
font_string
(
font_idx
,
font_type
,
size
));
pango_layout_set_font_description
(
layout
,
desc
);
...
...
@@ -3454,7 +3452,6 @@ int GlowDrawGtk::text_pango( GlowWind *wind, int x, int y, char *text, int len,
pango_renderer_draw_layout
(
pr
,
layout
,
PANGO_SCALE
*
x
,
PANGO_SCALE
*
y
-
(
1.0
-
FONT_DESCENT
)
*
height
);
g_object_unref
(
layout
);
g_object_unref
(
pctx
);
}
gdk_pango_renderer_set_drawable
(
GDK_PANGO_RENDERER
(
pr
),
0
);
gdk_pango_renderer_set_gc
(
GDK_PANGO_RENDERER
(
pr
),
0
);
...
...
@@ -3499,10 +3496,8 @@ int GlowDrawGtk::text_erase_pango( GlowWind *wind, int x, int y, char *text, int
gdk_pango_renderer_set_gc
(
GDK_PANGO_RENDERER
(
pr
),
gcs
[
gc_type
][
0
]);
gdk_pango_renderer_set_drawable
(
GDK_PANGO_RENDERER
(
pr
),
w
->
window
);
PangoContext
*
pctx
=
gdk_pango_context_get_for_screen
(
screen
);
PangoLayout
*
layout
=
pango_layout_new
(
pctx
);
char
*
textutf8
=
g_convert
(
text
,
-
1
,
"UTF-8"
,
"ISO8859-1"
,
NULL
,
NULL
,
NULL
);
pango_layout_set_text
(
layout
,
textutf8
,
-
1
);
PangoLayout
*
layout
=
gtk_widget_create_pango_layout
(
w
->
toplevel
,
textutf8
);
g_free
(
textutf8
);
PangoFontDescription
*
desc
=
pango_font_description_from_string
(
font_string
(
font_idx
,
font_type
,
size
));
pango_layout_set_font_description
(
layout
,
desc
);
...
...
@@ -3516,14 +3511,13 @@ int GlowDrawGtk::text_erase_pango( GlowWind *wind, int x, int y, char *text, int
get_gc
(
this
,
gc_type
,
idx
),
1
,
x
,
y
-
(
1.0
-
FONT_DESCENT
)
*
height
/
PANGO_SCALE
,
width
/
PANGO_SCALE
,
height
/
PANGO_SCALE
);
if
(
w
->
double_buffer_on
)
if
(
w
->
double_buffer_on
)
gdk_draw_rectangle
(
w
->
buffer
,
get_gc
(
this
,
gc_type
,
idx
),
1
,
x
,
y
-
(
1.0
-
FONT_DESCENT
)
*
height
/
PANGO_SCALE
,
width
/
PANGO_SCALE
,
height
/
PANGO_SCALE
);
g_object_unref
(
layout
);
g_object_unref
(
pctx
);
gdk_pango_renderer_set_drawable
(
GDK_PANGO_RENDERER
(
pr
),
0
);
gdk_pango_renderer_set_gc
(
GDK_PANGO_RENDERER
(
pr
),
0
);
...
...
@@ -3553,10 +3547,8 @@ int GlowDrawGtk::get_text_extent_pango( const char *text, int len,
gdk_pango_renderer_set_gc
(
GDK_PANGO_RENDERER
(
pr
),
gcs
[
gc_type
][
0
]);
gdk_pango_renderer_set_drawable
(
GDK_PANGO_RENDERER
(
pr
),
w
->
window
);
PangoContext
*
pctx
=
gdk_pango_context_get_for_screen
(
screen
);
PangoLayout
*
layout
=
pango_layout_new
(
pctx
);
char
*
textutf8
=
g_convert
(
text
,
len
,
"UTF-8"
,
"ISO8859-1"
,
NULL
,
NULL
,
NULL
);
pango_layout_set_text
(
layout
,
textutf8
,
-
1
);
char
*
textutf8
=
g_convert
(
text
,
-
1
,
"UTF-8"
,
"ISO8859-1"
,
NULL
,
NULL
,
NULL
);
PangoLayout
*
layout
=
gtk_widget_create_pango_layout
(
w
->
toplevel
,
textutf8
);
g_free
(
textutf8
);
PangoFontDescription
*
desc
=
pango_font_description_from_string
(
font_string
(
font_idx
,
font_type
,
size
));
pango_layout_set_font_description
(
layout
,
desc
);
...
...
@@ -3571,7 +3563,6 @@ int GlowDrawGtk::get_text_extent_pango( const char *text, int len,
*
descent
=
FONT_DESCENT
*
lheight
/
PANGO_SCALE
;
g_object_unref
(
layout
);
g_object_unref
(
pctx
);
gdk_pango_renderer_set_drawable
(
GDK_PANGO_RENDERER
(
pr
),
0
);
gdk_pango_renderer_set_gc
(
GDK_PANGO_RENDERER
(
pr
),
0
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment