Changeset 8af3a89 in report for tools


Ignore:
Timestamp:
Mar 20, 2008 11:10:51 PM (12 years ago)
Author:
Simon Marlow <marlowsd@…>
Branches:
h2010, master
Children:
31cb8bb
Parents:
404de07
Message:

Keep the current colour when outputting <tt> text
This program is in dire need of a rewrite.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/tex.hs

    r404de07 r8af3a89  
    14011401                                   (sn,cfn,nfn,nln) = emitl hs s cf1 nf1 nl1 in
    14021402                                (s1,cfn,nfn,nln)
    1403      hemitTT str forceNL = (changeFont cf ttFont ++
     1403     hemitTT str forceNL = let nf' = nf `withStyle` TT in
     1404                           (changeFont cf nf' ++
    14041405                            (if forceNL && (not nl) then "<br>\n" else "") ++
    14051406                            htmlEncodeVerb str s,
    1406                             ttFont, nf, forceNL)
     1407                            nf', nf, forceNL)
     1408             -- Verb is supposed to behave a little like HProtect it seems,
     1409             -- in that the font is temporarily changed to <tt>, then restored.
     1410             -- (this is weird, why not use HProtect??)
     1411             -- Anyway, we must be careful not to throw away any size or colour
     1412             -- settings when we change the font.  --SDM 3/2008
    14071413     newFont f = (s,cf,f,nl)
    14081414     doTableRow align widths rows = "<tr>" ++
     
    14831489     fc c = "color=" ++ c
    14841490
     1491changeFontStyle (Font s1 _ _) s2 =
     1492   if s1 /= s2 then exitFontStyle s1  ++ enterFontStyle s2 else ""
     1493
    14851494enterFontStyle RM = ""
    14861495enterFontStyle IT = "<I>"
     
    14981507exitFontStyle Sym = "</font>"
    14991508exitFontStyle UL = "</u>"
     1509
     1510withStyle (Font _ sz cl) sty = Font sty sz cl
    15001511
    15011512emitRM h f = let (s,cf,nf,nl) = ht1 h (exitFont cf) romanFont f True in s
Note: See TracChangeset for help on using the changeset viewer.