About Me


Sunday, 13 March 2016

More on RTL – A Font Macro Bug fixed with (a) Style


Yet another RTL comment. I’ve been looking forward to sharing other kinds of discoveries, but I keep encountering problems/features with the Office 2016 Mac implementation of RTL.

Today I will discuss how to set up your system so that you can change fonts and keyboards with a single keystroke.

Assign a Shortcut Key to the LTR/RTL buttons
Office 365/2016 Mac does have Shortcut Keys assigned to these buttons by default, but it is a good idea to do so, especially if you would like to include the command as part of a Macro.
1.     Go to Tools/Customise Keyboard.
2.    Under Categories, choose Format
3.    In the Commands box, scroll down to LtrPara and assign a Shortcut Key. Do the same for RtlPara.

Record Macro. A Macro is a program, a set of instructions telling the computer what to do. Microsoft Office provides a programming language called Visual Basic for Applications, a.k.a. VBA. But Microsoft has provided something more. We don’t need to program using VBA; we can ‘Record’ a Macro. The overall concept is to start Record Macro, type what we want, including shortcut keys, then Stop Recording.

Macros will only record keystrokes (with certain exceptions). For example, if we want to bring up the Font Menu to change fonts, we must use Cmd + D or Cmd + Shift + F (both work). Record Macro will not recognise Format/Font.

To begin, find Record Macro by going to Tools/Macro/Record Macro. Alternatively, before recording, Show the developer tab.
1.    On the Word menu, click Preferences.
2.    Under Authoring and Proofing Tools, click View.
3.    Under Ribbon (at the bottom of the menu), check the Show developer tab box.
After you show the tab, it stays visible in your ribbon, unless you clear the check box or have to reinstall a Microsoft Office program.

Next we will Record a Macro that sets the shortcut key, control (cntl) + 8 to change the font to Ezra Sil 14pt.

1.    Developer/Record Macro.
2.    Give your Macro a Title (no spaces)
3.    Assign a keyboard shortcut not otherwise used: press control (cntl) + 8
4.    Bring up the Font Menu with cmd + D
5.    Change the Font to Ezra Sil 14
6.    Stop Recording

Here is a video of the process and how control (cntl + 8) change the font.



If you go to Developer/Macro and highlight the Macro entitled Ezra Sil, then press Edit, you will see the VBA of your Macro. Here are the first vew lines.

' EzraSil Macro
'
'
    With Selection.Font
        .Name = "Ezra SIL"
        .Size = 14
        .Bold = False
        .Italic = False
       

With a program like Keyboard Maestro, we can insert this Font Macro (via cntl + 8) into another Macro, which will change the keyboard at the same time.

But before providing these instructions…there is a Bug!!!

Changing a Font with a Macro Aborts when an RTL language is activated
As I have shown over the last two posts, an RTL language is set if you can see the LTR/RTL buttons. In the recording above, you can see that there are no buttons, so RTL is ‘off’. Here is what happens when you try to create Font Change Macro when the buttons are on, using the same instructions as above.




As you can see from the first few lines, even though I changed the font to Ezra Sil, it issues three strange commands related to Times New Roman, and these cause the error. Notice how they differ from the earlier Macro.

With Selection.Font
        .NameFarEast = "Times New Roman"
        .NameAscii = "Times New Roman"
        .NameOther = "Times New Roman"
        .Size = 14
        .Bold = False

This does not occur with RTL in Windows Office 2016. The problem seems to be related to the font, because other kinds of Macros I tested work fine.

Solutions – I know of two workarounds, so far.

Option 1 – Create all your Font Macros with RTL off. This is not entirely crazy. Those Macros generated when an RTL is not activated will still work when one is set.

Option 2 – Don’t use Macros for the font changes; rather create a new Character Style with a Shortcut Key.

Good basic articles on what styles are and how they work are two by Shauna Kelly. She passed away in 2011, but I have read many of her articles and they remain extraordinarily helpful. These articles about Windows Office, but the concepts are the same: http://shaunakelly.com/word/styles/stylesms.html and http://shaunakelly.com/word/styles/howstylescascade.html and one by Microsoft: https://support.office.com/en-gb/article/Apply-change-create-or-delete-a-style-1a2cead9-897f-48a7-9122-7849d3b5030a

Option 2 - Create a New Font Style
1.     On the Home tab click on the Styles Pane



2.    Choose New Style.

3.    A window will pop up.



4.    Change the name, Style1, to something that will help you find it, like Ezra Sil. You can use spaces.

5.     This is Very Important – Change the style type from Paragraph to Character. Otherwise you will not be able to have two different fonts in the same sentence or paragraph, which is defined as anything before you hit return. Trust me on this. The explanation is tedious.

6.    Leave Style based on as Default Paragraph font that appears when you set the Style type to Character.

7.     Then in Formatting, change the Font and Pointing to what you want for this Font Style. If this is for an RTL language, click the button that defaults to Latin, and change it to Complex. This is very important, otherwise Word will not recognise it as a Complex font and will automatically change to the default Complex font found in Format/Font.  

8.    At the bottom of the menu make sure you tick Add to Template, if you want to use this Style for other documents, which your probably do. I do not bother with the Add to Quick Style Gallery, because it is redundant if you set a shortcut key, as in the next instruction. What it does is place this style in the Quick Style Pane, the pictures to the left of the Styles Pane. Here is my Ezra Sil 14.



9.    Next, in the lower left corner, there is a button labelled Format. Click this and button and click Shortcut Keys. Choose a Shortcut Key combination.

10.  You will also want to set a Character Style with shortcut key for your preferred English Font.

11.   Repeat the above for all fonts that you will want. Make sure to include an English font as well. This font is likely already in the Normal Paragraph style, but clicking on this will not change the font if the Character Style is set to Styles Based on: Default Paragraph Style.

12.  To modify or delete this or any Style, you can go to Tools/Style and choose your preference. Alternatively, in the Styles Pane, find the Ezra Sil style. It as a small ‘a’ on the right in blue. However over it, and a button will appear. Click the button, and another menu pops up that allows you to modify or delete. BTW, the little ‘a’ means it is a Character Style, while a backwards ‘p’ (remember, ‘pilcrow’), a Paragraph Style.


Macro to Keyboard and Font - The Keyboards in the Apple Mac Input Menu are not accessible by a Macro in Microsoft Word; those can only control things in Word. But programs like Keyboard Maestro are designed for this.

Here is my Macro for Hebrew. Yes, it’s only two commands. Simple eh?



Now, here is my Macro for switching back to English. Notice the additional instruction, control (cntl) + L (KM puts the ‘L’ in uppercase, even though there is no shift). This is my Shortcut combination for the LTR button.




Third party or Customised Keyboards like Syriac and Hebrew TH (Tyndale House) – As discussed above, Office 2016 Mac, even Version 15.20, does not recognise these Keyboards as RTL.

Solution – The workaround is the same one discussed on Monday, 7 March 2016. First activate an RTL Keyboard that from the Apple Mac bundle. Then execute activate the Customised Keyboard.

Here is my KM Macro to accomplish. cmd + E and cmd + H are the Shortcut keys for my KM Macros for English and Hebrew, shown above. Also, make sure you change the Font before you change Keyboards. For some reason, the Shortcut Key for the Font within Office 2016 Mac will not work once you have changed to the Customised keyboard.





Remember, if you are starting any Keyboard with a word in an RTL language, it will automatically justify to the right margin of your document. If you want it to begin a sentence or paragraph that is essentially LTR, like English, just press the LTR button or your Shortcut Key.

Thursday, 10 March 2016

RTL and Version 15.20 - Getting closer, but more to do

At long last, as of 8 March 2016 and the update numbered 15.20, Microsoft Office 2016 Mac now supports RTL for all its programs. including Word, Excel and PowerPoint. The much sought after LTR/RTL buttons are there. For further details, see the two previous posts.

Today, I will discuss what works and what does not in this new Mac RTL implementation.

Coaxing the LTR/RTL out of hiding – bug or feature?
The following happened to someone I know.

You have just downloaded Office 2016 Mac and have updated to version 15.20. ‘But wait,’ you say…’the LTR/RTL buttons aren’t there!!! What happened?’

You dutifully check that you have the right version of Office by opening any application like Word (or Excel, PowerPoint), clicking on its name in the upper left corner, then choosing About Word. Yes, it’s confirmed, you have version 15.20 (or higher), but no LTR/RTL buttons (if it’s 15.19 or earlier, you need to update; see the previous post).

Solution – The problem is that you do not have any Apple RTL languages set either as a Preferred Language in Language & Regions or as an Input Source in Keyboard Preferences. Evidently, Microsoft assumes that if you do not have an RTL language activated, you do not want the LTR/RTL buttons.

You just need to set one language in one of two places.

To add a preference to Language & Regions: https://support.apple.com/kb/PH21549?locale=en_US&viewlocale=en_US



For Input Sources: 




‘But wait,’ you say, ‘I do have an RTL Input Source that I created/downloaded!’

Ahhhhh. This is an issue with Office 2016 Mac. It does not recognise as RTL the custom RTL keyboards that you create or download, like Syriac JChill or Hebrew TH from Tyndale House. I described this problem with regard to Syriac keyboards as the Issue #2 in my post from 7 March, 2016, and will reiterate the workaround below. But for purposes of the buttons being deployed on the ribbon, you must have an Apple RTL keyboard activated.

Which are the Apple keyboards? Any keyboard in Other in Input Sources. You can see from the Screenshot that all the custom keyboards are in Other. They are also not available as options in Languages & Regions.



I suspect the problem is that the custom keyboards are not in the same keyboard library and have different extensions from the Apple bundle. I have no idea if this can be changed or whether they will be recognised in a future Office update.

In any case, if you want the LTR/RTL buttons to show, you must have an Apple RTL language set as a Preferred Language or Input Source. You do not have to use them; they just need to be there.

Keyboards

1.    In sum, any Apple RTL keyboard will render RTL correctly, whether it begins on the left or right. This includes beginning a paragraph/sentence with an RTL Hebrew or Arabic Word, Issue #1 in Monday’s post. If you want a LTR paragraph, but begin with an RTL word, the keyboard will automatically position the cursor on the right side. But now, all you have to do is press the LTR button and cursor will move to the other side.





You can also Copy & Paste from programs like Accordance, BibleWorks and Logos correctly as described in Monday’s post.

But now, you can also copy & paste from any website, including STEP (Scholarly Tools for Every Person): http://www.tyndale.cam.a.uk/step


2.   Custom RTL keyboards, like Syriac JChill and Hebrew TH –As just discussed, these keyboards are not recognised as RTL, and thus do not reveal the new LTR/RTL buttons. Another consequence is that they will not allow you to type RTL without first activating an Apple RTL keyboard, like Hebrew QWERTY. Office 2016 Mac thinks they are English LTR, and changing the LTR/RTL buttons has no effect.

Solution – Before you switch to Syriac or Hebrew TH, first insert a Hebrew (or Arabic), space or symbol that you can later remove. Alternatively, you can highlight and remove it right away. This procedure activates the RTL keyboard. Switch to your preferred custom keyboard and away you go. I strongly suggest you create a Macro to do all this. If you use Keyboard Maestro or a similar system level program, you can put all this into a single keystroke.

Fonts
1.    The official support for RTL brings with it another Font option. Now, as in the Windows version, you can have a ‘complex’ font linked automatically with your RTL. Now you can just change the keyboard to your favourite RTL, the font will change at the same time. This is great if you use the same font with every RTL keyboard. You will still need to change manually the font and keyboard for others. Again, a Macro is recommended.

2.   I mentioned in Monday’s post that not all RTL fonts are created equal. They are not endowed by their creator with certain inalienable rights… (oops sorry, ‘created equal’ brought the ‘Declaration’ to mind).

Things have not changed much with the 15.20 RTL update. All Unicode fonts work well as long as you use consonants only.

For Hebrew fonts and accents:
Ezra Sil is still the best.
Cardo works well, except for a copy & paste from Accordance. All other programs and the internet work fine.
SBL Hebrew and SBL BibLit still do not align accented and unaccented vowel points.
Times New Roman now does render unaccented vowel points properly, but not accented.

That’s all for now. Mac RTL Users, enjoy the improvements.  Almost there!