Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
4f64a164
Commit
4f64a164
authored
May 27, 2008
by
Kenichi Handa
Browse files
(xfont_open): Fix calculation of font->average_width.
parent
35611703
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
src/ChangeLog
src/ChangeLog
+4
-0
src/xfont.c
src/xfont.c
+7
-1
No files found.
src/ChangeLog
View file @
4f64a164
2008-05-27 Kenichi Handa <handa@m17n.org>
* xfont.c (xfont_open): Fix calculation of font->average_width.
2008-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
* casefiddle.c (casify_object): Try to guess better whether the
...
...
src/xfont.c
View file @
4f64a164
...
...
@@ -613,8 +613,14 @@ xfont_open (f, entity, pixel_size)
for
(
char2b
.
byte2
=
33
;
char2b
.
byte2
<=
126
;
char2b
.
byte2
++
)
if
((
pcm
=
xfont_get_pcm
(
xfont
,
&
char2b
))
!=
NULL
)
width
+=
pcm
->
width
,
n
++
;
font
->
average_width
=
width
/
n
;
if
(
n
>
0
)
font
->
average_width
=
width
/
n
;
}
if
(
font
->
average_width
==
0
)
/* No easy way other than this to get a reasonable
average_width. */
font
->
average_width
=
(
xfont
->
min_bounds
.
width
+
xfont
->
max_bounds
.
width
)
/
2
;
}
BLOCK_INPUT
;
...
...
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