PROC w := HSpacing() IS w := PS.StringWidth("W") + 3 END; PROC DrawRules(a, num) IS VAR asc, dec, w, b IN asc, dec := PS.FontHeight(); w := HSpacing(); b := R2.Plus(a, (w * num, 0)); SAVE PS IN PS.MoveTo(a); PS.LineTo(b); PS.SetColor(Color.Red); PS.Stroke() END; PS.MoveTo(R2.Plus(a, (0, asc))); PS.LineTo(R2.Plus(b, (0, asc))); PS.MoveTo(R2.Minus(a, (0, dec))); PS.LineTo(R2.Minus(b, (0, dec))); PS.Stroke() END END; PROC ShowChars(a, start, num) IS VAR i = 0, w, p = a, c IN w := HSpacing(); DO i < num -> c := Text.FromChar(start + i); SAVE PS IN PS.SetColor(Color.Green); Rect.DrawR(Rect.Plus(PS.StringBBox(c), p)); PS.Stroke() END; PS.Type(p, c); p := R2.Plus(p, (w, 0)); i := i + 1 OD END END; CONST NumChars = 256, CharsPerRow = 16; PROC ShowAllChars(a) IS PS.SetWidth(0.1); VAR sz, i = 0 IN sz := PS.GetFontPtSize() + 10; DO i < NumChars -> DrawRules(a, CharsPerRow); ShowChars(a, i, CharsPerRow); a := R2.Minus(a, (0, sz)); i := i + CharsPerRow OD END END; PROC Cmd0() IS VAR a ~ (-77.25, 128.2) IN PS.SetFont("Times-Roman", PS.Small); ShowAllChars(a) END END;