Tuesday, May 18, 2021

Making your own album 32

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

6.1.2.2     Parameters for images

The parameters that we will insert, are referring to items that can be different on each page. They are indicated by two dollar-signs ($$) , followed by a number from 1 to 9.

$$1 – refers to the first object,
$$2  to the second, … unitl $$9

In the Page_Start_Group, we will determinate the location of each of the possible 9 variable parameters.
In the Page_Start-command, we will fill out or change those variables that we want to use for this specific chapter.

Open Test Design 13

# ------------------------------------------------------------------------------

# Page_Start_Group
# ------------------------------------------------------------------------------

PAGE_START_GROUP_BEGIN
PAGE_TEXT(HN 1 "" 6.0)

ROW_START_JS(HN 6 0.1)

STAMP_ADD_IMG(42 21 "stamp_images/flag_canada.png" "" "" "" NO_FRAME)

PAGE_TEXT_CENTRE(CPG 42 "Canada")
PAGE_TEXT(HN 1 "" 12.0)

PAGE_START_GROUP_END

In the previous exercise, we have determinated 6 possible items that will change over the chapters in our album, (3 of them for the images) and, because we keep the last 3 pm’s for the image, we can already start to adjust the violet command line above, by using the $$-indicators.

STAMP_ADD_IMG(42 21 "stamp_images/flag_canada.png" "" "" "" NO_FRAME)

The width of the image is variable 4 : $$4
The hight of the image is variable 5 : $$5
The image itself will be variable 6 : $$6

Remark: if you use all 9 variables, the image will use var 7, var 8 and var 9)

The command above, also uses 3 text fields (see the double pair of straight quotes) to put text underneath, left, middle and right, but for the use of an illustrative image, we leave those text fields open.
We also choose for : NO_FRAME (of FRAME) if we never (or always) want a frame around our title image.

The code for the variable image therfore becomes :
STAMP_ADD_IMG ($$4 $$5 $$6 "" "" "" NO_FRAME)

As we want the text to appear next tot he image, it is better to work in 2 columns.

PAGE_COLUMN_START : comes right after Page_Start_Group
PAGE_COLUMN_NEXT : comes right after the image
PAGE_COLUMN_END : comes right before Page_Start_Group_End

The result will be as follows :

# ------------------------------------------------------------------------------

# Page_Start_Group
# ------------------------------------------------------------------------------

PAGE_START_GROUP_BEGIN

PAGE_COLUMN_START
PAGE_TEXT(HN 1 "" 6.0)

ROW_START_JS(HN 6 0.1)

STAMP_ADD_IMG (
$$4 $$5 $$6 "" "" "" NO_FRAME)

PAGE_COLUMN_NEXT

PAGE_TEXT(HN 1 "" -22.0)

PAGE_TEXT_CENTRE(CPG 42 "Canada")

PAGE_TEXT(HN 1 "" 12.0)

PAGE_COLUMN_STOP

PAGE_START_GROUP_END

6.1.2.3     Parameters for text parts

The text part, in our example is in the second column.

Since we are working for this example with ‘France’ and we dont use the country  as a variable item, we can change the command : PAGE_TEXT_CENTRE :
Replace “Canada” by “France”.
Meanwhile, we can add some space by adding an extra pm in the command.
The number added, is the distance in mm : see (1)

Below we can have a line with our first variable text. Font and size need to be the same for each chapter, but the text is replaced – at the moment – by a varible. Value see (2).

For the third line, we take a fixed text line again.  We add font and size, and distance to the next line. As we don’t use any variable in this command, the text will be identical on each chapter. (3)

Our next line has variable text again. This is the second part where we use variable text (so we work in the same way as line 2 see (4).
Identically for the next line (5)

Remark : We already used HN (Helvetica Normal) en HB (Helvetica Bold). For this line we choose another command : HI (Helvetica Italic), this font is also a default font (therefore we use a 2-letter combination).

Finally we put an extra blank line to seal the second column.(6)
The codes below, replace what we already had in column 2;  only the commands!

PAGE_TEXT_CENTRE (HN 1 "" 6)

(1)       PAGE_TEXT_CENTRE (HI 42 "France" 8.0)

(2)       PAGE_TEXT_CENTRE (HN 13 $$1 1.5)
(3)       PAGE_TEXT_CENTRE (HN 13 "Definitive Series" 1.5)

(4)       PAGE_TEXT_CENTRE (HN 13 $$2 7.0)

(5)       PAGE_TEXT_CENTRE (HI 10 $$3 5.0)

(6)       PAGE_TEXT_CENTRE (HN 1 "" 10.0)

PAGE_COLUMN_STOP

6.1.2.4     Using Varibles on the album pages

Together with the image in column 1, we now have six variables in our page layout.  As long as we don’t replace the $$ with the text or images we want to see on our pages, nothing will happen. So it is time to replace the $$’s with real images and words.

Now that the Page_Start_Group has all parameters it needs, (3 for text, 3 for the image) we only need to fill out the items we want to see on our pages.

# ------------------------------------------------------------------------------

# Album Page 1
# ------------------------------------------------------------------------------

PAGE_START

PAGE_TEXT_CENTRE (HN 14 "Page One of the album")

# ------------------------------------------------------------------------------
# Album Page 2

# ------------------------------------------------------------------------------

PAGE_START

PAGE_TEXT_CENTRE (HN 14 "Page Two of the album")

In our program we have created two pages, but so far without any reference tot he variables we created. These references need to be added when we create the page. They will follow after the Page_Start-command.

Page_Start ( pm1 pm2 pm3 pm4 pm5 pm6 …. )

For page 1:

PAGE_START ("Sage Peace and Commerce" "1876 - 1900" "Designer - Jules Auguste Sage" 37.0 45.0 "stamp_images/Sage.png")

For page 2 :

PAGE_START ("Merson Liberty and Peace" "1900 - 1927" "Designer - Nicolas Luc-Olivier Merson" 80.0 45.0 "stamp_images/Merson.png")

Remark, dont forget to put any kind of text between two pair of straight double quotes. Also dates are considered as ‘text’ “1900 – 1927”.

The last 3 pm’s are for the image, width and height are not text and don’t need the quotes.
The images for this specific exercise are included in the program AlbumEasy 4.2.1 they are in the folder STAMP_IMAGES. If you work with other (own) images, you need to check in which folder and with which extention they are saved. (here PNG)

Replace the Page_start-commands above to page 1 and 2, generate the PDF, and if all goes well, close the PDF again afterwards.

If you want to make a font larger, smaller, or use a different font for your album, you can now adjust in the Page_Start_Group, and all following pages will change accordingly.

previous part : https://rainbowstampsandcoins.blogspot.com/2021/05/making-your-own-album-31.html
next part : https://rainbowstampsandcoins.blogspot.com/2021/05/making-your-own-album-33.html
 

No comments: