From unknown Fri Jun 20 07:17:31 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#7887 <7887@debbugs.gnu.org> To: bug#7887 <7887@debbugs.gnu.org> Subject: Status: Emacs will render some fonts under Mac OS X one pixel too tall (patch supplied) Reply-To: bug#7887 <7887@debbugs.gnu.org> Date: Fri, 20 Jun 2025 14:17:31 +0000 retitle 7887 Emacs will render some fonts under Mac OS X one pixel too tall= (patch supplied) reassign 7887 emacs,ns submitter 7887 Anders Lindgren severity 7887 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 22 13:38:32 2011 Received: (at submit) by debbugs.gnu.org; 22 Jan 2011 18:38:32 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PgiM3-0007Bz-SA for submit@debbugs.gnu.org; Sat, 22 Jan 2011 13:38:32 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PgZsr-0002JS-Sf for submit@debbugs.gnu.org; Sat, 22 Jan 2011 04:35:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pga0W-0003rR-Us for submit@debbugs.gnu.org; Sat, 22 Jan 2011 04:43:46 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, T_DKIM_INVALID, T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:41348) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pga0W-0003rM-QU for submit@debbugs.gnu.org; Sat, 22 Jan 2011 04:43:44 -0500 Received: from [140.186.70.92] (port=49511 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pga0U-0000Kt-UI for bug-gnu-emacs@gnu.org; Sat, 22 Jan 2011 04:43:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pga0T-0003rB-6e for bug-gnu-emacs@gnu.org; Sat, 22 Jan 2011 04:43:42 -0500 Received: from mail-gw0-f41.google.com ([74.125.83.41]:58688) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pga0T-0003r6-34 for bug-gnu-emacs@gnu.org; Sat, 22 Jan 2011 04:43:41 -0500 Received: by gwj22 with SMTP id 22so877491gwj.0 for ; Sat, 22 Jan 2011 01:43:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=YKRygLizgGzjFuw1LZMUGRiaCO/Jtws90ggRUrGy9g0=; b=Wc7pzfFNzydUAYmLMYHN6D1kA9X59pvMRpSu8szel7pZeEmfTexSMw89LQcd9DJZnJ +i+/fMQeexLI2JTOCcYl2Zn4zMl6Kp21WXXEteIKHAPR0jHYtj1ULhkS6Ofi/WuXO7lT Ane3hWmei4b03sTrp/63EF+BQ2tC8dA2zxwzk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=xA2m/aayRVe76IEPAQIg/3UeO/UEQnlZVSqvf+nAXfLr0FyAnN6/Iet2AvxOEYU6FK MEQWPt/MdGHoAZDQW96QED2qxUH6mq7Z8wIboJddIe6Jxkt1d0SK2R7BXilB4MDK0iRu Wg9TrEqiWYdv9BWXt1LxG5NrOnZ0b6Kf2SQFk= MIME-Version: 1.0 Received: by 10.150.219.10 with SMTP id r10mr1908848ybg.318.1295689419960; Sat, 22 Jan 2011 01:43:39 -0800 (PST) Received: by 10.151.108.17 with HTTP; Sat, 22 Jan 2011 01:43:39 -0800 (PST) Date: Sat, 22 Jan 2011 10:43:39 +0100 Message-ID: Subject: Emacs will render some fonts under Mac OS X one pixel too tall (patch supplied) From: Anders Lindgren To: bug-gnu-emacs@gnu.org Content-Type: text/plain; charset=ISO-8859-1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Spam-Score: -5.9 (-----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sat, 22 Jan 2011 13:38:30 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.9 (-----) Hi! I have notices that Emacs will render some fonts under Mac OS X one pixel too tall. The current implementation for handling fonts under NextStep always round the descender to the next full integer, to avoid clipping. (As descenders under NextStep are negative, this is done using the function "floor"). Unfortunately, some fonts do not specify the descender as exactly as desired. Concretely, a 6x8 bitmap font could report a descender of -2.0000040531158447 (represented by 0xc000000220000000), which Emacs rounds to -3. The result is that the font will be drawn one pixel taller than expected. The patch below is one example of how to handle this, it will circumvent the problem by adding a small value to the descender, making sure that values close enough to an integer will be rounded to that integer. -- Anders Lindgren 2011-01-22 Anders Lindgren * nsfont.m (nsfont_open): Ensure that fonts with inexact descenders would not become one pixel too tall. === modified file 'src/nsfont.m' --- src/nsfont.m 2011-01-19 22:11:33 +0000 +++ src/nsfont.m 2011-01-22 09:03:56 +0000 @@ -809,6 +809,15 @@ const char *fontName = [[nsfont fontName] UTF8String]; int len = strlen (fontName); + /* The values specified by fonts are not always exact. For + * example, a 6x8 font could specify that the descender is + * -2.00000405... (represented by 0xc000000220000000). Without + * adjustment, the code below would round the descender to -3, + * resulting in a font that would be one pixel higher than + * intended. */ + + CGFloat adjusted_descender = [sfont descender] + 0.0001; + #ifdef NS_IMPL_GNUSTEP font_info->nsfont = sfont; #else @@ -830,7 +839,7 @@ brect = [sfont boundingRectForFont]; full_height = brect.size.height; - min_height = [sfont ascender] - [sfont descender]; + min_height = [sfont ascender] - adjusted_descender; hd = full_height - min_height; /* standard height, similar to Carbon. Emacs.app: was 0.5 by default. */ @@ -845,10 +854,10 @@ /* max bounds */ font_info->max_bounds.ascent = lrint (hshrink * [sfont ascender] + expand * hd/2); - /* [sfont descender] is usually negative. Use floor to avoid - clipping descenders. */ + /* Descender is usually negative. Use floor to avoid clipping + descenders. */ font_info->max_bounds.descent = - -lrint (floor(hshrink* [sfont descender] - expand*hd/2)); + -lrint (floor(hshrink * adjusted_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); @@ -884,7 +893,7 @@ /* set up metrics portion of font struct */ font->ascent = lrint([sfont ascender]); - font->descent = -lrint(floor([sfont descender])); + font->descent = -lrint(floor(adjusted_descender)); font->min_width = ns_char_width(sfont, '|'); font->space_width = lrint (ns_char_width (sfont, ' ')); font->average_width = lrint (font_info->width); In GNU Emacs 24.0.50.1 (x86_64-apple-darwin10.5.0, NS apple-appkit-1038.35) of 2011-01-14 on macpro.local Windowing system distributor `Apple', version 10.3.1038 configured using `configure '--with-ns'' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: nil value of $XMODIFIERS: nil locale-coding-system: nil default enable-multibyte-characters: t Major mode: ObjC/lw Minor modes in effect: diff-auto-refine-mode: t subword-mode: t global-auto-revert-mode: t global-cwarn-mode: t minibuffer-electric-file-mode: t recentf-mode: t msb-mode: t display-time-mode: t tooltip-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t column-number-mode: t line-number-mode: t transient-mark-mode: t abbrev-mode: t Recent input: C-SPC C-w C-SPC C-w C-e C-a C-x C-s C-M-a C-s e p s C-a C-x C-f s a l a s j . k . c C-x o C-x p C-M-a C-SPC C-w C-x C-s C-x o C-y C-x p C-v C-l C-v C-a C-SPC C-w C-x C-s C-x o C-y C-x C-s C-x p M-d M-d M-d c o u l y d SPC M-f y q q M-f M-f M-f t h e SPC d e s c M-- q C-x C-s C-a C-x C-s SPC SPC C-a C-x C-s SPC SPC C-a C-x C-s C-a SPC SPC C-a C-x C-s M-f C-s C-w C-s C-a a a d j u s t m e n t d q C-a C-SPC x i s p l l e l l - r e g ' q C-g c q C-d i f y C-a C-x C-s Recent messages: Wrote /Users/anders/build/emacs/trunk/src/nsfont.m Mark saved where search started Mark set Starting new Ispell process [default] ... Entering debugger... Back to top level. Quit Auto-saving...done Saving file /Users/anders/build/emacs/trunk/src/nsfont.m... Wrote /Users/anders/build/emacs/trunk/src/nsfont.m Load-path shadows: ~/emacs/lisp/table hides /Applications/Emacs24.app/Contents/Resources/lisp/textmodes/table ~/emacs/lisp/ruby-mode hides /Applications/Emacs24.app/Contents/Resources/lisp/progmodes/ruby-mode ~/emacs/src/asm-mode-new/src/asm-mode hides /Applications/Emacs24.app/Contents/Resources/lisp/progmodes/asm-mode Features: (ispell smerge-mode diff-mode texinfo autoconf autoconf-mode conf-mode shadow sort gnus-util mail-extr message rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mailabbrev mail-utils gmm-utils mailheader emacsbug subword newcomment ctypes grep compile etags jka-compr find-func follow my-end-of-buffer-log c-electric-operator c-indent-operator dired-aux dired vc-bzr sha1 hex-util add-log vc-dispatcher vc-svn pp apropos multi-isearch debug dabbrev help-mode eldoc ps-print ps-def lpr autorevert folding-isearch folding view rdebug cwarn prepaint cc-mode cc-fonts cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs tempo edg-mode split-nways toggle-file-read-only lockdir uniquify ange-ftp comint regexp-opt ring paren mic-paren iso-insert minibuf-elfile easy-mmode recentf tree-widget wid-edit easymenu msb edmacro kmacro warnings disp-table time advice help-fns advice-preload cl tooltip ediff-hook vc-hooks lisp-float-type mwheel ns-win tool-bar dnd fontset image fringe lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev loaddefs button minibuffer faces cus-face files text-properties overlay md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process ns multi-tty emacs) From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 25 07:55:17 2011 Received: (at 7887) by debbugs.gnu.org; 25 Jan 2011 12:55:17 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PhiQV-0000jR-QM for submit@debbugs.gnu.org; Tue, 25 Jan 2011 07:55:16 -0500 Received: from smtprelay-b12.telenor.se ([62.127.194.21]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PhiQU-0000jF-1w for 7887@debbugs.gnu.org; Tue, 25 Jan 2011 07:55:15 -0500 Received: from ipb2.telenor.se (ipb2.telenor.se [195.54.127.165]) by smtprelay-b12.telenor.se (Postfix) with ESMTP id AE328EB630 for <7887@debbugs.gnu.org>; Tue, 25 Jan 2011 14:03:17 +0100 (CET) X-SENDER-IP: [85.225.45.100] X-LISTENER: [smtp.bredband.net] X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqY0AA9ZPk1V4S1kPGdsb2JhbACIXJwSDAEBAQE1L7xchU8Ej24bgns X-IronPort-AV: E=Sophos;i="4.60,374,1291590000"; d="scan'208";a="167275334" Received: from c-642de155.25-1-64736c10.cust.bredbandsbolaget.se (HELO coolsville.localdomain) ([85.225.45.100]) by ipb2.telenor.se with ESMTP; 25 Jan 2011 14:03:04 +0100 Received: from [10.225.40.55] (unknown [193.45.43.33]) by coolsville.localdomain (Postfix) with ESMTPSA id 61CD37FA05A; Tue, 25 Jan 2011 14:03:03 +0100 (CET) Message-ID: <4D3ECA06.5090105@swipnet.se> Date: Tue, 25 Jan 2011 14:03:02 +0100 From: "Jan D." User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; sv-SE; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 MIME-Version: 1.0 To: Anders Lindgren Subject: Re: bug#7887: Emacs will render some fonts under Mac OS X one pixel too tall (patch supplied) References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.2 (--) X-Debbugs-Envelope-To: 7887 Cc: 7887@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.2 (--) Anders Lindgren skrev 2011-01-22 10:43: > Hi! > > I have notices that Emacs will render some fonts under Mac OS X one > pixel too tall. > > The current implementation for handling fonts under NextStep always > round the descender to the next full integer, to avoid clipping. (As > descenders under NextStep are negative, this is done using the > function "floor"). Unfortunately, some fonts do not specify the > descender as exactly as desired. Concretely, a 6x8 bitmap font could > report a descender of -2.0000040531158447 (represented by > 0xc000000220000000), which Emacs rounds to -3. The result is that the > font will be drawn one pixel taller than expected. > > The patch below is one example of how to handle this, it will > circumvent the problem by adding a small value to the descender, > making sure that values close enough to an integer will be rounded to > that integer. How about checking if it is negative and then use ceil instead of floor, and keeping floor for the positive case? Jan D. > > -- Anders Lindgren > > 2011-01-22 Anders Lindgren > > * nsfont.m (nsfont_open): Ensure that fonts with inexact > descenders would not become one pixel too tall. > > > === modified file 'src/nsfont.m' > --- src/nsfont.m 2011-01-19 22:11:33 +0000 > +++ src/nsfont.m 2011-01-22 09:03:56 +0000 > @@ -809,6 +809,15 @@ > const char *fontName = [[nsfont fontName] UTF8String]; > int len = strlen (fontName); > > + /* The values specified by fonts are not always exact. For > + * example, a 6x8 font could specify that the descender is > + * -2.00000405... (represented by 0xc000000220000000). Without > + * adjustment, the code below would round the descender to -3, > + * resulting in a font that would be one pixel higher than > + * intended. */ > + > + CGFloat adjusted_descender = [sfont descender] + 0.0001; > + > #ifdef NS_IMPL_GNUSTEP > font_info->nsfont = sfont; > #else > @@ -830,7 +839,7 @@ > > brect = [sfont boundingRectForFont]; > full_height = brect.size.height; > - min_height = [sfont ascender] - [sfont descender]; > + min_height = [sfont ascender] - adjusted_descender; > hd = full_height - min_height; > > /* standard height, similar to Carbon. Emacs.app: was 0.5 by default. */ > @@ -845,10 +854,10 @@ > /* max bounds */ > font_info->max_bounds.ascent = > lrint (hshrink * [sfont ascender] + expand * hd/2); > - /* [sfont descender] is usually negative. Use floor to avoid > - clipping descenders. */ > + /* Descender is usually negative. Use floor to avoid clipping > + descenders. */ > font_info->max_bounds.descent = > - -lrint (floor(hshrink* [sfont descender] - expand*hd/2)); > + -lrint (floor(hshrink * adjusted_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); > @@ -884,7 +893,7 @@ > > /* set up metrics portion of font struct */ > font->ascent = lrint([sfont ascender]); > - font->descent = -lrint(floor([sfont descender])); > + font->descent = -lrint(floor(adjusted_descender)); > font->min_width = ns_char_width(sfont, '|'); > font->space_width = lrint (ns_char_width (sfont, ' ')); > font->average_width = lrint (font_info->width); > > > > > In GNU Emacs 24.0.50.1 (x86_64-apple-darwin10.5.0, NS apple-appkit-1038.35) > of 2011-01-14 on macpro.local > Windowing system distributor `Apple', version 10.3.1038 > configured using `configure '--with-ns'' > > Important settings: > value of $LC_ALL: nil > value of $LC_COLLATE: nil > value of $LC_CTYPE: nil > value of $LC_MESSAGES: nil > value of $LC_MONETARY: nil > value of $LC_NUMERIC: nil > value of $LC_TIME: nil > value of $LANG: nil > value of $XMODIFIERS: nil > locale-coding-system: nil > default enable-multibyte-characters: t > > Major mode: ObjC/lw > > Minor modes in effect: > diff-auto-refine-mode: t > subword-mode: t > global-auto-revert-mode: t > global-cwarn-mode: t > minibuffer-electric-file-mode: t > recentf-mode: t > msb-mode: t > display-time-mode: t > tooltip-mode: t > mouse-wheel-mode: t > menu-bar-mode: t > file-name-shadow-mode: t > global-font-lock-mode: t > font-lock-mode: t > auto-composition-mode: t > auto-encryption-mode: t > auto-compression-mode: t > column-number-mode: t > line-number-mode: t > transient-mark-mode: t > abbrev-mode: t > > Recent input: > > > > C-SPC C-w C-SPC > C-w C-e > C-a > C-x C-s C-M-a C-s e p s C-a C-x C-f s a > l a s j . k . c > C-x o C-x p C-M-a > C-SPC > C-w C-x C-s C-x o C-y C-x p > C-v C-l C-v C-a C-SPC > C-w > C-x C-s C-x o C-y C-x C-s C-x p > M-d M-d M-d c o u l y d SPC > M-f y > q q > M-f M-f M-f t h e SPC d e s c > M-- q C-x C-s > C-a C-x C-s > SPC SPC C-a C-x C-s > SPC SPC C-a C-x > C-s C-a SPC > SPC > C-a C-x C-s M-f > C-s C-w C-s C-a a > a d j u s t m e n t d q > C-a C-SPC > x i s p l l e l l > - r e g ' q C-g > c q > C-d i > f y C-a C-x C-s -bug-report> > > Recent messages: > Wrote /Users/anders/build/emacs/trunk/src/nsfont.m > Mark saved where search started > Mark set > Starting new Ispell process [default] ... > Entering debugger... > Back to top level. > Quit > Auto-saving...done > Saving file /Users/anders/build/emacs/trunk/src/nsfont.m... > Wrote /Users/anders/build/emacs/trunk/src/nsfont.m > > Load-path shadows: > ~/emacs/lisp/table hides > /Applications/Emacs24.app/Contents/Resources/lisp/textmodes/table > ~/emacs/lisp/ruby-mode hides > /Applications/Emacs24.app/Contents/Resources/lisp/progmodes/ruby-mode > ~/emacs/src/asm-mode-new/src/asm-mode hides > /Applications/Emacs24.app/Contents/Resources/lisp/progmodes/asm-mode > > Features: > (ispell smerge-mode diff-mode texinfo autoconf autoconf-mode conf-mode > shadow sort gnus-util mail-extr message rfc822 mml mml-sec mm-decode > mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums > mm-util mail-prsvr mailabbrev mail-utils gmm-utils mailheader emacsbug > subword newcomment ctypes grep compile etags jka-compr find-func follow > my-end-of-buffer-log c-electric-operator c-indent-operator dired-aux > dired vc-bzr sha1 hex-util add-log vc-dispatcher vc-svn pp apropos > multi-isearch debug dabbrev help-mode eldoc ps-print ps-def lpr > autorevert folding-isearch folding view rdebug cwarn prepaint cc-mode > cc-fonts cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs > tempo edg-mode split-nways toggle-file-read-only lockdir uniquify > ange-ftp comint regexp-opt ring paren mic-paren iso-insert > minibuf-elfile easy-mmode recentf tree-widget wid-edit easymenu msb > edmacro kmacro warnings disp-table time advice help-fns advice-preload > cl tooltip ediff-hook vc-hooks lisp-float-type mwheel ns-win tool-bar > dnd fontset image fringe lisp-mode register page menu-bar rfn-eshadow > timer select scroll-bar mouse jit-lock font-lock syntax facemenu > font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan > thai tai-viet lao korean japanese hebrew greek romanian slovak czech > european ethiopic indian cyrillic chinese case-table epa-hook > jka-cmpr-hook help simple abbrev loaddefs button minibuffer faces > cus-face files text-properties overlay md5 base64 format env code-pages > mule custom widget hashtable-print-readable backquote > make-network-process ns multi-tty emacs) > > From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 29 05:31:01 2011 Received: (at 7887-done) by debbugs.gnu.org; 29 Jan 2011 10:31:01 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Pj856-0006uQ-Lc for submit@debbugs.gnu.org; Sat, 29 Jan 2011 05:31:00 -0500 Received: from smtprelay-h21.telenor.se ([195.54.99.196]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Pj854-0006uA-6z for 7887-done@debbugs.gnu.org; Sat, 29 Jan 2011 05:30:59 -0500 Received: from ipb4.telenor.se (ipb4.telenor.se [195.54.127.167]) by smtprelay-h21.telenor.se (Postfix) with ESMTP id 3B2E2EBDDB for <7887-done@debbugs.gnu.org>; Sat, 29 Jan 2011 11:39:12 +0100 (CET) X-SENDER-IP: [85.225.45.100] X-LISTENER: [smtp.bredband.net] X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ato4AIt9Q01V4S1kPGdsb2JhbACIXZwmDAEBAQE1L7sDhU4Ej2Y X-IronPort-AV: E=Sophos;i="4.60,396,1291590000"; d="scan'208";a="1710223298" Received: from c-642de155.25-1-64736c10.cust.bredbandsbolaget.se (HELO coolsville.localdomain) ([85.225.45.100]) by ipb4.telenor.se with ESMTP; 29 Jan 2011 11:39:09 +0100 Received: from [172.20.199.13] (zeplin [172.20.199.13]) by coolsville.localdomain (Postfix) with ESMTPSA id 6A6F47FA05A; Sat, 29 Jan 2011 11:39:09 +0100 (CET) Message-ID: <4D43EE4D.4040602@swipnet.se> Date: Sat, 29 Jan 2011 11:39:09 +0100 From: =?ISO-8859-1?Q?Jan_Dj=E4rv?= User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; sv-SE; rv:1.9.2.14) Gecko/20110123 Thunderbird/3.1.8 MIME-Version: 1.0 To: Anders Lindgren , 7887-done@debbugs.gnu.org Subject: Re: bug#7887: Emacs will render some fonts under Mac OS X one pixel too tall (patch supplied) References: <4D3ECA06.5090105@swipnet.se> <4D3EF686.4090205@swipnet.se> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 7887-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.3 (--) Anders Lindgren skrev 2011-01-25 18.18: > > My original suggesten simply said that anything in the range -2.0 - > -2.0001 should be treated as -2. The motivation behind this is that > often a floating-point error is only in the lowest bit or bits. (In > the case I found, the bits that were set corresponds to the least > significant mantissa bits of a 32 bit floating-point number, even > though the number had been converted to 64 bit number along the way.) > If it only to handle fp errors, then I guess 0.0001 is OK. Patch checked= in. I don't have any fonts to test with, so if you can confirm that it is fix= ed,=20 that would be great. Thanks, Jan D. > On Tue, Jan 25, 2011 at 5:12 PM, Jan Dj=E4rv wrote= : >> > Sounds like a job for round then. >> > >> > Jan D. >> > >> > >> > Anders Lindgren skrev 2011-01-25 15.45: >>> >> >>> >> No, that won't work. Descents are always negative, "floor" is used= to >>> >> treat, for example, -2.5 as -3.0, to avoid clipping. The problem i= s >>> >> that is also converts -2.000001 to -3. >>> >> >>> >> What I suggested was that we continue to round -2.5 down to -3, bu= t >>> >> round values very close to -2.0 up to -2. >>> >> >>> >> I don't know if this is a general problem, only related to FontFor= ge >>> >> (an open-source font editor). If it's only related to FontForge, t= hen >>> >> another solution would be to fix it instead of Emacs. >>> >> >>> >> -- Anders >>> >> >>> >> From unknown Fri Jun 20 07:17:31 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 26 Feb 2011 12:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator