From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Adrian Robert" Newsgroups: gmane.emacs.devel Subject: Font backend font.c: "name" vs "family" Date: Sat, 8 Mar 2008 09:48:01 +0300 Message-ID: <55f7df060803072248w9f554afvae9c2f0ec783bfa5@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1204958901 10490 80.91.229.12 (8 Mar 2008 06:48:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 8 Mar 2008 06:48:21 +0000 (UTC) To: "emacs- devel" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Mar 08 07:48:49 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 1JXsrO-0007hx-HY for ged-emacs-devel@m.gmane.org; Sat, 08 Mar 2008 07:48:46 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JXsqp-0003E9-Qc for ged-emacs-devel@m.gmane.org; Sat, 08 Mar 2008 01:48:11 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JXsqj-0003AV-Qp for emacs-devel@gnu.org; Sat, 08 Mar 2008 01:48:06 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JXsqh-00036P-RR for emacs-devel@gnu.org; Sat, 08 Mar 2008 01:48:05 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JXsqh-00036A-M5 for emacs-devel@gnu.org; Sat, 08 Mar 2008 01:48:03 -0500 Original-Received: from rv-out-0910.google.com ([209.85.198.185]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JXsqh-0002J2-8L for emacs-devel@gnu.org; Sat, 08 Mar 2008 01:48:03 -0500 Original-Received: by rv-out-0910.google.com with SMTP id c27so678706rvf.6 for ; Fri, 07 Mar 2008 22:48:01 -0800 (PST) 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:mime-version:content-type:content-transfer-encoding:content-disposition; bh=wKB1DbfvnS/x+1OJZPTW4mx5BFoKohjOWECZzyEeoEQ=; b=Xyvk/rlskqBJaz//H+FurCWIh/sQneM6hTSBe2rP8rlpcHIKqc37R2XEpJIZG74xLeiqrbHZCJ2TxRsuLIXJJVLNG0AGB0wtCcntjj4to+gWcHZq1hpZ9VFOKatceNWAg9rQdTQJz3xb8kF8RQwl7f3EwXPgN8c5eIRcVEAJBf0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=CegubrBvNH/Ux40+2xLRQoHLgZRirld5tZ/BwZtHSMy4VpCTXM6N1t1kOaQzk39ufQnFRTzFygYeaT/izqbX843DMpyTEXYjxEBjdnAJE3+bbIDA2aZWodX5DTtJJ+P8olWEb30Lmwm/MTqjBajQyAUsozZ+ZIqfd+1JkD3jFUk= Original-Received: by 10.140.179.25 with SMTP id b25mr1490992rvf.152.1204958881505; Fri, 07 Mar 2008 22:48:01 -0800 (PST) Original-Received: by 10.141.84.8 with HTTP; Fri, 7 Mar 2008 22:48:01 -0800 (PST) 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:91704 Archived-At: Hi, The function: font_open_by_name() gets called by font_load_for_face() with name=face->lface[LFACE_FONT_INDEX]. However, from 'spec = Ffont_spec (2, args);', it eventually goes to font_parse_fcname() which puts the information into the font_spec's 'family' slot. But font 'family' and font 'name' are two different things. E.g., "Courier" could be the family, "Courier-Bold" (or "CourierBold") the 'name'. For example, nsfont: list for fontspec: [ns nil Comic\ Sans\ MS nil iso10646-1 101 101 nil nil ((:name . "Comic Sans MS"))] Returning 1 entities. nsfont: open size 12 of fontentity: [ns apple Comic_Sans_MS Regular iso10646-1 99 100 100 0 nil nil nil] ... The returned font has name "ComicSansMS" (no spaces), and gets used in some faces; later: nsfont: list for fontspec: [ns nil ComicSansMS nil iso10646-1 101 101 nil nil ((:name . "ComicSansMS"))] The family "ComicSansMS" (no spaces) does not exist. Is the driver supposed to pick up on the '(:name . "ComicSansMS")' part and ignore the family? Or should load_font_for_face() or font_open_by_name() be changed? It seems strange that loading by font name instead of by font spec should even be attempted in the font backend. Finally, a possibly related question: what are the uniqueness rules for creating new font-entities and opening fonts? I am seeing driver->open() called multiple times for font specs with the same contents (but might be different lisp objects). Should the driver (a) never create more than one instance of a given font entity, or (b) never create more than one 'struct font' object for a given system font, even if multiple entities exist that specify it? thanks, Adrian