Eskil

Check-in [f84e829114]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Added command line -printFont to select a font file for PDF.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: f84e82911422460a9fadd5cea9d98e1da9e4503c
User & Date: peter 2014-11-25 23:03:11.217
Context
2014-11-25
23:04
Updated syntax to last change check-in: 41e702a30a user: peter tags: trunk
23:03
Added command line -printFont to select a font file for PDF. check-in: f84e829114 user: peter tags: trunk
2014-11-18
23:58
Use underscore as internal magic revision number for "current" check-in: d10147b123 user: peter tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to Changes.



1
2
3
4
5
6
7



2014-11-16
 First working plugin in dirdiff.

2014-11-13
 Undid all dirdiff refactoring from August. Bad idea...

2014-11-12
>
>
>







1
2
3
4
5
6
7
8
9
10
2014-11-25
 Added command line -printFont to select a font file for PDF.

2014-11-16
 First working plugin in dirdiff.

2014-11-13
 Undid all dirdiff refactoring from August. Bad idea...

2014-11-12
Changes to src/eskil.tcl.
76
77
78
79
80
81
82







83




84
85
86
87
88
89
90
91

    # Diff functionality is in the DiffUtil package.
    package require DiffUtil
    # Help DiffUtil to find a diff executable, if needed
    catch {DiffUtil::LocateDiffExe $::eskil(thisScript)}

    # Create font for PDF







    pdf4tcl::loadBaseType1Font EskilBase $::eskil(thisDir)/n022003l.afm \




            $::eskil(thisDir)/n022003l.pfb
    pdf4tcl::createFont EskilBase EskilFont cp1251 

    # Figure out a place to store temporary files.
    locateTmp ::eskil(tmpdir)

    if {$::tcl_platform(platform) eq "windows"} {
        # Locate CVS if it is in c:/bin







>
>
>
>
>
>
>
|
>
>
>
>
|







76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102

    # Diff functionality is in the DiffUtil package.
    package require DiffUtil
    # Help DiffUtil to find a diff executable, if needed
    catch {DiffUtil::LocateDiffExe $::eskil(thisScript)}

    # Create font for PDF
    if {$::Pref(printFont) eq ""} {
        set fontfile $::eskil(thisDir)/n022003l.afm
    } else {
        set fontfile $::Pref(printFont)
    }
    set ext [file extension $fontfile]
    if {$ext eq ".afm"} {
        pdf4tcl::loadBaseType1Font EskilBase $fontfile \
                [file rootname $fontfile].pfb
    } else {
        pdf4tcl::loadBaseTrueTypeFont EskilBase $fontfile 1
    }
        
    pdf4tcl::createFont EskilBase EskilFont cp1251 

    # Figure out a place to store temporary files.
    locateTmp ::eskil(tmpdir)

    if {$::tcl_platform(platform) eq "windows"} {
        # Locate CVS if it is in c:/bin
3911
3912
3913
3914
3915
3916
3917

3918
3919
3920
3921
3922
3923
3924
  -browse     : Automatically bring up file dialog after starting.
  -server     : Set up Eskil to be controllable from the outside.

  -print <file>          : Generate PDF and exit.
  -printCharsPerLine <n> : Adapt font size for this line length and wrap. (80)
  -printPaper <paper>    : Select paper size (a4)
  -printHeaderSize <n>   : Font size for page header (10)

  -printColorChange <RGB> : Color for change   (1.0 0.7 0.7)
  -printColorOld <RGB>    : Color for old text (0.7 1.0 0.7)
  -printColorNew <RGB     : Color for new text (0.8 0.8 1.0)

  -plugin <name>       : Preprocess files using plugin.
  -plugininfo <info>   : Pass info to plugin (plugin specific)
  -pluginlist          : List known plugins







>







3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
  -browse     : Automatically bring up file dialog after starting.
  -server     : Set up Eskil to be controllable from the outside.

  -print <file>          : Generate PDF and exit.
  -printCharsPerLine <n> : Adapt font size for this line length and wrap. (80)
  -printPaper <paper>    : Select paper size (a4)
  -printHeaderSize <n>   : Font size for page header (10)
  -printFont <fontfile>  : Select font to use in PDF, afm or ttf
  -printColorChange <RGB> : Color for change   (1.0 0.7 0.7)
  -printColorOld <RGB>    : Color for old text (0.7 1.0 0.7)
  -printColorNew <RGB     : Color for new text (0.8 0.8 1.0)

  -plugin <name>       : Preprocess files using plugin.
  -plugininfo <info>   : Pass info to plugin (plugin specific)
  -pluginlist          : List known plugins
3968
3969
3970
3971
3972
3973
3974

3975
3976
3977
3978
3979
3980
3981

    set allOpts {
        -w --help -help -b -noignore -i -nocase -nodigit -nokeyword -prefix
        -noparse -line -smallblock -block -char -word -limit -nodiff -dir
        -clip -patch -browse -conflict -print -noempty -pivot
        -printHeaderSize -printCharsPerLine -printPaper
        -printColorChange -printColorOld -printColorNew

        -server -o -a -fine -r -context -cvs -svn -review
        -foreach -preprocess -preprocessleft -preprocessright
        -close -nonewline -plugin -plugininfo
        -plugindump -pluginlist -nocdiff
    }

    # If the first option is "--query", use it to ask about options.







>







3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994

    set allOpts {
        -w --help -help -b -noignore -i -nocase -nodigit -nokeyword -prefix
        -noparse -line -smallblock -block -char -word -limit -nodiff -dir
        -clip -patch -browse -conflict -print -noempty -pivot
        -printHeaderSize -printCharsPerLine -printPaper
        -printColorChange -printColorOld -printColorNew
        -printFont
        -server -o -a -fine -r -context -cvs -svn -review
        -foreach -preprocess -preprocessleft -preprocessright
        -close -nonewline -plugin -plugininfo
        -plugindump -pluginlist -nocdiff
    }

    # If the first option is "--query", use it to ask about options.
4011
4012
4013
4014
4015
4016
4017


4018
4019
4020
4021
4022
4023
4024
        if {$nextArg != ""} {
            if {$nextArg eq "mergeFile"} {
                set opts(mergeFile) [file join [pwd] $arg]
            } elseif {$nextArg eq "ancestorFile"} {
                set opts(ancestorFile) [file join [pwd] $arg]
            } elseif {$nextArg eq "printFile"} {
                set opts(printFile) [file join [pwd] $arg]


            } elseif {$nextArg eq "printHeaderSize"} {
                if {![string is double -strict $arg] || $arg <= 0} {
                    puts "Argument -printHeaderSize must be a positive number"
                    exit
                }
                set ::Pref(printHeaderSize) $arg
            } elseif {$nextArg eq "printCharsPerLine"} {







>
>







4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
        if {$nextArg != ""} {
            if {$nextArg eq "mergeFile"} {
                set opts(mergeFile) [file join [pwd] $arg]
            } elseif {$nextArg eq "ancestorFile"} {
                set opts(ancestorFile) [file join [pwd] $arg]
            } elseif {$nextArg eq "printFile"} {
                set opts(printFile) [file join [pwd] $arg]
            } elseif {$nextArg eq "printFont"} {
                set ::Pref(printFont) $arg
            } elseif {$nextArg eq "printHeaderSize"} {
                if {![string is double -strict $arg] || $arg <= 0} {
                    puts "Argument -printHeaderSize must be a positive number"
                    exit
                }
                set ::Pref(printHeaderSize) $arg
            } elseif {$nextArg eq "printCharsPerLine"} {
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
        } elseif {$arg eq "-conflict"} {
            set opts(mode) "conflict"
            # Conflict implies foreach
            set foreach 1
        } elseif {$arg eq "-print" || $arg eq "-printpdf"} {
            set nextArg printFile
        } elseif {$arg in {-printHeaderSize -printCharsPerLine -printPaper \
                -printColorChange -printColorOld -printColorNew}} {
            set nextArg [string range $arg 1 end]
        } elseif {$arg eq "-server"} {
            if {$::tcl_platform(platform) eq "windows"} {
                catch {
                    package require dde
                    dde servername Eskil
                }







|







4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
        } elseif {$arg eq "-conflict"} {
            set opts(mode) "conflict"
            # Conflict implies foreach
            set foreach 1
        } elseif {$arg eq "-print" || $arg eq "-printpdf"} {
            set nextArg printFile
        } elseif {$arg in {-printHeaderSize -printCharsPerLine -printPaper \
                -printColorChange -printColorOld -printColorNew -printFont}} {
            set nextArg [string range $arg 1 end]
        } elseif {$arg eq "-server"} {
            if {$::tcl_platform(platform) eq "windows"} {
                catch {
                    package require dde
                    dde servername Eskil
                }
4486
4487
4488
4489
4490
4491
4492

4493
4494
4495
4496
4497
4498
4499
    # Print options
    set ::DefaultPref(printHeaderSize) 10
    set ::DefaultPref(printCharsPerLine) 80
    set ::DefaultPref(printPaper) a4
    set ::DefaultPref(printColorChange) "1.0 0.7 0.7"
    set ::DefaultPref(printColorNew1)   "0.7 1.0 0.7"
    set ::DefaultPref(printColorNew2)   "0.8 0.8 1.0"


    # Directory diff options
    set ::DefaultPref(dir,comparelevel) 1
    set ::DefaultPref(dir,ignorekey) 0
    set ::DefaultPref(dir,incfiles) ""
    set ::DefaultPref(dir,exfiles) "*.o"
    set ::DefaultPref(dir,incdirs) ""







>







4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
    # Print options
    set ::DefaultPref(printHeaderSize) 10
    set ::DefaultPref(printCharsPerLine) 80
    set ::DefaultPref(printPaper) a4
    set ::DefaultPref(printColorChange) "1.0 0.7 0.7"
    set ::DefaultPref(printColorNew1)   "0.7 1.0 0.7"
    set ::DefaultPref(printColorNew2)   "0.8 0.8 1.0"
    set ::DefaultPref(printFont) ""

    # Directory diff options
    set ::DefaultPref(dir,comparelevel) 1
    set ::DefaultPref(dir,ignorekey) 0
    set ::DefaultPref(dir,incfiles) ""
    set ::DefaultPref(dir,exfiles) "*.o"
    set ::DefaultPref(dir,incdirs) ""