Eskil

Diff
Login

Differences From Artifact [0900e2b04f]:

To Artifact [aa6e5cc532]:


64
65
66
67
68
69
70
71

72
73
74
75
76
77
78
64
65
66
67
68
69
70

71
72
73
74
75
76
77
78







-
+







    }

    method StartPrint {} {
        # Page size
        lassign [$pdf getDrawableArea] width height

        # Header metrics
        $pdf setFont $options(-headsize) Courier
        $pdf setFont $options(-headsize) EskilFont
        set headoffset [expr {$options(-headsize) + [$pdf getFontMetric bboxy]}]
        set hoy $headoffset

        # Figure out font size from number of chars per line
        set charwidthHead [$pdf getCharWidth "0"]
        set charwidth [expr {$width / 2.0 / ($options(-cpl) + $options(-cpln) + 1)}]
        set fontsize [expr {$options(-headsize) * $charwidth / $charwidthHead}]
112
113
114
115
116
117
118
119

120
121
122
123
124
125
126

127
128
129
130
131
132
133
112
113
114
115
116
117
118

119
120
121
122
123
124
125

126
127
128
129
130
131
132
133







-
+






-
+







        $pdf rectangle 0 $options(-headsize) \
                $width [- $height $options(-headsize)]
        # Center line
        $pdf line [/ $width 2.0] $options(-headsize) \
                [/ $width 2.0] $height

        # Header
        $pdf setFont $options(-headsize) Courier
        $pdf setFont $options(-headsize) EskilFont
        $pdf text $options(-headleft) -x 0 -y $hoy 
        $pdf text "Page $page of $options(-headnpages)" \
                -x [expr {$width / 2.0}] -y $hoy -align center
        $pdf text $options(-headright) -x $width -y $hoy -align right

        # Normal font
        $pdf setFont $fontsize Courier
        $pdf setFont $fontsize EskilFont
    }

    method setHalf {half} {
        if {$half eq "left"} {
            $pdf setTextPosition $ox1 $oy
        } else {
            $pdf setTextPosition $ox2 $oy