| Author |
Setting pitch in a monospaced font
|
|
| JF Mezei 2006-03-18, 7:56 am |
| I've looked at the déjà/google archives and didn't find anything obvious
to what *should* be a simple question....
Is there a way to take a monospaced font such as Courier , scaled to 10
points and having it print at a different pitch (for instance 10
characters per inch, 12 characters per inch etc) ?
I've looked at the "show" variations such as awidthshow etc, but it
would require that I do a lot of legwork prior to each show command to
calculate how wide a string needs to be at the current desired pitch. If
I could modify the dictionary, it would be much easier since normal show
commands would then work.
| |
| Helge Blischke 2006-03-18, 6:58 pm |
| JF Mezei wrote:
>
> I've looked at the déjà/google archives and didn't find anything obvious
> to what *should* be a simple question....
>
> Is there a way to take a monospaced font such as Courier , scaled to 10
> points and having it print at a different pitch (for instance 10
> characters per inch, 12 characters per inch etc) ?
>
> I've looked at the "show" variations such as awidthshow etc, but it
> would require that I do a lot of legwork prior to each show command to
> calculate how wide a string needs to be at the current desired pitch. If
> I could modify the dictionary, it would be much easier since normal show
> commands would then work.
Look into the PLRM, the chapter on fonts, and read the paragraphs concerning
adding an additional metrics array to a font.
Helge
--
Helge Blischke
Softwareentwicklung
SRZ Berlin | Firmengruppe besscom
http://www.srz.de
| |
| wizard.fred@gmail.com 2006-03-18, 6:58 pm |
| If you want to change the spacing in a monospace font you only have to
do the calculation once to make it appear at a different fixed pitch.
ASHOW should work. This is a different problem than trying to fit a
string of a certain size in a space.
| |
| JF Mezei 2006-03-18, 6:58 pm |
| Helge Blischke wrote:
> Look into the PLRM, the chapter on fonts, and read the paragraphs concerning
> adding an additional metrics array to a font.
I have the second edition and it doesn't say much about which parameters
do what in the metrics and metrics2 dictionaries that can be set to
change the pitch of a fixed width font. Hence my question here :-(
| |
| Aandi Inston 2006-03-18, 6:58 pm |
| JF Mezei <jfmezei.spamnot@teksavvy.com> wrote:
>Helge Blischke wrote:
>
>I have the second edition and it doesn't say much about which parameters
>do what in the metrics and metrics2 dictionaries that can be set to
>change the pitch of a fixed width font.
There's nothing magic about a fixed width font in this case. You would
include an entry in Metrics (rarely Metrics2) for each glyph name with
a revised width - the same in each case, I presume.
However, this is going to be pretty nasty. Fonts with different
pitches are more often scaled than just set further apart.
----------------------------------------
Aandi Inston quite@dial.pipex.com http://www.quite.com
Please support usenet! Post replies and follow-ups, don't e-mail them.
| |
| rridge@csclub.uwaterloo.ca 2006-03-22, 4:01 am |
| Aandi Inston wrote:
> However, this is going to be pretty nasty. Fonts with different
> pitches are more often scaled than just set further apart.
That's actually easier:
/Courier findfont dup
10 scalefont setfont
20 34 moveto (ABCDEabcde01234) show
12 10 matrix scale makefont setfont
20 20 moveto (ABCDEabcde01234) show
Ross Ridge
|
|
|
|