From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Reitter Newsgroups: gmane.emacs.devel Subject: Re: Line height too small with Monaco font on Mac OS X Date: Mon, 8 Feb 2010 16:15:19 -0500 Message-ID: References: <256A1330-5C0B-4F54-926E-83C95923067D@devrx.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1077) Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="Apple-Mail-16--406288967" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1265663750 4030 80.91.229.12 (8 Feb 2010 21:15:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 8 Feb 2010 21:15:50 +0000 (UTC) Cc: "emacs-devel@gnu.org discussions" To: Francis Devereux , Chong Yidong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 08 22:15:44 2010 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.69) (envelope-from ) id 1NeaxL-0001IL-Nh for ged-emacs-devel@m.gmane.org; Mon, 08 Feb 2010 22:15:44 +0100 Original-Received: from localhost ([127.0.0.1]:44892 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NeaxL-0002LJ-1V for ged-emacs-devel@m.gmane.org; Mon, 08 Feb 2010 16:15:43 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NeaxF-0002Ky-2A for emacs-devel@gnu.org; Mon, 08 Feb 2010 16:15:37 -0500 Original-Received: from [199.232.76.173] (port=37527 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NeaxE-0002Kq-AW for emacs-devel@gnu.org; Mon, 08 Feb 2010 16:15:36 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NeaxD-0005Ao-M3 for emacs-devel@gnu.org; Mon, 08 Feb 2010 16:15:36 -0500 Original-Received: from mail-vw0-f41.google.com ([209.85.212.41]:55769) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NeaxD-0005AI-Cq for emacs-devel@gnu.org; Mon, 08 Feb 2010 16:15:35 -0500 Original-Received: by vws4 with SMTP id 4so927384vws.0 for ; Mon, 08 Feb 2010 13:15:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:mime-version :content-type:from:in-reply-to:date:cc:message-id:references:to :content-transfer-encoding:x-pgp-agent:x-mailer; bh=02mdW++53dJH2M1Kp0nd9yZHW9SyvrVn1eB/z7C3mmI=; b=lJukFp5dpG76JOyUFy0KMOtN6602biH8LlrFrMO2d/24H78BKruJj62KfNOVrSieWl jS+4cAuEzQxRtGDPuVkvmILc4IMjBt87/W4iX5t0/hMaBS8RTaHhTSy09yaxdk9n43cT 4cYOD7rMLMHMMTQMVBLd16/OQGrDUjOd3H7fI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :message-id:references:to:content-transfer-encoding:x-pgp-agent :x-mailer; b=iNXhIteRNkOGmUrNq4dqk/QyR9fq/NHI1yb2DCzeAeeiSKBpHwjKcACLhAbgfVvnSv v20irrj00FPU+f3Ly6SAFlx9PY962G5d+7U3q9PRJOIcEaF3tn2zieWo4rFx7NQ5bOxC 6dRTri8IefkUq2ebaZNsu3p4EzyZQYFfEiwaE= Original-Received: by 10.220.122.15 with SMTP id j15mr44580vcr.90.1265663732226; Mon, 08 Feb 2010 13:15:32 -0800 (PST) Original-Received: from ?192.168.1.42? (pool-96-236-181-152.pitbpa.east.verizon.net [96.236.181.152]) by mx.google.com with ESMTPS id 21sm26016406vws.9.2010.02.08.13.15.27 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 08 Feb 2010 13:15:28 -0800 (PST) In-Reply-To: <256A1330-5C0B-4F54-926E-83C95923067D@devrx.org> X-Pgp-Agent: GPGMail 1.2.3 X-Mailer: Apple Mail (2.1077) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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:121027 Archived-At: This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --Apple-Mail-16--406288967 Content-Type: multipart/mixed; boundary=Apple-Mail-15--406289129 --Apple-Mail-15--406289129 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Francis, On Feb 8, 2010, at 6:10 AM, Francis Devereux wrote: > Could someone have a look at the patch I added to = http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D3975 and apply it if it = looks OK? This looks good to me. It doesn't affect other font sizes (at least not = Monaco 13). Thanks for fixing this problem. I've reformatted it a little for coding style - see attached. Could someone with a bzr setup commit this by any chance? 2010-02-08 Francis Devereux * nsfont.m (nsfont_open): Round descender dimension=20 towards greater height as to not cause clipping (Bug #3975). --Apple-Mail-15--406289129 Content-Disposition: attachment; filename=lineheight.patch Content-Type: application/octet-stream; name="lineheight.patch" Content-Transfer-Encoding: 7bit diff --git a/src/nsfont.m b/src/nsfont.m index d5107f3..6b258ce 100644 --- a/src/nsfont.m +++ b/src/nsfont.m @@ -844,8 +844,11 @@ nsfont_open (FRAME_PTR f, Lisp_Object font_entity, int pixel_size) /* max bounds */ font_info->max_bounds.ascent = lrint (hshrink * [sfont ascender] + expand * hd/2); + /* [sfont descender] is usually negative, so we use floor to round + towards the integer with the greater magnitude so that we don't + clip any descenders. */ font_info->max_bounds.descent = - -lrint (hshrink* [sfont descender] - expand*hd/2); + -lrint (floor (hshrink* [sfont descender] - expand * hd/2)); font_info->height = font_info->max_bounds.ascent + font_info->max_bounds.descent; font_info->max_bounds.width = lrint (font_info->width); @@ -878,10 +881,9 @@ nsfont_open (FRAME_PTR f, Lisp_Object font_entity, int pixel_size) font_info->cgfont = CGFontCreateWithPlatformFont ((void*)&atsFont); } #endif - /* set up metrics portion of font struct */ - font->ascent = [sfont ascender]; - font->descent = -[sfont descender]; + font->ascent = lrint ([sfont ascender]); + font->descent = -lrint (floor([sfont descender])); font->min_width = ns_char_width(sfont, '|'); font->space_width = lrint (ns_char_width (sfont, ' ')); font->average_width = lrint (font_info->width); --Apple-Mail-15--406289129-- --Apple-Mail-16--406288967 content-type: application/pgp-signature; x-mac-type=70674453; name=PGP.sig content-description: This is a digitally signed message part content-disposition: inline; filename=PGP.sig content-transfer-encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.12 (Darwin) iEYEARECAAYFAktwfu0ACgkQYotoJUVQB4L31ACgtenmiWzXIR+X9iutTTPWmWNP QlUAoNj8Et8cONb9XFLho4JU7UttAUm4 =5Hw0 -----END PGP SIGNATURE----- --Apple-Mail-16--406288967--