From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dan Nicolaescu Newsgroups: gmane.emacs.devel Subject: Re: Zero height line causing arithmetic errors Date: Wed, 18 Jun 2008 18:19:21 -0700 Message-ID: <200806190119.m5J1JLc8000941@sallyv1.ics.uci.edu> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1213838476 27081 80.91.229.12 (19 Jun 2008 01:21:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 19 Jun 2008 01:21:16 +0000 (UTC) Cc: Stefan Monnier , emacs-devel@gnu.org To: Kenichi Handa Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jun 19 03:22:00 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1K98qe-0000Ss-0V for ged-emacs-devel@m.gmane.org; Thu, 19 Jun 2008 03:22:00 +0200 Original-Received: from localhost ([127.0.0.1]:56922 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K98pp-0005zn-0g for ged-emacs-devel@m.gmane.org; Wed, 18 Jun 2008 21:21:09 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K98pk-0005zg-TD for emacs-devel@gnu.org; Wed, 18 Jun 2008 21:21:04 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K98ph-0005zI-BK for emacs-devel@gnu.org; Wed, 18 Jun 2008 21:21:04 -0400 Original-Received: from [199.232.76.173] (port=57270 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K98ph-0005zF-4C for emacs-devel@gnu.org; Wed, 18 Jun 2008 21:21:01 -0400 Original-Received: from sallyv1.ics.uci.edu ([128.195.1.109]:43564) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA1:24) (Exim 4.60) (envelope-from ) id 1K98pg-0000p1-MV for emacs-devel@gnu.org; Wed, 18 Jun 2008 21:21:01 -0400 X-ICS-MailScanner-Watermark: 1214443163.46743@B3KKnNC9ChncwHFBgUH8Dg Original-Received: from mothra.ics.uci.edu (mothra.ics.uci.edu [128.195.6.93]) by sallyv1.ics.uci.edu (8.13.7+Sun/8.13.7) with ESMTP id m5J1JLc8000941; Wed, 18 Jun 2008 18:19:21 -0700 (PDT) In-Reply-To: (Kenichi Handa's message of "Thu, 19 Jun 2008 10:12:51 +0900") Original-Lines: 68 X-ICS-MailScanner: Found to be clean X-ICS-MailScanner-SpamCheck: not spam, SpamAssassin (score=1.06, required 5, autolearn=disabled, ALL_TRUSTED -1.44, FM_MULTI_ODD2 1.10, FM_MULTI_ODD3 0.70, FM_MULTI_ODD4 0.70) X-ICS-MailScanner-SpamScore: s X-ICS-MailScanner-From: dann@mothra.ics.uci.edu X-detected-kernel: by monty-python.gnu.org: Solaris 10 (beta) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:99428 Archived-At: Kenichi Handa writes: > In article , Stefan Monnier 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