From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Juanma Barranquero" Newsgroups: gmane.emacs.devel Subject: Re: Font selection weirdness Date: Thu, 29 May 2008 13:00:23 +0200 Message-ID: References: <483AAED9.20309@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1212058854 31542 80.91.229.12 (29 May 2008 11:00:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 29 May 2008 11:00:54 +0000 (UTC) Cc: Emacs Devel To: "Jason Rumney" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu May 29 13:01:33 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 1K1fsj-0002Ns-S4 for ged-emacs-devel@m.gmane.org; Thu, 29 May 2008 13:01:18 +0200 Original-Received: from localhost ([127.0.0.1]:37838 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K1fry-0000Gq-Dd for ged-emacs-devel@m.gmane.org; Thu, 29 May 2008 07:00:30 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K1frt-0000GK-J7 for emacs-devel@gnu.org; Thu, 29 May 2008 07:00:25 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K1frs-0000G8-UB for emacs-devel@gnu.org; Thu, 29 May 2008 07:00:25 -0400 Original-Received: from [199.232.76.173] (port=54846 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K1frs-0000G5-Rm for emacs-devel@gnu.org; Thu, 29 May 2008 07:00:24 -0400 Original-Received: from wa-out-1112.google.com ([209.85.146.179]:22356) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K1frs-00034C-5B for emacs-devel@gnu.org; Thu, 29 May 2008 07:00:24 -0400 Original-Received: by wa-out-1112.google.com with SMTP id m34so3963444wag.10 for ; Thu, 29 May 2008 04:00:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=stqEzFKzIsO5mR2kw0v1UPlQaqqQcn9224rO4/f23r4=; b=dMGNA/ChAPuJoGDGd21sr1vyhgJKNmrEGVVcrgTvIDHv/GHuY+oqoePeNcQTNQnvXywyTrOnGAqKiYLjL8odDdcuLIgc9vRsWCNydtELS+uZoOa0rXDtZid9Bt+vmsywwrFYLRFDvhwAFQhdhVU+hrXuAJycxd7ER3T/nEHXbLY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=LXg/TMROJ3IqndKd9Kcw0FSkl7LQ1ASV7IXRsKAeRbIs1gtVxQK09F3jBUnPzfPgTl8RDHTK73trVKE2R/Is8W4ciEkeE3eJs6eEfmbbEn7RNpfhOwVOEzzNC7WLgfRSlH1TM/vUHfoVPRU9yt21mElYQQBndilNYI2rrQ0QCGI= Original-Received: by 10.114.53.1 with SMTP id b1mr4062347waa.53.1212058823362; Thu, 29 May 2008 04:00:23 -0700 (PDT) Original-Received: by 10.114.167.17 with HTTP; Thu, 29 May 2008 04:00:23 -0700 (PDT) In-Reply-To: <483AAED9.20309@gnu.org> Content-Disposition: inline X-detected-kernel: by monty-python.gnu.org: 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:97964 Archived-At: On Mon, May 26, 2008 at 2:36 PM, Jason Rumney wrote: > To see why the error is occuring, set a breakpoint on clear_cached_metrics > and when it is hit, go back up the stack (in gdb: frame 1) to see what > function it has failed from. Then get information such as the return code of > the failing function, the character or glyph code that it is failing on, and > the font, tyo help diagnose why it has failed. I'm getting this backtrace (the build is optimized; I'll rebuild if needed): #1 0x01202aa0 in clear_cached_metrics (w32_font=0x1f93300) at w32font.c:1899 #2 0x012072c0 in w32font_text_extents (font=0x1f93300, code=0x82deb0, nglyphs=1, metrics=0x142fdb8) at w32font.c:1885 #3 0x01024116 in get_per_char_metric (f=0x190cc00, font=0x1f93300, char2b=0x82dfd6) at xdisp.c:19453 #4 0x0104c538 in x_produce_glyphs (it=0x82e0c4) at xdisp.c:21000 #5 0x0103a5bd in display_line (it=0x82e0c4) at xdisp.c:16295 #6 0x0103e954 in try_window (window=40862212, pos={charpos = 1, bytepos = 1}, check_margins=1) at xdisp.c:13832 #7 0x01052be7 in redisplay_window (window=40862212, just_this_one_p=0) at xdisp.c:13450 #8 0x01054ca1 in redisplay_window_0 (window=40862212) at xdisp.c:12041 #9 0x01018c51 in internal_condition_case_1 (bfun=0x1054c7e , arg=40862212, handlers=25687301, hfun=0x1023c5a ) at eval.c:1554 #10 0x0102d71d in redisplay_windows (window=33108736) at xdisp.c:12020 #11 0x010461ed in redisplay_internal (preserve_echo_area=1) at xdisp.c:11586 #12 0x01088249 in read_char (commandflag=1, nmaps=3, maps=0x82fb70, prev_event=25704449, used_mouse_menu=0x82fc34, end_time=0x0) at keyboard.c:2685 #13 0x0108c89a in read_key_sequence (keybuf=0x82fcd4, bufsize=30, prompt=25704449, dont_downcase_last=0, can_return_switch_frame=1, fix_current_buffer=1) at keyboard.c:9443 #14 0x0108fa0d in command_loop_1 () at keyboard.c:1651 #15 0x01018ed6 in internal_condition_case (bfun=0x108f77f , handlers=25768129, hfun=0x10869e6 ) at eval.c:1506 #16 0x01085cef in command_loop_2 () at keyboard.c:1367 #17 0x01018f80 in internal_catch (tag=25764201, func=0x1085ccc , arg=25704449) at eval.c:1242 #18 0x0108682b in command_loop () at keyboard.c:1346 #19 0x01086b7f in recursive_edit_1 () at keyboard.c:955 #20 0x01086cea in Frecursive_edit () at keyboard.c:1017 #21 0x01002c3c in main (argc=8585136, argv=0xa941f8) at emacs.c:1770 So the clear_cached_metrics call that triggers is the one in compute_metrics (which has been optimized away). In frame 1, w32_font has $14 = { font = { size = 1075838994, next = 0x2071440, props = {25990081, 25992433, 30970217, 25992313, 31041897, 205440, 205056, 205312, 104, 25704449, 0, 25704449, 49267133, 49267181, 31652435, 31652419, 25704449, 31041969}, max_width = 14, pixel_size = 13, height = 17, space_width = 7, average_width = 7, min_width = 7, ascent = 13, descent = 4, underline_thickness = 1, underline_position = 1, vertical_centering = 0, encoding_type = 0 '\0', baseline_offset = 0, relative_compose = 0, default_ascent = 13, font_encoder = 0x0, driver = 0x137d2c0, encoding_charset = -1, repertory_charset = -1 }, metrics = { tmHeight = 17, tmAscent = 13, tmDescent = 4, tmInternalLeading = 4, tmExternalLeading = 0, tmAveCharWidth = 7, tmMaxCharWidth = 14, tmWeight = 400, tmOverhang = 0, tmDigitizedAspectX = 1001, tmDigitizedAspectY = 1001, tmFirstChar = 32 ' ', tmLastChar = 255 '\377', tmDefaultChar = 32 ' ', tmBreakChar = 32 ' ', tmItalic = 0 '\0', tmUnderlined = 0 '\0', tmStruckOut = 0 '\0', tmPitchAndFamily = 91 '[', tmCharSet = 2 '\002' }, glyph_idx = 0, cached_metrics = 0x1aaa600, n_cache_blocks = 69, compat_w32_font = 0x2f09400 } where the props are type: gdi foundry: outline family: Symbol additional style: decorative registry: ms-symbol weight: 25680 slant: 25632 width: 25664 size: 13 dpi: nil spacing: 0 average width: nil extra: ((:format . type1)) font objects: (#) name: "-outline-Symbol-normal-normal-normal-decorative-13-*-*-*-p-*-ms-symbol" full name: "Symbol-10.0" file: nil format: type1 A weird thing: w32_font->font.glyph_index is 16 when entering compute_metrics, however code = 8704 (U+2200), which is not a glyph. Is that correct? The call to GetGlyphOutlineW returns GDI_ERROR, but GetLastError () == 0. Do you need additional info? Juanma