Pages

Wednesday, April 28, 2021

Making your own album 20

click the 'Documents' header to see previous entries
https://rainbowstampsandcoins.blogspot.com/search/label/documents   

4.4.3     Aligning on multiple boxes

4.4.3.1     Aligning with one header line :

Add following code under what you already had in Test Design 8

#------------------------------------------------
# page 3
#-------------------------------------------------

PAGE_START

PAGE_RULE_H (0.1 0 5)
PAGE_TEXT_CENTRE (HN 12 "Mint")
 

ROW_START_FS (HN 6 0.1 6.0)

STAMP_ADD (32.0 37.0 "2 1/2d \n deep blue \n blue surface" "sg 1" "" "sacc 1")
STAMP_ADD (32.0 37.0 "2 1/2d \n blue \n white surface" "sg 2" "" "sacc 1a")

PAGE_TEXT_CENTRE (HN 12 "\nUsed")

ROW_START_FS (HN 6 0.1 6.0)
STAMP_ADD (32.0 37.0 "2 1/2d \n deep blue \n blue surface" "sg 1" "" "sacc 1")
STAMP_ADD (32.0 37.0 "2 1/2d \n blue \n white surface" "sg 2" "" "sacc 1a")
 

This is not really a header, but a centered text line.
With an even number of boxes, the text will be in the middle between the two central boxes. With an odd number of boxes, the text will be on the middle box.


4.4.3.2     Aligning with blank text :

A second option, requires more skills, you can add as much empty space you need before the first text part, in order to shift the text to the middle of the two boxes.
This requires even more skills, if you also want to place a second text line in the same position. An example of two headers on three boxes.



This is not the best way to solve the problem

4.4.3.3     Aligning with a blank box :

A third trick is something we already know from before, adding an ‘empty’ box, but this time with a header. If we place the empty (invisible) box between the two first boxes, we can put the header on that middle box. We keep this invisible box small, to avoid gaps between the boxes.

ROW_START_FS (HN 6 0.1 6.0)

STAMP_ADD (25.0 28.0 "1/2d \n green" "sg 3" "" "sacc 2")

STAMP_ADD_BLANK (1.0 3.0)

STAMP_HEADING(HN 14 " Heading on\nsecond – invisible - box")

STAMP_ADD (25.0 28.0 "1d \n rose red" "sg 4" "" "sacc 3")

STAMP_ADD (25.0 28.0 "1 1/2d \n chesnut" "sg 5" "" "sacc 4")

STAMP_HEADING(HN 14 "Heading on \nthird box ")


4.4.3.4     Adding a 4th pm to the Stamp_heading -command :

The best solution however to solve the problem of putting headers on multiple boxes, is to add a 4th parameter to the command.
This 4th pm, shifts the tekst of the header to the right:

PAGE_TEXT (HN 12 "\n\nshifting headers \n");

ROW_START_FS (HN 6 0.2 6.0)

STAMP_ADD (28.0 32.0 "One" "" "" "")

STAMP_HEADING(HN 14 "Header on \nfirst box" 15.0)

STAMP_ADD (28.0 32.0 "Two" "" "" "")

STAMP_ADD (28.0 32.0 "Three" "" "" "")

STAMP_HEADING(HN 14 "Header on  \nthird box " 15.0)

STAMP_ADD (28.0 32.0 "Four" "" "" "")

Add this code to your program, generate the PDF, and close it afterwards.

Remark : a negative value as 4th pm, would shift the header to the left.
So you can also put the headers on box 2 and 4, and shift both texts to the left, in stead of shifting headers on box 1 and 3 to the right.

End of Module 2

to be continued...

previous part : https://rainbowstampsandcoins.blogspot.com/2021/04/making-your-own-album-19.html
next part : https://rainbowstampsandcoins.blogspot.com/2021/05/making-your-own-album-21.html

No comments:

Post a Comment