Re: (dsssl) Smallcap fonts for <acronym> in docbook

Subject: Re: (dsssl) Smallcap fonts for <acronym> in docbook
From: "Christopher R. Maden" <crism@xxxxxxxxx>
Date: Thu, 20 Sep 2001 01:54:14 -0700
At 17:18 19-09-2001, V.Krishna Kumar wrote:
Iam new to DSSSL and DocBook. Iam working on a project report and I need to
use smallcaps for <acronym>. How do I do that ?

In your driver stylesheet, put in


(element acronym
  (make sequence
        ;; properties
        (process-children)))

where ;;properties depends on the font you're using. If you have a proper small caps font, then you want to specify that font-family-name. If you don't then you'll need to set the font-size smaller.

In either case, you'll want to change the text, probably. In a small-caps font, the real small caps usually map to lower-case letters, while upper-case letters still get full caps. Conversely, if you're using smaller full caps, you probably want to make sure everything is upper-case, or it'll look weird.

;; (to-lower str) returns the lower-case version of the string.
;; The proper way to do this would be with (char-downcase), but Jade
;; 1.0 doesn't implement that procedure.
(define (to-lower #!optional (str (data (current-node))))
  (let lower-loop
    ((old-string str))
    (if (= (string-length old-string)
           0)
        ""
        (string-append (case (string-ref old-string
                                         0)
                             ((#\A) "a")
                             ((#\B) "b")
                             ((#\C) "c")
                             ((#\D) "d")
                             ((#\E) "e")
                             ((#\F) "f")
                             ((#\G) "g")
                             ((#\H) "h")
                             ((#\I) "i")
                             ((#\J) "j")
                             ((#\K) "k")
                             ((#\L) "l")
                             ((#\M) "m")
                             ((#\N) "n")
                             ((#\O) "o")
                             ((#\P) "p")
                             ((#\Q) "q")
                             ((#\R) "r")
                             ((#\S) "s")
                             ((#\T) "t")
                             ((#\U) "u")
                             ((#\V) "v")
                             ((#\W) "w")
                             ((#\X) "x")
                             ((#\Y) "y")
                             ((#\Z) "z")
                             ;; turn newlines and tabs to spaces
                             ((#\
                               #\       ) " ")
                             (else (string (string-ref old-string
                                                       0))))
                       (lower-loop (substring old-string
                                              1
                                              (string-length old-string)))))))
;; (to-upper string) returns the upper-case version of the string.
;; The proper way to do this would be with (char-upcase), but Jade 1.0
;; doesn't implement that procedure.
(define (to-upper #!optional (str (data (current-node))))
  (let upper-loop
    ((old-string str))
    (if (= (string-length old-string)
           0)
        ""
        (string-append (case (string-ref old-string
                                         0)
                             ((#\a) "A")
                             ((#\b) "B")
                             ((#\c) "C")
                             ((#\d) "D")
                             ((#\e) "E")
                             ((#\f) "F")
                             ((#\g) "G")
                             ((#\h) "H")
                             ((#\i) "I")
                             ((#\j) "J")
                             ((#\k) "K")
                             ((#\l) "L")
                             ((#\m) "M")
                             ((#\n) "N")
                             ((#\o) "O")
                             ((#\p) "P")
                             ((#\q) "Q")
                             ((#\r) "R")
                             ((#\s) "S")
                             ((#\t) "T")
                             ((#\u) "U")
                             ((#\v) "V")
                             ((#\w) "W")
                             ((#\x) "X")
                             ((#\y) "Y")
                             ((#\z) "Z")
                             ;; turn newlines and tabs to spaces
                             ((#\
                               #\       ) " ")
                             (else (string (string-ref old-string
                                                       0))))
                       (upper-loop (substring old-string
                                              1
                                              (string-length old-string)))))))

HTH,
Chris
--
Christopher R. Maden, Principal Consultant, HMM Consulting Int'l, Inc.
DTDs/schemas - conversion - ebooks - publishing - Web - B2B - training
<URL: http://www.hmmci.com/ > <URL: http://crism.maden.org/consulting/ >
PGP Fingerprint: BBA6 4085 DED0 E176 D6D4  5DFC AC52 F825 AFEC 58DA


DSSSList info and archive: http://www.mulberrytech.com/dsssl/dssslist


Current Thread