Commit 81d108b9fe3d31177c3f7fcea77dc12d8b780609
1 parent
9b7d6abd
Exists in
master
and in
5 other branches
Iniciando substituição da cairo toy
Showing
1 changed file
with
27 additions
and
0 deletions
Show diff stats
src/pw3270/v3270/draw.c
| ... | ... | @@ -144,8 +144,35 @@ void v3270_draw_element(cairo_t *cr, unsigned char chr, unsigned short attr, H32 |
| 144 | 144 | |
| 145 | 145 | void v3270_draw_text(cairo_t *cr, const GdkRectangle *rect, guint height, const char *str) { |
| 146 | 146 | |
| 147 | + cairo_status_t status; | |
| 148 | + cairo_glyph_t * glyphs = NULL; | |
| 149 | + int num_glyphs = 0; | |
| 150 | + cairo_text_cluster_t * clusters = NULL; | |
| 151 | + int num_clusters = 0; | |
| 152 | + cairo_text_cluster_flags_t cluster_flags; | |
| 153 | + cairo_scaled_font_t * scaled_font = cairo_get_scaled_font (cr); | |
| 154 | + | |
| 155 | + status = cairo_scaled_font_text_to_glyphs( | |
| 156 | + scaled_font, | |
| 157 | + (double) rect->x, (double) (rect->y+height), | |
| 158 | + str, strlen(str), | |
| 159 | + &glyphs, &num_glyphs, | |
| 160 | + &clusters, &num_clusters, &cluster_flags ); | |
| 161 | + | |
| 162 | + if (status == CAIRO_STATUS_SUCCESS) { | |
| 163 | + cairo_show_text_glyphs (cr,str,strlen(str),glyphs, num_glyphs,clusters, num_clusters, cluster_flags); | |
| 164 | + } | |
| 165 | + | |
| 166 | + if(glyphs) | |
| 167 | + cairo_glyph_free(glyphs); | |
| 168 | + | |
| 169 | + if(clusters) | |
| 170 | + cairo_text_cluster_free(clusters); | |
| 171 | + | |
| 172 | +/* | |
| 147 | 173 | cairo_move_to(cr,rect->x,rect->y+height); |
| 148 | 174 | cairo_show_text(cr, str); |
| 175 | +*/ | |
| 149 | 176 | |
| 150 | 177 | } |
| 151 | 178 | ... | ... |