home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / OL.LZH / PROCS.LZH / BOLD.ICN < prev    next >
Text File  |  1991-07-13  |  1KB  |  55 lines

  1. ############################################################################
  2. #
  3. #    Name:    bold.icn
  4. #
  5. #    Title:    Procedures for enboldening and underscoring test
  6. #
  7. #    Author:    Ralph E. Griswold
  8. #
  9. #    Date:    June 10, 1988
  10. #
  11. ############################################################################
  12. #  
  13. #  These procedures produce text with interspersed characters suit-
  14. #  able for printing to produce the effect of boldface (by over-
  15. #  striking) and underscoring (using backspaces).
  16. #  
  17. #       bold(s)        bold version of s
  18. #  
  19. #       uscore(s)      underscored version of s
  20. #  
  21. ############################################################################
  22.  
  23. procedure bold(s)
  24.    local c
  25.    static labels, trans, max
  26.    initial {
  27.       labels := "1"
  28.       trans := repl("1\b",4) || "1"
  29.       max := *labels
  30.       trans := bold(string(&lcase))
  31.       labels := string(&lcase)
  32.       max := *labels
  33.       }
  34.    if *s <= max then
  35.       return map(left(trans,9 * *s),left(labels,*s),s)
  36.    else return bold(left(s,*s - max)) ||
  37.       map(trans,labels,right(s,max))
  38. end
  39.  
  40. procedure uscore(s)
  41.    static labels, trans, max
  42.    initial {
  43.       labels := "1"
  44.       trans := "_\b1"
  45.       max := *labels
  46.       trans := uscore(string(&lcase))
  47.       labels := string(&lcase)
  48.       max := *labels
  49.       }
  50.    if *s <= max then
  51.       return map(left(trans,3 * *s),left(labels,*s),s)
  52.    else return uscore(left(s,*s - max)) ||
  53.       map(trans,labels,right(s,max))
  54. end
  55.