From: Dan Nicolaescu <dann@ics.uci.edu>
To: Kenichi Handa <handa@m17n.org>
Cc: Stefan Monnier <monnier@iro.umontreal.ca>, emacs-devel@gnu.org
Subject: Re: Zero height line causing arithmetic errors
Date: Wed, 18 Jun 2008 18:19:21 -0700 [thread overview]
Message-ID: <200806190119.m5J1JLc8000941@sallyv1.ics.uci.edu> (raw)
In-Reply-To: <E1K98hn-0008QM-UF@etlken.m17n.org> (Kenichi Handa's message of "Thu, 19 Jun 2008 10:12:51 +0900")
Kenichi Handa <handa@m17n.org> writes:
> In article <jwvtzfwc4kq.fsf-monnier+emacs@gnu.org>, Stefan Monnier <monnier@iro.umontreal.ca> writes:
>
> > My MPC.el package uses an overlay placed at the end of a line with an
> > after-string of #("\n" 0 1 (face (:height 0.05 :inverse-video t)))
> > in order to place a horizontal line in the display.
>
> > In Emacs-22, this worked fine (except the line was a bit thicker than
> > 0.05 times the base line height). In Emacs-CVS until recently this
> > worked except that the line was full-height (i.e. 13 pixels in my case).
> > Recently, it has started to cause more problems because now
> > FRAME_SMALLEST_FONT_HEIGHT returns 0, and that value is used at 2 places
> > in the divisor position.
>
> > I guess the 0 is because 13 pixels (default font height) * 0.05 -> 0.65
> > pixels which are truncated to 0.
>
> > I currently use the patch below, which makes it all work again (tho
> > still with the problem that the 0.05 isn't taken into account and line
> > line is 13 pixel think), but I suspect it's not the right place to fix
> > it,
>
> For the problem of FRAME_SMALLEST_FONT_HEIGHT being set to
> 0, I installed the similar change.
>
> And, for the problem of too tall line-height, I found the
> culprit is XftTextExtents8. When the pixelsize of a font is
> less than 5 or so, for some font, it returns strange values
> in `extents' argument. For instance, with the attached
> test problem, I get this result:
>
> % ./xfttest 'bitstream vera sans mono'
> pixelsize=9, ascent=8, descent=2
> pixelsize=8, ascent=7, descent=2
> pixelsize=7, ascent=6, descent=2
> pixelsize=6, ascent=5, descent=2
> pixelsize=5, ascent=4, descent=2
> pixelsize=4, ascent=4, descent=1
> pixelsize=3, ascent=3, descent=1
> pixelsize=2, ascent=2, descent=1
> pixelsize=1, ascent=1, descent=1
> pixelsize=0, ascent=1, descent=1
> % ./xfttest 'dejavu sans mono'
> pixelsize=9, ascent=8, descent=2
> pixelsize=8, ascent=7, descent=2
> pixelsize=7, ascent=6, descent=2
> pixelsize=6, ascent=5, descent=1
> pixelsize=5, ascent=5, descent=1
> pixelsize=4, ascent=5, descent=2 <-- increasing!
> pixelsize=3, ascent=4, descent=4
> pixelsize=2, ascent=5, descent=5
> pixelsize=1, ascent=5, descent=5
> pixelsize=0, ascent=5, descent=5
This works fine for me on Fedora 9:
./xfttest 'dejavu sans mono'
pixelsize=9, ascent=8, descent=2
pixelsize=8, ascent=8, descent=2
pixelsize=7, ascent=6, descent=2
pixelsize=6, ascent=5, descent=2
pixelsize=5, ascent=4, descent=2
pixelsize=4, ascent=4, descent=1
pixelsize=3, ascent=3, descent=1
pixelsize=2, ascent=2, descent=1
pixelsize=1, ascent=1, descent=1
pixelsize=0, ascent=1, descent=1
next prev parent reply other threads:[~2008-06-19 1:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-14 17:35 Zero height line causing arithmetic errors Stefan Monnier
2008-06-19 1:12 ` Kenichi Handa
2008-06-19 1:19 ` Dan Nicolaescu [this message]
2008-06-19 14:13 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200806190119.m5J1JLc8000941@sallyv1.ics.uci.edu \
--to=dann@ics.uci.edu \
--cc=emacs-devel@gnu.org \
--cc=handa@m17n.org \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).