Mercurial > emacs
comparison src/macterm.c @ 80740:038757cf9434
(x_load_font): Round average width to the nearest integer.
author | YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> |
---|---|
date | Wed, 20 Aug 2008 09:05:14 +0000 |
parents | 97941d75f8ce |
children | 166332494a32 |
comparison
equal
deleted
inserted
replaced
80739:4a7a1ee0a7ce | 80740:038757cf9434 |
---|---|
8034 { | 8034 { |
8035 int width = pcm->width; | 8035 int width = pcm->width; |
8036 for (char2b.byte2 = 33; char2b.byte2 <= 126; char2b.byte2++) | 8036 for (char2b.byte2 = 33; char2b.byte2 <= 126; char2b.byte2++) |
8037 if ((pcm = mac_per_char_metric (font, &char2b, 0)) != NULL) | 8037 if ((pcm = mac_per_char_metric (font, &char2b, 0)) != NULL) |
8038 width += pcm->width; | 8038 width += pcm->width; |
8039 fontp->average_width = width / 95; | 8039 fontp->average_width = width / 95.0 + 0.5; |
8040 } | 8040 } |
8041 else | 8041 else |
8042 fontp->average_width = FONT_WIDTH (font); | 8042 fontp->average_width = FONT_WIDTH (font); |
8043 } | 8043 } |
8044 | 8044 |