unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* How Firefox shows characters missing in font
@ 2009-07-04 12:42 Lennart Borgman
  2009-07-04 14:21 ` David De La Harpe Golden
  2009-07-04 16:55 ` Jason Rumney
  0 siblings, 2 replies; 9+ messages in thread
From: Lennart Borgman @ 2009-07-04 12:42 UTC (permalink / raw)
  To: Emacs-Devel devel

[-- Attachment #1: Type: text/plain, Size: 151 bytes --]

We discussed how to show characters missing in a font a while ago.
Here is an example of how Firefox handles it. It shows four hex digits
in a square.

[-- Attachment #2: firefox-font-missing.png --]
[-- Type: image/png, Size: 20330 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: How Firefox shows characters missing in font
  2009-07-04 12:42 How Firefox shows characters missing in font Lennart Borgman
@ 2009-07-04 14:21 ` David De La Harpe Golden
  2009-07-04 16:55 ` Jason Rumney
  1 sibling, 0 replies; 9+ messages in thread
From: David De La Harpe Golden @ 2009-07-04 14:21 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: Emacs-Devel devel

Lennart Borgman wrote:
> We discussed how to show characters missing in a font a while ago.
> Here is an example of how Firefox handles it. It shows four hex digits
> in a square.
>


Note that the SIL Unicode BMP fallback font (consisting of a bunch of 
squares with numbers in) is AFAIK free. The apple one with an icon per 
script is gratis, but I dunno about its license.

http://scripts.sil.org/CMS/scripts/page.php?site_id=nrsi&item_id=UnicodeBMPFallbackFont
http://www.unicode.org/policies/lastresortfont_eula.html
http://en.wikipedia.org/wiki/Fallback_fon

Trouble is, if you install the SIL fallback font as an ordinary font,
it seems to sometimes "win" in emacs (and possibly elsewhere) when
it shouldn't. And of course emacs doesn't _know_ it's a fallback.
If fallback fonts are supported, they'd need to be special cased in the 
emacs code or OS code or both, and emacs IMO would best expose that some 
glyphs are supplied are known fallbacks, not real glyphs. i.e.  C-u C-x 
= 's "display:" should  say "no font available, using fallback font 
(glyph code) ...", not "by this font (glyph code) ..." without 
indicating it was a fallback choice.

I guess on MacOSX specifically the LastResort font is already 
special-cased if you use native apis, but I have no idea what emacs on 
ns makes of it.

Fallback fonts are of course only one approach to achieve the effect 
(with the advantage users who prefer a per-script style could use drop 
in a font with the per-script style of fallback glyph instead of the 
numbers-in-boxes style as they saw fit) - alternatively, the hex values 
could be drawn into the boxes at the emacs or toolkit level like the 
boxes currently are, I think firefox uses that approach rather than  a 
fallback font.

Actually, emacs could of course allow options where it (a) draws empty 
boxes as current, (b) draws in hex digits itself, or (c) allows use of a 
user-defined/system-supplied special fallback font, of course. Someone 
"just" needs to write the code to do all that...






















^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: How Firefox shows characters missing in font
  2009-07-04 12:42 How Firefox shows characters missing in font Lennart Borgman
  2009-07-04 14:21 ` David De La Harpe Golden
@ 2009-07-04 16:55 ` Jason Rumney
  2009-07-04 17:04   ` Lennart Borgman
                     ` (2 more replies)
  1 sibling, 3 replies; 9+ messages in thread
From: Jason Rumney @ 2009-07-04 16:55 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: Emacs-Devel devel

Lennart Borgman wrote:
> We discussed how to show characters missing in a font a while ago.
> Here is an example of how Firefox handles it. It shows four hex digits
> in a square.
>   
What does it do when it needs six hex digits? It doesn't look like there 
is room for any more in there.






^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: How Firefox shows characters missing in font
  2009-07-04 16:55 ` Jason Rumney
@ 2009-07-04 17:04   ` Lennart Borgman
  2009-07-04 19:30     ` David De La Harpe Golden
  2009-07-04 21:37   ` James Cloos
  2009-07-05 10:18   ` Richard Stallman
  2 siblings, 1 reply; 9+ messages in thread
From: Lennart Borgman @ 2009-07-04 17:04 UTC (permalink / raw)
  To: Jason Rumney; +Cc: Emacs-Devel devel

On Sat, Jul 4, 2009 at 6:55 PM, Jason Rumney<jasonr@gnu.org> wrote:
> Lennart Borgman wrote:
>>
>> We discussed how to show characters missing in a font a while ago.
>> Here is an example of how Firefox handles it. It shows four hex digits
>> in a square.
>>
>
> What does it do when it needs six hex digits? It doesn't look like there is
> room for any more in there.

It doesn't do anything. I includes only BMP (with private area) which
if I understand it correctly only is 0000 - ffff.

But I know nothing about this. Which other pars are most important? On
wikipedia I see they divide it in 8 ranges (with one big unassigned
range). It looks like this could perhaps be handled in some way by for
example colors.




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: How Firefox shows characters missing in font
  2009-07-04 17:04   ` Lennart Borgman
@ 2009-07-04 19:30     ` David De La Harpe Golden
  2009-07-04 19:35       ` Lennart Borgman
  0 siblings, 1 reply; 9+ messages in thread
From: David De La Harpe Golden @ 2009-07-04 19:30 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: Emacs-Devel devel, Jason Rumney

[-- Attachment #1: Type: text/plain, Size: 1298 bytes --]


> It doesn't do anything. I includes only BMP (with private area) which
> if I understand it correctly only is 0000 - ffff.
> 

the sil font in particular, yeah.

> But I know nothing about this. Which other pars are most important? On
> wikipedia I see they divide it in 8 ranges (with one big unassigned
> range). It looks like this could perhaps be handled in some way by for
> example colors.
> 

Shrug, or just use six hexdigits when there's room (only try for 6 for 
for chars outside the BMP, users can guess that if there's only 4, it's 
from the BMP, and for that matter perhaps if there's only 2 it's from 
the 8-bit range...)

   You only need 3x5 pixels for quite legible hex, and IMO you can kinda 
make out stylised 3x4 too, at least in context.  Subpixel rendering 
might help in some cases.  And anyway, anyone really interested can ask 
emacs to describe the character, hex helps show
there are missing glyphs and that they're distinct - a row of
empty boxes could just be some missing line drawing glyphs, a row
of distinct hex-filled boxes is probably foreign script.

Cramming in 6 hex digits as 2x3 will be possible in a lot of cases on 
modern displays I reckon - anyone using a font size working out bigger 
than 10x20 pixels or so (as attached for 3x4 stylised hexdigits).

[-- Attachment #2: 3x4eg.png --]
[-- Type: image/png, Size: 1200 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: How Firefox shows characters missing in font
  2009-07-04 19:30     ` David De La Harpe Golden
@ 2009-07-04 19:35       ` Lennart Borgman
  2009-07-04 19:52         ` David De La Harpe Golden
  0 siblings, 1 reply; 9+ messages in thread
From: Lennart Borgman @ 2009-07-04 19:35 UTC (permalink / raw)
  To: David De La Harpe Golden; +Cc: Emacs-Devel devel, Jason Rumney

On Sat, Jul 4, 2009 at 9:30 PM, David De La Harpe
Golden<david@harpegolden.net> wrote:
>
>> It doesn't do anything. I includes only BMP (with private area) which
>> if I understand it correctly only is 0000 - ffff.
>>
>
> the sil font in particular, yeah.
>
>> But I know nothing about this. Which other pars are most important? On
>> wikipedia I see they divide it in 8 ranges (with one big unassigned
>> range). It looks like this could perhaps be handled in some way by for
>> example colors.
>>
>
> Shrug, or just use six hexdigits when there's room (only try for 6 for for
> chars outside the BMP, users can guess that if there's only 4, it's from the
> BMP, and for that matter perhaps if there's only 2 it's from the 8-bit
> range...)
>
>  You only need 3x5 pixels for quite legible hex, and IMO you can kinda make
> out stylised 3x4 too, at least in context.  Subpixel rendering might help in
> some cases.  And anyway, anyone really interested can ask emacs to describe
> the character, hex helps show
> there are missing glyphs and that they're distinct - a row of
> empty boxes could just be some missing line drawing glyphs, a row
> of distinct hex-filled boxes is probably foreign script.
>
> Cramming in 6 hex digits as 2x3 will be possible in a lot of cases on modern
> displays I reckon - anyone using a font size working out bigger than 10x20
> pixels or so (as attached for 3x4 stylised hexdigits).


Would not that be much more work when using the existing "SIL Unicode
BMP Fallback Font"?




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: How Firefox shows characters missing in font
  2009-07-04 19:35       ` Lennart Borgman
@ 2009-07-04 19:52         ` David De La Harpe Golden
  0 siblings, 0 replies; 9+ messages in thread
From: David De La Harpe Golden @ 2009-07-04 19:52 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: Emacs-Devel devel, Jason Rumney

Lennart Borgman wrote:

> Would not that be much more work when using the existing "SIL Unicode
> BMP Fallback Font"?

Well, that depends.  I was thinking of the "emacs draws the hexdigits in 
the boxes itself" case - Only need to come up with 16 tiny glyphs a few 
times, once you go beyond 6x8 or maybe 8x10 of pixel space available per 
hexdigit it probably makes some sense to just use an ordinary font 
rendering call for each hexdigit, and below 3x4 you really only could 
put in vague indicative dots/blobs anyway.

Mind you, I guess using the SIL Unicode BMP fallback font gives you 
subpixel rendering of the hexdigits for free.  But of course it's only 
done for the BMP.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: How Firefox shows characters missing in font
  2009-07-04 16:55 ` Jason Rumney
  2009-07-04 17:04   ` Lennart Borgman
@ 2009-07-04 21:37   ` James Cloos
  2009-07-05 10:18   ` Richard Stallman
  2 siblings, 0 replies; 9+ messages in thread
From: James Cloos @ 2009-07-04 21:37 UTC (permalink / raw)
  To: Jason Rumney; +Cc: Lennart Borgman, Emacs-Devel devel

[-- Attachment #1: Type: text/plain, Size: 363 bytes --]

>>>>> "Jason" == Jason Rumney <jasonr@gnu.org> writes:

Jason> What does it do when it needs six hex digits? It doesn't
Jason> look like there is room for any more in there.

It isn't really zilla that does that, it is GTK.

I used pango-view to make this png by asking it for U+34567
via: pango-view --text='U+34567 is: »𴕧«' --output=U34567.png:


[-- Attachment #2: U34567.png --]
[-- Type: image/png, Size: 1810 bytes --]

[-- Attachment #3: Type: text/plain, Size: 207 bytes --]


As you can see, it uses 3×2, making a wider box.  The hex digits come
from the default font, whatever that is.

It GTK thinks the font is two small for two rows, it generates a glyph
using one row:


[-- Attachment #4: U34567_7.png --]
[-- Type: image/png, Size: 1161 bytes --]

[-- Attachment #5: Type: text/plain, Size: 75 bytes --]


-JimC
-- 
James Cloos <cloos@jhcloos.com>         OpenPGP: 1024D/ED7DAEA6

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: How Firefox shows characters missing in font
  2009-07-04 16:55 ` Jason Rumney
  2009-07-04 17:04   ` Lennart Borgman
  2009-07-04 21:37   ` James Cloos
@ 2009-07-05 10:18   ` Richard Stallman
  2 siblings, 0 replies; 9+ messages in thread
From: Richard Stallman @ 2009-07-05 10:18 UTC (permalink / raw)
  To: Jason Rumney; +Cc: lennart.borgman, emacs-devel

    What does it do when it needs six hex digits? It doesn't look like there 
    is room for any more in there.

Showing the lowest 4 hex digits is a lot more useful than showing
none.




^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-07-05 10:18 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-04 12:42 How Firefox shows characters missing in font Lennart Borgman
2009-07-04 14:21 ` David De La Harpe Golden
2009-07-04 16:55 ` Jason Rumney
2009-07-04 17:04   ` Lennart Borgman
2009-07-04 19:30     ` David De La Harpe Golden
2009-07-04 19:35       ` Lennart Borgman
2009-07-04 19:52         ` David De La Harpe Golden
2009-07-04 21:37   ` James Cloos
2009-07-05 10:18   ` Richard Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).