Wednesday, April 7, 2021

Making your own album 06

Scroll down for previous entries...

3.2     Aligning texts (1 B)

Open AlbumEasy 4.2.1 and open the last document : ‘Testdesign 1’
As we will continue working on this document, we can save it as ‘testdocument 2’
There is an icon with a disk and a pen. This button helps us to ‘save as… ‘

By recycling the previous design, we don’t have to program basic data, such as album settings, margins, sizes …. Now delete the last 4 lines, so that ‘ Page_Start’ becomes the last line in your code.

As title, we just typed ‘ Title Text’ last time. We need a more suitable title, so we can change the words “title text” to “my collection”.
Be careful, not to erase the double quotes at the beginning and the end.
As an extra exercise, we can change the size of the title text from 16 to 20.

3.2.1   Adding subtitles or texts and spacing them

Often we want to add more info to a page, than just a title:

·        A subtitle    a chapter    a date or an era     a subject 

      We already saw the command  ‘Page_Text’ or ‘Page_Text_Centre’ to add additional texts.
By using  ‘Page_Text_Centre’, we can clearly see, what different spacing can do to a text.

The command ‘Page_Text_Centre’ is followed by 3 pm, inserted between round brackets.  (…….)

·        Font and size

·        The text that we want to sea on our page. For the programming, this text needs to be placed between (straight) double quotes!

PAGE_TEXT_CENTRE (HB 12 "This exercise shows how we can define the TEXT_CHAR_SPACING command so that we can align texts over several text lines.")

Remark! Between the ‘straight’ quotes, we can put any text we like, it will be read as text, not as a command. ( pm 1 pm 2 “pm3”) is the basic setting. For example (HN 15 “text”)

Between the double quotes, we cannot put “, if we want to put a “-sign, we have to use a single quote ‘
Round brackets, can be put within the text part, as long as they are within the double quotes.
ex: (HN 15 text (ok) text).

Add the program code lines to the program, and add if you wish, an extra comment line below the command.  Of course, preceeded by a hashtag #


Because we want to try out a specific non-standard spacing, a new command is needed.  This command is to be placed before the Page_Text_Centre line, because it will determinate the lines that follow.

 

TEXT_CHAR_SPACING (0.5)

This command is followed by one parameter (pm) it gives the distance in mm between the letters.
Insert following commands into the program.

PAGE_TEXT_CENTRE (HN 16 "a text line with normal spacing :(normal is 0)")
TEXT_CHAR_SPACING
(0.5)

PAGE_TEXT_CENTRE (HN 16 "now with 0.5mm spacing")
TEXT_CHAR_SPACING
(2.0)
PAGE_TEXT_CENTRE
(HN 16 "here with 2.0mm spacing")
TEXT_CHAR_SPACING
(-0.5)
PAGE_TEXT_CENTRE
(HN 16 "with a negative spacing of -0.5mm")
TEXT_CHAR_SPACING
(0.0)
PAGE_TEXT_CENTRE
(HN 16 "and back to normal (inter-character space is 0)")

Click on Generate and on PDF.
In case the PDF isn’t opening, it means that the previous one is still open. Close it and try it again.

 

Now close the PDF page before changing commands in your program.

Try to change some parameters or commands :

·        Change Page_Text_Centre to Page_Text
Change spacing (more wide/more narrow)

Change font and/or size (we know already TB / HN), now use TN en HB
(TN is TimeNewRoman (Normal) / HB is Helvetica (Bold))

3.2.2     Splitting lines

In the previous example, the text “This exercise…. “ was split after ‘so’.
This is because we centered the text.
It would be nicer to split the lines elsewhere, and we can determinate that too.

When programming, the program does not care on which line we type something. The program just executes commands line after line. If we start typing on another line, the program will just do as before in the previous exercise.
In order to ‘force’ a new line, we have to program it.

We can do it, by adding a \n there were we want to split the line.

Look in your program so far for the following text, and add some \n-commands.

PAGE_TEXT_CENTRE (HB 12 "\nThis exercise shows \nhow we can define the TEXT_CHAR_SPACING command \nso that we can align texts over several text lines.")

Remark! : visually, it would be nicer to add a blank space after the \n-command. Yet, because \n  is a command, that can be used within a text. The addition of that extra blank space would also add an extra blank space in your text. Therefore you can just stick the \n -command directly to the first word that should come on the next line.

The \n command only works within the double straight quotes, that indicate the visual text on the result. It can be placed at the end of this ‘quoted’ text, as long as it is placed before the closing quote-sign and the final round bracket.

Leaving empty lines in your program code, has no effect, the program will not execute them.

If needed, close the PDF before you alter the command.
When done, click generate and PDF.

 

For more options, go to module 2B, or start a new theme in 1C

to be continued...

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

No comments: