zub2 / dotprint

Produce PDF output out of text files with dot matrix printer escapes.
GNU General Public License v3.0
22 stars 5 forks source link

Custom margins functionality and basic font features (bold and italic) #4

Closed sm-programmer closed 4 years ago

sm-programmer commented 4 years ago

Hello there! :wave:

This is work I have done on this project to add the following functionality:

  1. Setting custom margins via a command line argument: --margins or -m, with four different margin formats:

    • number, for setting a value to all margins.
    • num1,num2, for setting top and bottom, then left and right margins.
    • num1,num2,num3, for setting top first, then left and right, then bottom margins.
    • num1,num2,num3,num4, for setting each margin separately, in the following order: top first, then right, them bottom, then left. These formats can be checked in the program by issuing -m formats (much like the list option for both -p and -P).
  2. Adding a few more paper sizes:

    • Letter, for 8.5-by-11-inch paper.
    • Half Letter, for 5.5-by-8.5-inch paper.
    • Legal, for 8.5-by-14-inch paper.
    • Oficio, for 8.5-by-13.4-inch paper. (The Spanish version of Legal.)
  3. Enhancements to the Epson preprocessor to instruct CairoTTY to use bold and italic versions of the font in use. An additional test file, named tests/test4.txt is included to test this feature. At this time, no custom font selection is offered for each font feature (i.e. no custom file can be set for bold and/or italic versions).

As I have noted @pkess is doing work related to graphics support, I thought it would be a good time to request review of these changes before any major rework is done.

Thank you for creating such a nice piece of software! :smile:

Regards! :cat:

pkess commented 4 years ago

Hello, i had a short look, into this code. From my point of view this looks good

pkess commented 4 years ago

Only one point: Maybe you want to update the copyright years in the comment blocks on top of your new files ;)

sm-programmer commented 4 years ago

Only one point: Maybe you want to update the copyright years in the comment blocks on top of your new files ;)

You're right. :P I'll make the change right away! :+1: