From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?Q?Elias_M=C3=A5rtenson?= Newsgroups: gmane.emacs.devel Subject: Emacs's algorithm for glyph substitution Date: Fri, 29 Jun 2018 10:54:51 +0800 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000c79a36056fbef867" X-Trace: blaine.gmane.org 1530240816 24728 195.159.176.226 (29 Jun 2018 02:53:36 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 29 Jun 2018 02:53:36 +0000 (UTC) To: emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jun 29 04:53:32 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fYjXP-0006KC-A6 for ged-emacs-devel@m.gmane.org; Fri, 29 Jun 2018 04:53:31 +0200 Original-Received: from localhost ([::1]:39567 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYjZU-0005Ss-Od for ged-emacs-devel@m.gmane.org; Thu, 28 Jun 2018 22:55:40 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33544) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYjYk-0005Sc-8y for emacs-devel@gnu.org; Thu, 28 Jun 2018 22:54:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fYjYj-00037X-Fa for emacs-devel@gnu.org; Thu, 28 Jun 2018 22:54:54 -0400 Original-Received: from mail-it0-x22c.google.com ([2607:f8b0:4001:c0b::22c]:52711) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fYjYj-00035N-9R for emacs-devel@gnu.org; Thu, 28 Jun 2018 22:54:53 -0400 Original-Received: by mail-it0-x22c.google.com with SMTP id p4-v6so862648itf.2 for ; Thu, 28 Jun 2018 19:54:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=j7qR9yqNDNgMAK6ctuMsq9/VfPHGZ+G+mDVKNGy5zVg=; b=tj5nLoMuRaeOY339IAz6AUFLnZ4cKF+kRDOT3Z+cdPYDzSMUJufm0n8/ewOlsNXhZQ aIB3RmHSR3T3QW/RtBVVS7JGqy1U4FXFCxjU78p2jQ82/9mAmcq5nuxRTXJFWYGX0FQU 4kWP6jxImvzBy1I8x0OSMk60LY31BFGG/7uquaw3nQsDooPe10x9g92aiePhXqheESqe PEYe68QHGEv3UQXsAjQjp7SgLCMdwTiu9S7CeMP0NC4cSFP6AHRTsAP4lKcMwdVkaC9C /dxXNXsajcmn/MLBDw8J7WteMxdgWjPK8ektLmUDbbr0msnCdD9hMztj9xXPshS8oZrp 0sRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=j7qR9yqNDNgMAK6ctuMsq9/VfPHGZ+G+mDVKNGy5zVg=; b=eHm35/FjMebNUutYAedDlI2k7o7pf0UXeNnnhtjI1ulEfJdg5j203mFvZWHGbZL/Gz 4hSSH3p8DTfmvOUwidxNaK8es48kjg3i7MVi05QbrNdMXdzVCMKseML2oaxCfJ72VhMl tHuBEWo/bByRVKLBoJq86ATUbaXxAIEtTCi+g0Tz4PrZGpDH1MHOlO1qo8VxUGXMiZ/z RNC9BBZyLWvM28/vqbHd6aE+uyJH0PSQ56c1DfwGTFE2Ppl8ywZvafaiQkc0i2CzI9ap wPZrCy8NJI2/YT6UAmVvsyBR/GUl3tI887WfciFlTY5JND/hArgY2Ir7pirIvnMG2ZmC gcNw== X-Gm-Message-State: APt69E2193tlRIz5p2fVTLC5nfAYJfzQweEdynhk/QiZ0qmBYW1pkI5E 1cky0PXzNac9PHOrv7AnamWtJjYvRWc644ztvJ5Egw== X-Google-Smtp-Source: AAOMgpd3tQvamzroKDQ4BHxbI3CtqnCDtG9nitYP0Y/BGTmiQZW0BJ3VW58tQnjL2rZxngAm6Zatxx4TdmLGTsrmgKQ= X-Received: by 2002:a02:2acc:: with SMTP id w195-v6mr10673696jaw.67.1530240891850; Thu, 28 Jun 2018 19:54:51 -0700 (PDT) Original-Received: by 2002:a6b:c305:0:0:0:0:0 with HTTP; Thu, 28 Jun 2018 19:54:51 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4001:c0b::22c X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:226828 Archived-At: --000000000000c79a36056fbef867 Content-Type: text/plain; charset="UTF-8" How does Emacs choose which glyph to use (i.e. from which font to pick the glyph from) in case the required character is missing from the user's chosen font? I have noticed that if I use Source Code Pro and insert some greek characters into the buffer, it picks those characters from the font Noto Sans Display instead. I have a need to do the same thing (I've been implementing a new font renderer for McCLIM) and since Emacs does such a good job with it, I wanted to see how Emacs does it, but I have been unable to find the code where this substitution happens. Does anyone know where in the Emacs code base this happens, and what the algorithm is? Regards, Elias --000000000000c79a36056fbef867 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
How does Emacs choose which glyph to use (i.e. from which = font to pick the glyph from) in case the required character is missing from= the user's chosen font?

I have noticed that if I us= e Source Code Pro and insert some greek characters into the buffer, it pick= s those characters from the font Noto Sans Display instead.

<= /div>
I have a need to do the same thing (I've been implementing a = new font renderer for McCLIM) and since Emacs does such a good job with it,= I wanted to see how Emacs does it, but I have been unable to find the code= where this substitution happens.

Does anyone know= where in the Emacs code base this happens, and what the algorithm is?

Regards,
Elias
--000000000000c79a36056fbef867--