comparison src/gui_gtk_x11.c @ 497:73f10d8124f4 v7.0136

updated for version 7.0136
author vimboss
date Wed, 24 Aug 2005 22:16:11 +0000
parents a5fcf36ef512
children 81fe2ccc1207
comparison
equal deleted inserted replaced
496:381caa3f6ea8 497:73f10d8124f4
5326 PangoAttrList *attr_list; 5326 PangoAttrList *attr_list;
5327 GList *item_list; 5327 GList *item_list;
5328 int cluster_width; 5328 int cluster_width;
5329 int last_glyph_rbearing; 5329 int last_glyph_rbearing;
5330 int cells = 0; /* cells occupied by current cluster */ 5330 int cells = 0; /* cells occupied by current cluster */
5331 #if 0
5332 int monospace13 = STRICMP(p_guifont, "monospace 13") == 0;
5333 #endif
5331 5334
5332 /* Safety check: pango crashes when invoked with invalid utf-8 5335 /* Safety check: pango crashes when invoked with invalid utf-8
5333 * characters. */ 5336 * characters. */
5334 if (!utf_valid_string(s, s + len)) 5337 if (!utf_valid_string(s, s + len))
5335 { 5338 {
5444 5447
5445 /* There is a previous glyph, so we deal with combining 5448 /* There is a previous glyph, so we deal with combining
5446 * characters the canonical way. That is, setting the 5449 * characters the canonical way. That is, setting the
5447 * width of the previous glyph to 0. */ 5450 * width of the previous glyph to 0. */
5448 glyphs->glyphs[i - 1].geometry.width = 0; 5451 glyphs->glyphs[i - 1].geometry.width = 0;
5449
5450 width = cells * gui.char_width * PANGO_SCALE; 5452 width = cells * gui.char_width * PANGO_SCALE;
5451 glyph->geometry.x_offset += 5453 glyph->geometry.x_offset +=
5452 MAX(0, width - cluster_width) / 2; 5454 MAX(0, width - cluster_width) / 2;
5455 #if 0
5456 /* Dirty hack: for "monospace 13" font there is a bug that
5457 * draws composing chars in the wrong position. Add
5458 * "width" to the offset to work around that. */
5459 if (monospace13)
5460 glyph->geometry.x_offset = width;
5461 #endif
5462
5453 glyph->geometry.width = width; 5463 glyph->geometry.width = width;
5454 } 5464 }
5455 else /* i == 0 "cannot happen" */ 5465 else /* i == 0 "cannot happen" */
5456 { 5466 {
5457 glyph->geometry.width = 0; 5467 glyph->geometry.width = 0;