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
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
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
participants (2)
-
Stuart Jansen
-
Taco Hoekwater