(define (script-fu-calender-h7-month-fr img drawable inTitle inWeekDays inFont inFontSize inColor1 inColor2 inColor3 inDimCalender inDimTitle inDimWeekDays inDimDays inNumDays inHolidays) (let* ( (width (car (gimp-drawable-width drawable))) (height (car (gimp-drawable-height drawable))) (old-fg (car (gimp-palette-get-foreground))) (arrWeekDays (strbreakup inWeekDays ";")) (arrFontSize (strbreakup inFontSize ";")) (theFontSize1 (string->number (larg-default arrFontSize 0 "30"))) (theFontSize2 (string->number (larg-default arrFontSize 1 "20"))) (theFontSize3 (string->number (larg-default arrFontSize 2 "20"))) (arrDimCalender (strbreakup inDimCalender ";")) (theCalenderOffsetX (string->number (larg-default arrDimCalender 0 "40"))) (theCalenderOffsetY (string->number (larg-default arrDimCalender 1 "40"))) (arrDimTitle (strbreakup inDimTitle ";")) (theTitleOffsetX (string->number (larg-default arrDimTitle 0 "115"))) (theTitleOffsetY (string->number (larg-default arrDimTitle 1 "0"))) (theTitleAlign (string->number (larg-default arrDimTitle 2 "1"))) (arrDimWeekDays (strbreakup inDimWeekDays ";")) (theWeekDaysOffsetX (string->number (larg-default arrDimWeekDays 0 "25"))) (theWeekDaysOffsetY (string->number (larg-default arrDimWeekDays 1 "30"))) (theWeekDaysDX (string->number (larg-default arrDimWeekDays 2 "30"))) (theWeekDaysAlign (string->number (larg-default arrDimWeekDays 3 "1"))) (arrDimDays (strbreakup inDimDays ";")) (theDaysOffsetX (string->number (larg-default arrDimDays 0 "25"))) (theDaysOffsetY (string->number (larg-default arrDimDays 1 "50"))) (theDaysDX (string->number (larg-default arrDimDays 2 "30"))) (theDaysDY (string->number (larg-default arrDimDays 3 "20"))) (theDaysAlign (string->number (larg-default arrDimDays 4 "1"))) (arrNumDays (strbreakup inNumDays ";")) (theFirstDay (string->number (larg-default arrNumDays 0 "1"))) (theNumODays (string->number (larg-default arrNumDays 1 "31"))) (arrHolidays (strbreakup inHolidays "|")) (arrSCols (strbreakup (larg-default arrHolidays 0 "0") ";")) (theSCols1 (string->number (larg-default arrSCols 0 "0"))) (theSCols2 (string->number (larg-default arrSCols 1 "0"))) (arrTheHolidays (strbreakup (larg-default arrHolidays 1 "0") ";")) (theText) ) (gimp-image-undo-group-start img) (set! theNextHoliday (string->number (car arrTheHolidays))) (set! arrTheHolidays (cdr arrTheHolidays)) (gimp-palette-set-foreground inColor1) (set! theText (car (gimp-text-fontname img drawable 0 0 (string-append " " inTitle " ") 0 TRUE theFontSize1 PIXELS inFont))) (if (= theTitleAlign 0) ; align left (set! theX (+ theCalenderOffsetX theTitleOffsetX)) ) (if (= theTitleAlign 1) ; align center (set! theX (- (+ theCalenderOffsetX theTitleOffsetX) (/ (car (gimp-drawable-width theText)) 2))) ) (if (= theTitleAlign 2) ; align right (set! theX (- (+ theCalenderOffsetX theTitleOffsetX) (car (gimp-drawable-width theText)))) ) (gimp-layer-set-offsets theText theX (+ theCalenderOffsetY theTitleOffsetY)) (gimp-floating-sel-anchor theText drawable) (set! index 0) (while (< index 7) (set! theText (car (gimp-text-fontname img drawable 0 0 (string-append " " (larg-default arrWeekDays index "?") " ") 0 TRUE theFontSize2 PIXELS inFont))) (if (= theWeekDaysAlign 0) ; align left (set! theX (+ theCalenderOffsetX theWeekDaysOffsetX (* index theWeekDaysDX) )) ) (if (= theWeekDaysAlign 1) ; align center (set! theX (- (+ theCalenderOffsetX theWeekDaysOffsetX (* index theWeekDaysDX) ) (/ (car (gimp-drawable-width theText)) 2))) ) (if (= theWeekDaysAlign 2) ; align right (set! theX (- (+ theCalenderOffsetX theWeekDaysOffsetX (* index theWeekDaysDX) ) (car (gimp-drawable-width theText)))) ) (gimp-layer-set-offsets theText theX (+ theCalenderOffsetY theWeekDaysOffsetY)) (gimp-floating-sel-anchor theText drawable) (set! index (+ index 1)) ) (set! index 1) (set! x (- theFirstDay 1)) (set! y 0) (while (<= index theNumODays) (if (= index theNextHoliday) (begin (gimp-palette-set-foreground inColor3) (if (> (length arrTheHolidays) 0 ) (begin (set! theNextHoliday (string->number (car arrTheHolidays))) (set! arrTheHolidays (cdr arrTheHolidays)) ) ) ) (if (= x (- theSCols1 1)) (gimp-palette-set-foreground inColor3) (if (= x (- theSCols2 1)) (gimp-palette-set-foreground inColor3) (gimp-palette-set-foreground inColor2) ) ) ) (set! theText (car (gimp-text-fontname img drawable 0 0 (string-append " " (number->string index 10) " ") 0 TRUE theFontSize3 PIXELS inFont))) (if (= theDaysAlign 0) ; align left (set! theX (+ theCalenderOffsetX theDaysOffsetX (* x theDaysDX))) ) (if (= theDaysAlign 1) ; align center (set! theX (- (+ theCalenderOffsetX theDaysOffsetX (* x theDaysDX)) (/ (car (gimp-drawable-width theText)) 2))) ) (if (= theDaysAlign 2) ; align right (set! theX (- (+ theCalenderOffsetX theDaysOffsetX (* x theDaysDX)) (car (gimp-drawable-width theText)))) ) (gimp-layer-set-offsets theText theX (+ theCalenderOffsetY theDaysOffsetY (* y theDaysDY))) (gimp-floating-sel-anchor theText drawable) (set! x (+ x 1)) (if (> x 6) (begin (set! x 0) (set! y (+ y 1)) ) ) (set! index (+ index 1)) ) (gimp-palette-set-foreground old-fg) (gimp-image-undo-group-end img) (gimp-displays-flush) ) ) (define (script-fu-calender-2007-fr img drawable inTitle inMonthTitle inWeekDays inFont inFontSize inColor1 inColor2 inColor3 inDimCalender inDimTitle inDimMonth inDimMonthTitle inDimWeekDays inDimDays inNumDays inHolidays) (let* ( (old-fg (car (gimp-palette-get-foreground))) (arrFontSize (strbreakup inFontSize "|")) (theFontSizeTitle (string->number (larg-default arrFontSize 0 "40"))) (theFontSize (larg-default arrFontSize 1 "30;20;20")) (arrDimTitle (strbreakup inDimTitle ";")) (theTitleOffsetX (string->number (larg-default arrDimTitle 0 "490"))) (theTitleOffsetY (string->number (larg-default arrDimTitle 1 "0"))) (theTitleAlign (string->number (larg-default arrDimTitle 2 "1"))) (arrMonthTitle (strbreakup inMonthTitle ";")) (arrDimCalender (strbreakup inDimCalender ";")) (theDimCalenderX (string->number (larg-default arrDimCalender 0 "40"))) (theDimCalenderY (string->number (larg-default arrDimCalender 1 "40"))) (theDimCalenderCols (string->number (larg-default arrDimCalender 2 "4"))) (arrDimMonth (strbreakup inDimMonth ";")) (theDimMonthX (string->number (larg-default arrDimMonth 0 "40"))) (theDimMonthY (string->number (larg-default arrDimMonth 1 "40"))) (theDimMonthDX (string->number (larg-default arrDimMonth 2 "230"))) (theDimMonthDY (string->number (larg-default arrDimMonth 3 "180"))) (arrNumDays (strbreakup inNumDays ";")) (theFirstDay (string->number (larg-default arrNumDays 0 "1"))) (arrHolidays (strbreakup inHolidays "|")) (theColSunday (larg-default arrHolidays 0 "7")) (theText) ) (gimp-image-undo-group-start img) (gimp-palette-set-foreground inColor1) (set! theText (car (gimp-text-fontname img drawable 0 0 (string-append " " inTitle " ") 0 TRUE theFontSizeTitle PIXELS inFont))) (if (= theTitleAlign 0) ; align left (set! theX (+ theDimCalenderX theTitleOffsetX)) ) (if (= theTitleAlign 1) ; align center (set! theX (- (+ theDimCalenderX theTitleOffsetX) (/ (car (gimp-drawable-width theText)) 2))) ) (if (= theTitleAlign 2) ; align right (set! theX (- (+ theDimCalenderX theTitleOffsetX) (car (gimp-drawable-width theText)))) ) (gimp-layer-set-offsets theText theX (+ theDimCalenderY theTitleOffsetY)) (gimp-floating-sel-anchor theText drawable) (define theDimMonth "") (define theMonthTitle1 "") (define theNumODays 31) (define theNumDays "") (define theNumDaysX "-") (define theHolidays "") (set! theArrNumODays '(31 28 31 30 31 30 31 31 30 31 30 31)) (define index 0) (define col 0) (define row 0) (while (< index 12) (set! theDimMonth (string-append (number->string (+ theDimCalenderX theDimMonthX (* col theDimMonthDX))) ";" (number->string (+ theDimCalenderY theDimMonthY (* row theDimMonthDY))))) (set! theMonthTitle (larg-default arrMonthTitle index "")) (if (= index 1) (set! theNumODays (string->number (larg-default arrNumDays 1 "1"))) (set! theNumODays (larg-default theArrNumODays index "31")) ) (set! theNumDays (string-append (number->string theFirstDay 10) ";" (number->string theNumODays 10))) (set! theHolidaysX (larg-default arrHolidays (+ index 1) "-")) (set! theHolidays (string-append theColSunday "|" theHolidaysX)) (script-fu-calender-h7-month-fr img drawable theMonthTitle inWeekDays inFont theFontSize inColor1 inColor2 inColor3 theDimMonth inDimMonthTitle inDimWeekDays inDimDays theNumDays theHolidays) (set! theFirstDay (+ theFirstDay theNumODays)) (while (> theFirstDay 7) (set! theFirstDay (- theFirstDay 7)) ) (set! col (+ col 1)) (if (>= col theDimCalenderCols) (begin (set! col (- col theDimCalenderCols)) (set! row (+ row 1)) ) ) (set! index (+ index 1)) ) (gimp-palette-set-foreground old-fg) (gimp-image-undo-group-end img) (gimp-displays-flush) ) ) (script-fu-register "script-fu-calender-2007-fr" _"/Script-Fu/Calendrier/2007 fr FR..." "Creates an yearly Calender, version française 2007 par Raymond Ostertag" "Michael Schalla " "Michael Schalla" "Februar 2001" "RGB*" SF-IMAGE "Image" 0 SF-DRAWABLE "Drawable" 0 SF-STRING "Titre" "Calendrier français 2007" SF-STRING "Mois-Titre (1;...;12)" "Janvier;Février;Mars;Avril;Mai;Juin;Juillet;Août;Septembre;Octobre;Novembre;Décembre" SF-STRING "Jours de la semaine" "Lu;Ma;Me;Je;Ve;Sa;Di" SF-FONT "Police" "Bitstream Vera Sans" SF-STRING "Taille de police (Titre;Nom du jour;Date)" "40|30;20;20" SF-COLOR "Couleur Titre/Jours" '(128 128 224) SF-COLOR "Couleur Dates normales" '(128 128 128) SF-COLOR "Couleur Week-end/Fériés" '(255 0 0) SF-STRING "Calendrier (X;Y;#Col)" "40;40;4" SF-STRING "Titre (X;Y;A)" "480;0;1" SF-STRING "Mois (X;Y;dX;dY)" "0;40;240;180" SF-STRING "Mois-Titre (X;Y;A)" "115;0;1" SF-STRING "Jours (X;Y;dX;A)" "25;30;30;1" SF-STRING "Dates (X;Y;dX;dY;A)" "25;50;30;20;1" SF-STRING "Premier jour;Nb jours Février" "1;28" SF-STRING "Spécial (Week-end|Fériés)" "6;7|1|0|0|8;9|1;8;17|0|14|15|0|0|1;11|25" )