diff options
| author | Jason Rumney | 2008-04-09 12:14:52 +0000 |
|---|---|---|
| committer | Jason Rumney | 2008-04-09 12:14:52 +0000 |
| commit | cf907d69ddd44c09dc5b5c12230b40e4cc9779d7 (patch) | |
| tree | 3b2ab3ad1c36e9461df127733c943a1eb378e982 | |
| parent | 418fddf54bc687634693875991a1491290a7f98d (diff) | |
| download | emacs-cf907d69ddd44c09dc5b5c12230b40e4cc9779d7.tar.gz emacs-cf907d69ddd44c09dc5b5c12230b40e4cc9779d7.zip | |
(w32_compute_glyph_string_overhangs): Compute overhangs
for new font backend and composite cases.
| -rw-r--r-- | src/ChangeLog | 8 | ||||
| -rw-r--r-- | src/w32term.c | 28 |
2 files changed, 34 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 179fcadfc21..a9ba878737e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2008-04-09 Jason Rumney <jasonr@gnu.org> | ||
| 2 | |||
| 3 | * w32term.c (w32_compute_glyph_string_overhangs): Compute overhangs | ||
| 4 | for new font backend and composite cases. | ||
| 5 | |||
| 1 | 2008-04-09 Jan Djärv <jan.h.d@swipnet.se> | 6 | 2008-04-09 Jan Djärv <jan.h.d@swipnet.se> |
| 2 | 7 | ||
| 3 | * atimer.c (alarm_signal_handler): Call run_timers if not SYNC_INPUT. | 8 | * atimer.c (alarm_signal_handler): Call run_timers if not SYNC_INPUT. |
| @@ -5,7 +10,8 @@ | |||
| 5 | (do_pending_atimers): Call run_timers. | 10 | (do_pending_atimers): Call run_timers. |
| 6 | (run_timers): New function. | 11 | (run_timers): New function. |
| 7 | 12 | ||
| 8 | * sysdep.c (emacs_write): If SYNC_INPUT and pending_atimers, run atimers. | 13 | * sysdep.c (emacs_write): If SYNC_INPUT and pending_atimers, |
| 14 | run atimers. | ||
| 9 | 15 | ||
| 10 | * process.c (wait_reading_process_output): The same as above. | 16 | * process.c (wait_reading_process_output): The same as above. |
| 11 | 17 | ||
diff --git a/src/w32term.c b/src/w32term.c index 944c0f9fa43..a40fe2edc48 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -1763,9 +1763,35 @@ static void | |||
| 1763 | w32_compute_glyph_string_overhangs (s) | 1763 | w32_compute_glyph_string_overhangs (s) |
| 1764 | struct glyph_string *s; | 1764 | struct glyph_string *s; |
| 1765 | { | 1765 | { |
| 1766 | if (s->cmp == NULL | ||
| 1767 | && s->first_glyph->type == CHAR_GLYPH) | ||
| 1768 | { | ||
| 1769 | #ifdef USE_FONT_BACKEND | ||
| 1770 | if (enable_font_backend) | ||
| 1771 | { | ||
| 1772 | unsigned *code = alloca (sizeof (unsigned) * s->nchars); | ||
| 1773 | struct font *font = (struct font *) s->font_info; | ||
| 1774 | struct font_metrics metrics; | ||
| 1775 | int i; | ||
| 1776 | |||
| 1777 | for (i = 0; i < s->nchars; i++) | ||
| 1778 | code[i] = s->char2b[i]; | ||
| 1779 | font->driver->text_extents (font, code, s->nchars, &metrics); | ||
| 1780 | s->right_overhang = (metrics.rbearing > metrics.width | ||
| 1781 | ? metrics.rbearing - metrics.width : 0); | ||
| 1782 | s->left_overhang = metrics.lbearing < 0 ? -metrics.lbearing : 0; | ||
| 1783 | } | ||
| 1784 | #else | ||
| 1766 | /* TODO: Windows does not appear to have a method for | 1785 | /* TODO: Windows does not appear to have a method for |
| 1767 | getting this info without getting the ABC widths for each | 1786 | getting this info without getting the ABC widths for each |
| 1768 | individual character and working it out manually. */ | 1787 | individual character and working it out manually. */ |
| 1788 | #endif | ||
| 1789 | } | ||
| 1790 | else if (s->cmp) | ||
| 1791 | { | ||
| 1792 | s->right_overhang = s->cmp->rbearing - s->cmp->pixel_width; | ||
| 1793 | s->left_overhang = -s->cmp->lbearing; | ||
| 1794 | } | ||
| 1769 | } | 1795 | } |
| 1770 | 1796 | ||
| 1771 | 1797 | ||
| @@ -6892,7 +6918,7 @@ static struct redisplay_interface w32_redisplay_interface = | |||
| 6892 | w32_destroy_fringe_bitmap, | 6918 | w32_destroy_fringe_bitmap, |
| 6893 | w32_per_char_metric, | 6919 | w32_per_char_metric, |
| 6894 | w32_encode_char, | 6920 | w32_encode_char, |
| 6895 | NULL, /* w32_compute_glyph_string_overhangs */ | 6921 | w32_compute_glyph_string_overhangs, |
| 6896 | x_draw_glyph_string, | 6922 | x_draw_glyph_string, |
| 6897 | w32_define_frame_cursor, | 6923 | w32_define_frame_cursor, |
| 6898 | w32_clear_frame_area, | 6924 | w32_clear_frame_area, |