• how to configure the shtmlview widget

    From Mark Summerfield@m.n.summerfield@gmail.com to comp.lang.tcl on Thu Aug 14 10:13:50 2025
    From Newsgroup: comp.lang.tcl

    I've started using the shtmlview widget to display html versions of man pages created by `exec man -Thtml $filename > $html`.

    I want shtmlview to use a monospace font. I've created such a font but I can't work out how to do this.

    I've tried:

    font create Mono -family $family -size $size
    :
    $View helptext tag configure mono -font Mono
    :
    $View browse $htmlurl
    $View helptext tag add mono 1.0 end

    where $View is a shtmlview widget, but it has no effect.
    Yet when I do, say,

    $View helptext configure -background pink

    it works fine.

    Ideally, I'd like to set the body font, and bold and italic.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Ashok@apnmbx-public@yahoo.com to comp.lang.tcl on Sat Aug 16 12:19:18 2025
    From Newsgroup: comp.lang.tcl

    Complete stab in the dark ..

    What happens if you move the font configure line after the browse method
    call? I wonder if loading a page clears tags.

    /Ashok

    On 8/14/2025 3:43 PM, Mark Summerfield wrote:
    I've started using the shtmlview widget to display html versions of man pages created by `exec man -Thtml $filename > $html`.

    I want shtmlview to use a monospace font. I've created such a font but I can't
    work out how to do this.

    I've tried:

    font create Mono -family $family -size $size
    :
    $View helptext tag configure mono -font Mono
    :
    $View browse $htmlurl
    $View helptext tag add mono 1.0 end

    where $View is a shtmlview widget, but it has no effect.
    Yet when I do, say,

    $View helptext configure -background pink

    it works fine.

    Ideally, I'd like to set the body font, and bold and italic.

    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Mark Summerfield@m.n.summerfield@gmail.com to comp.lang.tcl on Mon Aug 18 14:57:52 2025
    From Newsgroup: comp.lang.tcl

    On Sat, 16 Aug 2025 12:19:18 +0530, Ashok wrote:

    Complete stab in the dark ..

    What happens if you move the font configure line after the browse method call? I wonder if loading a page clears tags.

    /Ashok

    On 8/14/2025 3:43 PM, Mark Summerfield wrote:
    I've started using the shtmlview widget to display html versions of man pages
    created by `exec man -Thtml $filename > $html`.

    I want shtmlview to use a monospace font. I've created such a font but I can't
    work out how to do this.

    I've tried:

    font create Mono -family $family -size $size
    :
    $View helptext tag configure mono -font Mono
    :
    $View browse $htmlurl
    $View helptext tag add mono 1.0 end

    where $View is a shtmlview widget, but it has no effect.
    Yet when I do, say,

    $View helptext configure -background pink

    it works fine.

    Ideally, I'd like to set the body font, and bold and italic.

    Thanks for the idea. In the end I switched to using the plain tk text widget and using `man -Tutf8`. This uses BS (\x08 ^H) to produce bold & underline
    so I just replace these with application's of bold and italic tags which
    works great.
    --- Synchronet 3.21a-Linux NewsLink 1.2