🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #260697

[Fonts] Checking glyph population (was: [Dialog] Unicode capabilities)

#260697
From: Michael Bäuerle
Date: Thu, 14 Jul 2016 13:46
100 lines
7048 bytes
Michael Bäuerle wrote:
> tlvp wrote:
> > 
> > [...]
> > Thanks for that, especially your suggestion to run finenews on Windows with
> > Cygwin. I may have to try that, if using the dejavu fonts (as David Sparks
> > had suggested) doesn't pan out.
> 
> Notes for DejaVu:
> 
> The changelog [1] lists that a glyph for U+1E9E was added to version
> 2.28 in 2008, but only for Sans and Serif (not Mono that is normally
> used for USENET article bodies):
> 
> My NetBSD system uses version 2.35:
> | 
> | # pkg_info | grep DejaVu
> | dejavu-ttf-2.35     DejaVu family of TrueType fonts
> 
> and is (without glyph substitution) not able to display U+1E9E with
> DejaVu Sans Mono.

Trying to confirm that using fontconfig seems to be a PITA:
| 
| $ fc-list -v 'DejaVu Sans Mono:style=Book' 'charset'
| Pattern has 1 elts (size 16)
|         charset: 
|         0000: 00000000 ffffffff ffffffff 7fffffff 00000000 ffffffff ffffffff ffffffff
|         0001: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffe00f f371ffcf
|         0002: ffffffff fffffff3 ffff303b ffffffff ffffffff fbffffff 7fcff3c3 000843ff
|         0003: ffffffff ffffffff 01000008 44300002 ffffd7f0 fffffffb ffff7fff ffff0003
|         0004: ffffffff ffffffff ffffffff 000c000c 0fff0000 0c0ffc3c ffff999f 03ffffff
|         0005: 3c030000 fffe0000 fe7fffff fffffffe 000006ff 00000000 00000000 00000000
|         0006: 882016c0 07fffffe 043fffff ce103fff 010200d9 40008210 00001000 03ff0000
|         000e: 00000000 80000000 00000000 00000000 fef02596 1bffecae 00003f00 00000000
|         0010: 00000000 00000000 00000000 00000000 00000000 00000000 ffff0000 1fffffff
|         001d: e0d00304 dfff7000 0fffffff 0980003c f8000020 feffffff 00000000 00000000
|         001e: ff0fffff ffff3fff fff03fff f3ffff0f 8bffffff 33c33003 3f003cc0 033fcf3f
|         001f: 3f3fffff ffffffff aaff3f3f 3fffffff ffffffff ffdfffff efcfffdf 7fdcffff
|         0020: ffff07ff f6ff804f 80000be0 fff30000 1fff7fff 033fffff 00000000 00000000
|         0021: 26e0e024 00004c54 fffb0100 00000000 ffff0200 ffffffff ffffffff ffffffff
|         0022: ffafffff 3ff03f89 fffffffe ffffe3ff ffffefff 013c003f fc03e07c 000083ff
|         0023: f33fff7f ffe009e3 ffffffff 27ffffff f8200f0f 00007fff 0000c000 00000000
|         0024: 00000000 00000008 00000000 00000000 00000000 00000000 00000000 00000000
|         0025: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
|         0026: ffffffff ff00ffff ffffffff ffffffff 1fff0fff 00030003 00000000 00000000
|         0027: fffff3de fffffeff 7f47afff 003ffffe ff100000 7ffeffff 10000064 00e00fc1
|         0029: 00000000 00000000 00000000 00000000 01800180 00000000 00000000 0c000800
|         002a: 00000001 00008000 00000000 00000c00 00000000 00000000 00000000 00000000
|         002b: 07fc3fe0 00000000 00000000 00000000 00000000 00000000 00000000 00000000
|         002c: 00000000 00000000 00000000 f6e1e010 00000000 00000000 00000000 00000000
|         002e: 81000000 0000403c 00000000 00000000 00000000 00000000 00000000 00000000
|         00a7: f87fff00 000000fc 00000000 00000000 00037e00 00000400 00000000 03000000
|         00f6: 00000000 00000000 00000000 00000000 00000000 00000000 00000020 00000000
|         00fb: 00000006 00000000 fffc0000 ffffffff c03ffc03 00003c00 00000000 f0000300
|         00fe: 00000000 00000000 00000000 ffdf0000 ffffffff ffffffff ffffffff 9fffffff
|         00ff: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 2e000000
|         01d5: 00000000 00000000 04000000 00000000 00000000 00000000 00000000 00000000
|         01d6: 00000000 00000000 00000000 ffff0000 ffffffff 0000000f 00000000 00000000
|         01d7: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 ffc00000
| (s)

Every line contains bitmaps for 256 glyphs. In the first line C0 and C1
control characters are visible as zeros in blocks 1 and 5 (no glyphs for
obvious reason)
=> The 8 blocks are assigned from left to right.
The zero for the DEL control character in block 4 is on the left
=> The blocks are normal hex numbers with most significant bit left.

This means U+1E9E should be located in the line marked with "001e":
| 
| $ fc-list -v 'DejaVu Sans Mono:style=Book' 'charset' | grep "001e:"
|         001e: ff0fffff ffff3fff fff03fff f3ffff0f 8bffffff 33c33003 3f003cc0 033fcf3f
                       ^        ^        ^        ^        ^        ^        ^        ^
                    0x00     0x20     0x40     0x60     0x80     0xA0     0xC0     0xE0
                                                    ^^^^^^^^
Index 0x9E should be in the fifth block starting at 0x80.

The bit (for U+1E9E) in this block therefore should be:
| 
| $ printf "%08X\n" $((1 << 0x9E-0x80))
| 40000000

And this bit is zero (no glyph) in the map above:

  8bffffff

Checking again for the proportional sans serif version:
| 
| $ fc-list -v 'DejaVu Sans:style=Book' 'charset' | grep "001e:"
|         001e: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff 0fffffff
                                                    ^
Bit is set (glyph present).


Does somebody know an easier option to check for glyph presence in a
font?

> _____________________
> [1] <http://dejavu-fonts.org/wiki/Full_changelog>
Technical Details
Message-ID: <AABXh5efK8EAABXd.A1.flnews@WStation5.stz-e.de>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.(126883).mbox.7z!not-for-mail
References: <nli1e8$hi6$1@news.mixmin.net> <AABXfqRQKo8AAEas.A1.flnews@WStation4.micha.freeshell.org> <nlmes8$oo3$2@news.albasani.net> <AABXf2MrD54AAAfO.A1.flnews@WStation5.stz-e.de> <nlobd6$eij$1@news.albasani.net> <AABXf8FmZmAAADMv.A1.flnews@WStation5.stz-e.de> <nlu497$e1t$1@justacineast.motzarella.org> <AABXg26LHmoAAA80.A1.flnews@WStation5.stz-e.de> <8rvhm2iwm3r5$.1rx0y710bzqpv$.dlg@40tude.net> <AABXhLSbLEAAABYb.A1.flnews@WStation5.stz-e.de> <1ldazkv3snk57.1esf7pd9mb399$.dlg@40tude.net> <AABXhhOzaT0AAAdg.A1.flnews@WStation5.stz-e.de> <159hdy6c7ud30.ayfl7s1oi3gc.dlg@40tude.net> <AABXh15wK74AABXd.A1.flnews@WStation5.stz-e.de>

Show Full Headers
Complete Article Headers
Message-ID: <AABXh5efK8EAABXd.A1.flnews@WStation5.stz-e.de>
Subject: [Fonts] Checking glyph population (was: [Dialog] Unicode capabilities)
Date: Thu, 14 Jul 2016 15:46:07 +0200
From: Michael Bäuerle <michael.baeuerle@stz-e.de>
References: <nli1e8$hi6$1@news.mixmin.net> <AABXfqRQKo8AAEas.A1.flnews@WStation4.micha.freeshell.org> <nlmes8$oo3$2@news.albasani.net> <AABXf2MrD54AAAfO.A1.flnews@WStation5.stz-e.de> <nlobd6$eij$1@news.albasani.net> <AABXf8FmZmAAADMv.A1.flnews@WStation5.stz-e.de> <nlu497$e1t$1@justacineast.motzarella.org> <AABXg26LHmoAAA80.A1.flnews@WStation5.stz-e.de> <8rvhm2iwm3r5$.1rx0y710bzqpv$.dlg@40tude.net> <AABXhLSbLEAAABYb.A1.flnews@WStation5.stz-e.de> <1ldazkv3snk57.1esf7pd9mb399$.dlg@40tude.net> <AABXhhOzaT0AAAdg.A1.flnews@WStation5.stz-e.de> <159hdy6c7ud30.ayfl7s1oi3gc.dlg@40tude.net> <AABXh15wK74AABXd.A1.flnews@WStation5.stz-e.de>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.(126883).mbox.7z!not-for-mail
Newsgroups: news.software.readers
Lines: 100
Reply-To: Michael Bäuerle <michael.baeuerle@gmx.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=fixed
Content-Transfer-Encoding: 8bit
X-Trace: individual.net 9oe91Xq/Ux2+1ECw6Fcs3Ar20DfCW17qiPtOx3KneBsB0LNiHE
X-Orig-Path: not-for-mail
Cancel-Lock: sha1:V/Ts5qgPNkR2GpI7SYXNUKROJrI= sha1:IsplxMeQvJvgYTFrpjDadjsT2Uo=
Injection-Date: Thu, 14 Jul 2016 13:46:07 -0000
User-Agent: flnews/0.14pre44 (for NetBSD)
X-Received-Body-CRC: 1171402416
X-Received-Bytes: 6903