From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.devel Subject: Re: Using more and/or better icons in Emacs Date: Fri, 9 Apr 2021 20:43:56 -0500 Message-ID: References: <2f0b4786-d569-27e6-fa8a-fb47bf08b166@yandex.ru> <0279fbc8-74c3-3766-2b26-b3eb933a501e@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28049"; mail-complaints-to="usenet@ciao.gmane.io" To: Alan Third , Dmitry Gutov , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Apr 10 03:44:31 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lV2fn-0007CL-GF for ged-emacs-devel@m.gmane-mx.org; Sat, 10 Apr 2021 03:44:31 +0200 Original-Received: from localhost ([::1]:58760 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lV2fm-0001oP-H5 for ged-emacs-devel@m.gmane-mx.org; Fri, 09 Apr 2021 21:44:30 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57746) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lV2fI-0001OZ-CT for emacs-devel@gnu.org; Fri, 09 Apr 2021 21:44:00 -0400 Original-Received: from mail-pf1-f172.google.com ([209.85.210.172]:38401) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lV2fG-00030a-Fm for emacs-devel@gnu.org; Fri, 09 Apr 2021 21:44:00 -0400 Original-Received: by mail-pf1-f172.google.com with SMTP id y16so5371181pfc.5 for ; Fri, 09 Apr 2021 18:43:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:in-reply-to:references:mime-version:date :message-id:subject:to; bh=TAoEFeSNqW4gbgCbPztsLs0h2DvfkKFGwVuyzm0ORvA=; b=sPHTGi05vcTe2RWdLmp8IVxWwR/C/ZNgbHQfA/YU5C6RJRV9M9RU9V3csyFeXbJwMt 13Jo6XCqL7/X3ziyGvcgMij0E8JJC1IKcPJHuqgpBQmt+habDUGY1ALnmYI3d+SNSDOo 3lYiBWRt0ad3X0HQa0Gm+kCWbltWX0nzwHzkMB9qxNmtgBLCDAxnYYWT3fgPTlbEUpEo /E1JvMe330vWCEJvnwiBl44Lp03SXyeezip63oNuXg3xGursvOlM7R/7Gi3O6YLMtZdK 9lifpo5zmrubin6zP+JCgpn6kQNE8cfzJ5VSrAE/jzn5Y2wGhvlIDsa72B5+hW8+xorZ SrJQ== X-Gm-Message-State: AOAM532TQpBwsup7k6Iu1hkN8M0TrzccCEEgb9ZoG8Tg6E8ObvGuoAuK P+Mbw2lRnIhSk+UfVBlGLPHyAL9Qa7UhzHrpwZ0= X-Google-Smtp-Source: ABdhPJyAxvrLRVY4YRjyezvGe0iNVRTxvsnO5bDlo37XYs8W2GmXTBd1Lk+QFq+7kWek2vuQ4KBJ9QSSDsY3yH0PTSE= X-Received: by 2002:a65:4046:: with SMTP id h6mr15653043pgp.345.1618019036675; Fri, 09 Apr 2021 18:43:56 -0700 (PDT) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Fri, 9 Apr 2021 20:43:56 -0500 In-Reply-To: Received-SPF: pass client-ip=209.85.210.172; envelope-from=stefankangas@gmail.com; helo=mail-pf1-f172.google.com X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:267762 Archived-At: Stefan Kangas writes: > Basing myself on that I have ended up with the following fragment: > > (let* ((scale (cadr (assoc :height (assoc 'default face-remapping-alist)))) > (family (face-attribute 'default :family)) > (height (* (aref (font-info family) 2) (if scale scale 1))) > (ascent (* (aref (font-info family) 8) (if scale scale 1)))) > (insert-image (create-image "material/action/ic_search_24px.svg" 'svg nil > :height height > :ascent 'center))) Hmm, I'm now testing simply using this, with width and height set to 1em in the SVG file: (insert-image (create-image "material/action/ic_search_24px.svg" 'svg nil :ascent 'center)) And it seems to do precisely the correct thing, as well as work with `text-scale-adjust'. So perhaps that's the winner?