All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Alejandro Colomar <alx@kernel.org>
To: Brian Inglis <Brian.Inglis@shaw.ca>
Cc: "G. Branden Robinson" <g.branden.robinson@gmail.com>,
	linux-man@vger.kernel.org, groff@gnu.org,
	"G. Branden Robinson" <branden@debian.org>,
	Deri James <deri@chuzzlewit.myzen.co.uk>
Subject: Re: Problems building the unifont PFA and DIT files for the PDF book
Date: Sun, 21 Apr 2024 00:32:59 +0200	[thread overview]
Message-ID: <ZiRCm1-6N-41Sjyl@debian> (raw)
In-Reply-To: <a55df048-f04c-4faa-aba9-a5be7e81543b@Shaw.ca>

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

Hi Brian,

On Sat, Apr 20, 2024 at 02:11:55PM -0600, Brian Inglis wrote:
> On 2024-04-20 09:52, G. Branden Robinson wrote:
> > At 2024-04-20T14:26:17+0200, Alejandro Colomar wrote:
> > > First problem:
> > > 
> > > In the Unifont, I don't see a "Regular" font.  I assumed I should take
> > > the unifont.otf file.
> 
> Hi folks,
> 
> That's the BMP ~63.5k characters ~57k glyphs; unifont_upper are the SMP
> ~57.5k glyphs with specialized scripts and extended graphics like emojis:
> unlikely to be required for any LGC man pages.
> 
> 		https://unifoundry.com/unifont/index.html

Thanks!

> > Since (I believe I saw you say that) you're using GNU Unifont only to
> > patch up missing code point coverage from other fonts, in your
> > application it probably makes sense to specify it as a "special" font.
> > 

[...]

> OpenType fonts are normally designed with an 1000 units/em, and Truetype may
> be 1024 or 2048 units/em, so should use 333 or maybe 300 if you prefer a
> tighter look, close to your suggestion.
> 
> $ ttfdump /usr/share/fonts/urw-base35/NimbusRoman-Regular.otf | awk "/'head'/,/^$/"
>    6. 'head' - checksum = 0x0cdb53f2, offset = 0x00016f4c, len =        54
>    7. 'hhea' - checksum = 0x06b6057b, offset = 0x00016f84, len =        36
>    8. 'hmtx' - checksum = 0x35d9ae6c, offset = 0x00016fa8, len =      3420
>    9. 'maxp' - checksum = 0x03575000, offset = 0x00017d04, len =         6
>   10. 'name' - checksum = 0x8993f63c, offset = 0x00017d0c, len =       620
>   11. 'post' - checksum = 0xffb10032, offset = 0x00017f78, len =        32
> 
> 'head' Table - Font Header
> --------------------------
>          'head' version:         1.0
>          fontReversion:          1.0
>          checkSumAdjustment:     0x69d6e98e
>          magicNumber:            0x5f0f3cf5
>          flags:                  0x0003
>          unitsPerEm:             1000
>          created:                0x00000000d5420807
>          modified:               0x00000000d5420807
>          xMin:                   -168
>          yMin:                   -281
>          xMax:                   1000
>          yMax:                   1053
>          macStyle bits:          0x0000
>          lowestRecPPEM:          3
>          fontDirectionHint:      2
>          indexToLocFormat:       0
>          glyphDataFormat:        0
> 
> For comparison Tinos ttf substitute for Times Roman:
> 
> $ ttfdump /usr/share/fonts/tinos/Tinos-Regular.ttf | awk "/'head'/,/^$/"
>   12. 'head' - checksum = 0x0bd978fc, offset = 0x0000015c, len =        54
>   13. 'hhea' - checksum = 0x19811ca6, offset = 0x00000194, len =        36
>   14. 'hmtx' - checksum = 0xa4bce0e7, offset = 0x00000238, len =     13116
>   15. 'kern' - checksum = 0xa39da9f5, offset = 0x0008d6f8, len =      5220
>   16. 'loca' - checksum = 0x28e2bf88, offset = 0x0001a45c, len =     13120
>   17. 'maxp' - checksum = 0x10d405bc, offset = 0x000001b8, len =        32
>   18. 'name' - checksum = 0xc3ff0ad5, offset = 0x0008eb5c, len =      2052
>   19. 'post' - checksum = 0xe841b7c5, offset = 0x0008f360, len =     34664
>   20. 'prep' - checksum = 0xbd48485c, offset = 0x00019b40, len =      1550
> 
> 'head' Table - Font Header
> --------------------------
>          'head' version:         1.0
>          fontReversion:          1.20736
>          checkSumAdjustment:     0x84b246c2
>          magicNumber:            0x5f0f3cf5
>          flags:                  0x001b
>          unitsPerEm:             2048
>          created:                0x00000000c844d0ce
>          modified:               0x00000000d25f0c4c
>          xMin:                   -1114
>          yMin:                   -797
>          xMax:                   5728
>          yMax:                   2068
>          macStyle bits:          0x0000
>          lowestRecPPEM:          9
>          fontDirectionHint:      2
>          indexToLocFormat:       1
>          glyphDataFormat:        0
> 
> > [1] I do observe that the URW font descriptions shipped by groff include
> >      a special character called "space".  Syntactically, this would be
> >      accessed within a groff document via a special character escape
> >      sequence: `\[space]`.  I've never seen a document do this.  I admit
> >      that I don't have any idea why this is present or what its semantics
> >      are: I need a PostScript or PDF expert to tell me.[2]  It does occur
> >      to me that we might enhance afmtodit make of use of it as the
> >      default "spacewidth".
> > 
> > [2] Or I can self-help; I have copies of the _PostScript Language
> >      Reference Manual_ (3rd ed.) and a version of ISO 32000 lying around.
> 
> But Unifont uses 64 units/em, so 20-21?

Thanks!!!

I've tried to build the Chinese man-pages book for shadow, but I still
don't get Chinese letters, so I wasn't able to test this value, but I'll
try debugging it in the following days.

Anyway, I've applied this value in a commit that I'll push tomorrow to
the Linux man-pages' master branch.

Have a lovely night!
Alex

-- 
<https://www.alejandro-colomar.es/>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2024-04-20 22:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-20 12:26 Problems building the unifont PFA and DIT files for the PDF book Alejandro Colomar
2024-04-20 15:52 ` G. Branden Robinson
2024-04-20 20:11   ` Brian Inglis
2024-04-20 22:32     ` Alejandro Colomar [this message]
2024-04-20 22:20   ` Alejandro Colomar
     [not found] ` <2272286.muIFQpQJ8V@pip>
2024-04-21 20:08   ` Alejandro Colomar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZiRCm1-6N-41Sjyl@debian \
    --to=alx@kernel.org \
    --cc=Brian.Inglis@shaw.ca \
    --cc=branden@debian.org \
    --cc=deri@chuzzlewit.myzen.co.uk \
    --cc=g.branden.robinson@gmail.com \
    --cc=groff@gnu.org \
    --cc=linux-man@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.