ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* startlines space width
@ 2005-09-17 23:37 Stuart Jansen
  2005-09-18  7:02 ` Taco Hoekwater
  0 siblings, 1 reply; 3+ messages in thread
From: Stuart Jansen @ 2005-09-17 23:37 UTC (permalink / raw)



[-- Attachment #1.1: Type: text/plain, Size: 726 bytes --]

I am having problems with startlines. I'm using space=yes to preserve
space characters. This works fine with default ConTeXt lm/cm font. When
I use a font I've imported, however, the spaces aren't quite wide
enough. I can fix that with \def\normalspace{\char32}, but then I have
problems with embedded floats. 

What do I need to fix so that the default \def\normalspace{ } has the
correct width for the current font?

Below is an example file that renders fine with lm/cm, but not my font.

%\usetypescript [gurulabs]
\starttext
\setuplines[space=yes]
\bgroup\tt\startlines
1 3 5 7 9  11  13  15
 2 4 6 8 10  12  14
\stoplines\egroup
\stoptext

-- 
Stuart Jansen <sjansen@gurulabs.com>
Guru Labs, L.C.

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 139 bytes --]

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

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

* Re: startlines space width
  2005-09-17 23:37 startlines space width Stuart Jansen
@ 2005-09-18  7:02 ` Taco Hoekwater
  2005-09-19  0:06   ` Stuart Jansen
  0 siblings, 1 reply; 3+ messages in thread
From: Taco Hoekwater @ 2005-09-18  7:02 UTC (permalink / raw)


Stuart Jansen wrote:
> I am having problems with startlines. I'm using space=yes to preserve
> space characters. This works fine with default ConTeXt lm/cm font. When
> I use a font I've imported, however, the spaces aren't quite wide
> enough. I can fix that with \def\normalspace{\char32}, but then I have
> problems with embedded floats. 

It sounds like perhaps you could have fixed this during the font
import by using afm2pl instead of afm2tfm (afm2tfm has hardwired
rules for the space factor, afm2pl has a switch that allows 
configuration by hand).

But even with afm2tfm, a correct monospace font should have the correct
value assigned. Perhaps the import process worth investigating?

> What do I need to fix so that the default \def\normalspace{ } has the
> correct width for the current font?

Assuming the font is monospace, you can try this:

   \def\normalspace{\hphantom{0}}

> Below is an example file that renders fine with lm/cm, but not my font.

Out of curiosity, which font is it?

Greetings,
Taco

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

* Re: startlines space width
  2005-09-18  7:02 ` Taco Hoekwater
@ 2005-09-19  0:06   ` Stuart Jansen
  0 siblings, 0 replies; 3+ messages in thread
From: Stuart Jansen @ 2005-09-19  0:06 UTC (permalink / raw)



[-- Attachment #1.1.1: Type: text/plain, Size: 1512 bytes --]

On Sun, 2005-09-18 at 09:02 +0200, Taco Hoekwater wrote:
> It sounds like perhaps you could have fixed this during the font
> import by using afm2pl instead of afm2tfm (afm2tfm has hardwired
> rules for the space factor, afm2pl has a switch that allows 
> configuration by hand).

This is actually a true type font, so there was never an afm file.
However, I do have a vpl which appears to be correct. Near the head, it
contains:

(FONTDIMEN
   (SLANT R 0.0)
   (SPACE R 0.48)
   (STRETCH R 0.0)
   (SHRINK R 0.0)
   (XHEIGHT R 0.4)
   (QUAD R 1.0)
   (EXTRASPACE R 0.48)
   )

All glphys are (CHARWD R 0.48)

> But even with afm2tfm, a correct monospace font should have the correct
> value assigned. Perhaps the import process worth investigating?

That is very possible. After trying several approaches, I finally
settled on writing my own importer. It 162 lines of very readable (I
like to think) Bash scripting. I have included a compressed version.

> > What do I need to fix so that the default \def\normalspace{ } has the
> > correct width for the current font?
> 
> Assuming the font is monospace, you can try this:
> 
>    \def\normalspace{\hphantom{0}}

I will give that a try.

> > Below is an example file that renders fine with lm/cm, but not my font.
> 
> Out of curiosity, which font is it?

Courier Dot 15 CPI with minor tweaks

http://dradul.tripod.com/font_stuff/Courier_Dot_15_CPI.htm

-- 
Stuart Jansen <sjansen@gurulabs.com>
Guru Labs, L.C.

[-- Attachment #1.1.2: addfont.sh.bz2 --]
[-- Type: application/x-bzip, Size: 1333 bytes --]

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 139 bytes --]

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

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

end of thread, other threads:[~2005-09-19  0:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-17 23:37 startlines space width Stuart Jansen
2005-09-18  7:02 ` Taco Hoekwater
2005-09-19  0:06   ` Stuart Jansen

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 NNTP newsgroup(s).