项目作者: fortran-gaming

项目描述 :
Fortran 66 Snoopy Calendar generator updated to be buildable in modern times
高级语言: Fortran
项目地址: git://github.com/fortran-gaming/snoopy-calendar.git
创建时间: 2018-06-08T17:12:58Z
项目社区:https://github.com/fortran-gaming/snoopy-calendar

开源协议:MIT License

下载


Fortran Snoopy Calendar

Actions Status

The classic Fortran 66 Peanuts calendar generator…with a dash of Fortran 2008, in a single .f file.

Modified:

  • uses Fortran 2008 file open() and close()
  • Fortran 2003 command line input of year/month
  • remove Fortran 66 Hollerith characters

Build

  1. cmake -B build
  2. cmake --build build

test output with

  1. ctest --test-dir build -V

Usage

It seems from a cursory check that the output may be valid from year 1753 through year 3000 or more.

The output is printed to the Terminal, so simply redirect stdout to a file to save.
To see the calendar in your terminal, your terminal must be at least 133 columns wide.

Specify year and month.
To make a July 2018 calendar, output to terminal:

  1. ./snpcal 2018 7

Create PDF

This procedure is specific to Linux, but may be adapted to other OS.

  1. install:
    1. apt install enscript ghostscript
  2. for each month wanted (here, July 2018)
    1. ./snpcal.sh 2018 7

That creates mycal.pdf which should be a single page, approximately centered.
Adjust the enscript command line parameters if it doesn’t look right.

Custom images

The second command line argument user will load your own images from the folder data/pic01.txt data/pic02.txt where the number is the month.
We have found a good way to convert images to simple ASCII is
jp2a, available on Linux by apt install jp2a or similar.
Then using ImageMagick:

  1. convert myimg.png jpg:- | jp2a --width=132 -i - > myimg.txt

Once you are satisfied, put them in the data/ folder, named as pic01.txt &c. to be used for the respective month.