Re: Lout typesetting questions

William Bader <[email protected]> Mon, 10 Nov 2025 20:38:48 +0000
Newsgroups gmane.comp.type-setting.lout
Message-ID <PA3P190MB24387361A0E405D050144EE1C4CEA@PA3P190MB2438.EURP190.PROD.OUTLOOK.COM>
--_000_PA3P190MB24387361A0E405D050144EE1C4CEAPA3P190MB2438EURP_
Content-Type: text/plain; charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

> it's Unicode support and TTF/OTF support

I think that lout doesn't need to understand fonts. It just needs an AFM an=
d a reference to one of the LCM files in the maps directory with the encodi=
ng.
For other applications, I have made AFMs with ttf2pt1 ( I have a clone at h=
ttps://github.com/william8000/ttf2pt1 ), which can make a postscript Type 1=
 font from ttf and otf using the FreeType library and then the ghostscript =
printafm script, which can generate an AFM from Type 1 fonts.
I haven't tried it, but probably lout could use other font types with the p=
roper configuration files without needing any C coding changes.

Lout holds characters in a FULL_CHAR type that is currently an unsigned cha=
r.
If someone wants to try it, it might be possible to change it to unsigned i=
nt for Unicode, although the tables of character widths might need a redesi=
gn not to need allocation to 2^16 items per font.
externs.h has the comment below.

/*  typedef FULL_CHAR - one of the characters manipulated by Lout.         =
  */
/*                                                                         =
  */
/*  This program does not deal with 7-bit ASCII characters.  Instead, its  =
  */
/*  characters are defined by the FULL_CHAR typedef, and could be anything =
  */
/*  from 7-bit ASCII to 8-bit ISO-LATIN-1 to 16-bit UNICODE and beyond.    =
  */
/*                                                                         =
  */
/*  Unfortunately C favours signed 8-bit characters: literal strings are   =
  */
/*  pointers to them, argv[] and the standard libraries assume them.  We ge=
t */
/*  around these problems by using our own library, including AsciiToFull()=
  */
/*  to convert an ASCII string (such as a C string) into a FULL_CHAR string=
. */
/*                                                                         =
  */
/*  Formally this library appears in module z39.c; however since this      =
  */
/*  implementation uses 8-bit unsigned characters, most of the routines    =
  */
/*  can be implemented by macros containing type-cast calls to C standard  =
  */
/*  library routines.  These appear in the z39.c externs list below.       =
  */

typedef unsigned char FULL_CHAR;


________________________________
From: [email protected] <lout-users-=
[email protected]> on behalf of Mark Summerfiel=
d <[email protected]>
Sent: Monday, November 10, 2025 2:34 AM
To: [email protected] <[email protected]>
Subject: Re: Lout typesetting questions

On Sun, 9 Nov 2025 17:29:45 +0300
Valery Ushakov <[email protected]> wrote:
> On Sun, Nov 09, 2025 at 12:22:18 +0100, Basile Starynkevitch wrote:
[snip]
> If any useful new development is to happen for Lout, it's Unicode
> support and TTF/OTF support that are, IMHO, a priority.

I too believe that those two things would be the most important things
that could be done to keep lout useful. (Third on my list would be
greatly improved indexing support.)

--
Mark =97 https://mark-summerfield.github.io


--_000_PA3P190MB24387361A0E405D050144EE1C4CEAPA3P190MB2438EURP_
Content-Type: text/html; charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3DWindows-1=
252">
<style type=3D"text/css" style=3D"display:none;"> P {margin-top:0;margin-bo=
ttom:0;} </style>
</head>
<body dir=3D"ltr">
<div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;=
 color: rgb(0, 0, 0);" class=3D"elementToProof">
&gt; it's Unicode support and TTF/OTF support<br>
<br>
I think that lout doesn't need to understand fonts. It just needs an AFM an=
d a reference to one of the LCM files in the maps directory with the encodi=
ng.</div>
<div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;=
 color: rgb(0, 0, 0);" class=3D"elementToProof">
For other applications, I have made AFMs with ttf2pt1 ( I have a clone at <=
a href=3D"https://github.com/william8000/ttf2pt1">
https://github.com/william8000/ttf2pt1</a>&nbsp;), which can make a postscr=
ipt Type 1 font from ttf and otf using the FreeType library and then the gh=
ostscript printafm script, which can generate an AFM from Type 1 fonts.<br>
I haven't tried it, but probably lout could use other font types with the p=
roper configuration files without needing any C coding changes.</div>
<div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;=
 color: rgb(0, 0, 0);" class=3D"elementToProof">
<br>
Lout holds characters in a FULL_CHAR type that is currently an unsigned cha=
r.<br>
If someone wants to try it, it might be possible to change it to unsigned i=
nt for Unicode, although the tables of character widths might need a redesi=
gn not to need allocation to 2^16 items per font.</div>
<div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;=
 color: rgb(0, 0, 0);" class=3D"elementToProof">
externs.h has the comment below.</div>
<div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;=
 color: rgb(0, 0, 0);" class=3D"elementToProof">
<br>
</div>
<div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;=
 color: rgb(0, 0, 0);" class=3D"elementToProof">
/* &nbsp;typedef FULL_CHAR - one of the characters manipulated by Lout. &nb=
sp; &nbsp; &nbsp; &nbsp; &nbsp; */</div>
<div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;=
 color: rgb(0, 0, 0);" class=3D"elementToProof">
/* &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &n=
bsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; */</div>
<div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;=
 color: rgb(0, 0, 0);" class=3D"elementToProof">
/* &nbsp;This program does not deal with 7-bit ASCII characters. &nbsp;Inst=
ead, its &nbsp; &nbsp;*/</div>
<div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;=
 color: rgb(0, 0, 0);" class=3D"elementToProof">
/* &nbsp;characters are defined by the FULL_CHAR typedef, and could be anyt=
hing &nbsp; */</div>
<div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;=
 color: rgb(0, 0, 0);" class=3D"elementToProof">
/* &nbsp;from 7-bit ASCII to 8-bit ISO-LATIN-1 to 16-bit UNICODE and beyond=
. &nbsp; &nbsp; &nbsp;*/</div>
<div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;=
 color: rgb(0, 0, 0);" class=3D"elementToProof">
/* &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &n=
bsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; */</div>
<div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;=
 color: rgb(0, 0, 0);" class=3D"elementToProof">
/* &nbsp;Unfortunately C favours signed 8-bit characters: literal strings a=
re &nbsp; &nbsp; */</div>
<div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;=
 color: rgb(0, 0, 0);" class=3D"elementToProof">
/* &nbsp;pointers to them, argv[] and the standard libraries assume them. &=
nbsp;We get */</div>
<div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;=
 color: rgb(0, 0, 0);" class=3D"elementToProof">
/* &nbsp;around these problems by using our own library, including AsciiToF=
ull() &nbsp;*/</div>
<div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;=
 color: rgb(0, 0, 0);" class=3D"elementToProof">
/* &nbsp;to convert an ASCII string (such as a C string) into a FULL_CHAR s=
tring. */</div>
<div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;=
 color: rgb(0, 0, 0);" class=3D"elementToProof">
/* &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &n=
bsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; */</div>
<div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;=
 color: rgb(0, 0, 0);" class=3D"elementToProof">
/* &nbsp;Formally this library appears in module z39.c; however since this =
&nbsp; &nbsp; &nbsp; &nbsp;*/</div>
<div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;=
 color: rgb(0, 0, 0);" class=3D"elementToProof">
/* &nbsp;implementation uses 8-bit unsigned characters, most of the routine=
s &nbsp; &nbsp; &nbsp;*/</div>
<div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;=
 color: rgb(0, 0, 0);" class=3D"elementToProof">
/* &nbsp;can be implemented by macros containing type-cast calls to C stand=
ard &nbsp; &nbsp;*/</div>
<div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;=
 color: rgb(0, 0, 0);" class=3D"elementToProof">
/* &nbsp;library routines. &nbsp;These appear in the z39.c externs list bel=
ow. &nbsp; &nbsp; &nbsp; &nbsp; */ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;=
</div>
<div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;=
 color: rgb(0, 0, 0);" class=3D"elementToProof">
<br>
</div>
<div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;=
 color: rgb(0, 0, 0);" class=3D"elementToProof">
typedef unsigned char FULL_CHAR;<br>
<br>
</div>
<div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;=
 color: rgb(0, 0, 0);" class=3D"elementToProof">
<br>
</div>
<hr style=3D"display: inline-block; width: 98%;">
<div id=3D"divRplyFwdMsg">
<div style=3D"direction: ltr; font-family: Calibri, sans-serif; font-size: =
11pt; color: rgb(0, 0, 0);">
<b>From:</b>&nbsp;[email protected] =
&lt;[email protected]&gt; on behalf =
of Mark Summerfield &lt;[email protected]&gt;<br>
<b>Sent:</b>&nbsp;Monday, November 10, 2025 2:34 AM<br>
<b>To:</b>&nbsp;[email protected] &lt;[email protected]&gt;<br>
<b>Subject:</b>&nbsp;Re: Lout typesetting questions</div>
<div style=3D"direction: ltr;">&nbsp;</div>
</div>
<div style=3D"font-size: 11pt;" class=3D"elementToProof">On Sun, 9 Nov 2025=
 17:29:45 +0300<br>
Valery Ushakov &lt;[email protected]&gt; wrote:<br>
&gt; On Sun, Nov 09, 2025 at 12:22:18 +0100, Basile Starynkevitch wrote:<br=
>
[snip]<br>
&gt; If any useful new development is to happen for Lout, it's Unicode<br>
&gt; support and TTF/OTF support that are, IMHO, a priority.<br>
<br>
I too believe that those two things would be the most important things<br>
that could be done to keep lout useful. (Third on my list would be<br>
greatly improved indexing support.)<br>
<br>
--<br>
Mark =97 <a data-auth=3D"NotApplicable" class=3D"OWAAutoLink" id=3D"OWA881e=
1c4d-a113-2b07-82cb-1c1369082955" href=3D"https://mark-summerfield.github.i=
o">
https://mark-summerfield.github.io</a><br>
<br>
</div>
</body>
</html>

--_000_PA3P190MB24387361A0E405D050144EE1C4CEAPA3P190MB2438EURP_--