A HOME FOR ANYONE ADDICTED TO ARABIC.

JOIN ARABIC FOR NERDS➕

Support this site with a membership: For only $1.99 a month or $19.99 a year, you can have a true AD-FREE experience. You also get a 15% discount in my shop and a monthly premium newsletter. Find out more here.

Help this site

Passion doesn't need money. Unfortunately, my web provider does. Your contribution ensures that this site will grow and grow.


Buy Me A Coffee

Donate

tashkeel color

How do you change the color of Arabic vowels (diacritics) in LibreOffice and Microsoft Word?

LibreOffice – unlike Microsoft Word – does not offer to change the color of Arabic diacritical marks (tashkeel/harakat). However, there are two tricks.

Last updated: June 2, 2021

I like open-source software and have been using LibreOffice for many years. I haven’t encountered many – actually: any – disadvantages compared to Microsoft Office – except one: the ability to set different colors for tashkeel markers (تَشْكِيل) in Arabic!

Using colors for diacritical marks in LibreOffice has been a topic in forums for many years. I have no idea why it has never been implemented since it seems to me that this shouldn’t cause too many difficulties. However, at least there are two tricks which partially solve our problem.

The basics

What are diacritical marks in computer terms?

In Arabic, diacritical marks (Tashkeel), the Harakat or short vowel marks, are separate glyphs. So, basically, they are separate letters. This should give us the option to select them and change the size, font or color.


How can I add Taskheel?

This is an easy task. You just type the Arabic letter and then add the diacritical mark you want. For example, you type the Arabic letter ب and then press Shift+q which produces a Fatha (فتحة) resulting in: بَ

  • Vowel Fatha: shift + q
  • Fatha with Tanween: shift + w
  • Vowel Kasra: shift + a
  • Kasra with Tanween: shift + s
  • Vowel Damma: shift + e
  • Damma with Tanween: shift + r
  • Non-vowel Sukuun: shift + x
  • Shadda: shift + tilde key (in German: °)

OPTION 1: Using a makro

This is the sophisticated solution. With a simple click, you can automatically change the color of every diacritical mark automatically. However, you have to choose the color in advance and edit a macro. I use the macro provided by user pᴇʜ.

A macro is a saved sequence of commands or keystrokes that are stored for later use. Macros are very useful when you have to repeat the same task in the same way over and over again. LibreOffice’s macros are usually written in a language called LibreOffice Basic, sometimes abbreviated to Basic.


Necessary steps

#1: Click Tools – Makros – Edit macros.
#2: Copy the source code (from below) and paste it.
#3: Press save.
#4: Now, you can execute the macro.

makro2
Once you have pasted the source code and saved it, you will see the name of the makro “ChangeTashkeelColors” – and can execute it!

The source code of the makro

Copy and paste the following source code:

Sub ChangeTashkeelColors
 CrRepDesc = ThisComponent.createReplaceDescriptor
 CrRepDesc.searchRegularExpression = True
 CrRepDesc.searchString = "َ" ' Unicode Character 'ARABIC FATHA' (U+064E) or Shift+q on the Arabic keyboard
 FnAllRepDesc = ThisComponent.findAll(CrRepDesc)
 for i = 0 to FnAllRepDesc.count-1
     FoundTxt = FnAllRepDesc.getByIndex(i)
     FoundTxt.CharColor = 1400606  ' Dark Green Color
 next i
 CrRepDesc = ThisComponent.createReplaceDescriptor
 CrRepDesc.searchRegularExpression = True
 CrRepDesc.searchString = "ً" ' Unicode Character 'ARABIC FATHATAN' (U+064B) or Shift+w on the Arabic keyboard
 FnAllRepDesc = ThisComponent.findAll(CrRepDesc)
 for i = 0 to FnAllRepDesc.count-1
     FoundTxt = FnAllRepDesc.getByIndex(i)
     FoundTxt.CharColor = 9498256 ' Light Green Color
 next i
 CrRepDesc = ThisComponent.createReplaceDescriptor
 CrRepDesc.searchRegularExpression = True
 CrRepDesc.searchString = "ُ" ' Unicode Character 'ARABIC DAMMA' (U+064F) or Shift+e on the Arabic keyboard
 FnAllRepDesc = ThisComponent.findAll(CrRepDesc)
 for i = 0 to FnAllRepDesc.count-1
     FoundTxt = FnAllRepDesc.getByIndex(i)
     FoundTxt.CharColor = 9109504 ' Dark Red Color
 next i
 CrRepDesc = ThisComponent.createReplaceDescriptor
 CrRepDesc.searchRegularExpression = True
 CrRepDesc.searchString = "ٌ" 'Unicode Character 'ARABIC DAMMATAN' (U+064C) or Shift+r on the Arabic keyboard
 FnAllRepDesc = ThisComponent.findAll(CrRepDesc)
 for i = 0 to FnAllRepDesc.count-1
     FoundTxt = FnAllRepDesc.getByIndex(i)
     FoundTxt.CharColor = 16764107 ' Light Red Color 
 next i
 CrRepDesc = ThisComponent.createReplaceDescriptor
 CrRepDesc.searchRegularExpression = True
 CrRepDesc.searchString = "ِ" ' Unicode Character 'ARABIC KASRA' (U+0650) or Shift+a on the Arabic keyboard
 FnAllRepDesc = ThisComponent.findAll(CrRepDesc)
 for i = 0 to FnAllRepDesc.count-1
     FoundTxt = FnAllRepDesc.getByIndex(i)
     FoundTxt.CharColor = 139 ' Dark Blue Color
 next i
 CrRepDesc = ThisComponent.createReplaceDescriptor
 CrRepDesc.searchRegularExpression = True
 CrRepDesc.searchString = "ٍ" ' Unicode Character 'ARABIC KASRATAN' (U+064D) or Shift+s on the Arabic keyboard
 FnAllRepDesc = ThisComponent.findAll(CrRepDesc)
 for i = 0 to FnAllRepDesc.count-1
     FoundTxt = FnAllRepDesc.getByIndex(i)
     FoundTxt.CharColor = 11393254 ' Light Blue Color
 next i
 CrRepDesc = ThisComponent.createReplaceDescriptor
 CrRepDesc.searchRegularExpression = True
 CrRepDesc.searchString = "ْ" ' Unicode Character 'ARABIC SUKUUN' (U+0652) or Shift+x on the Arabic keyboard
 FnAllRepDesc = ThisComponent.findAll(CrRepDesc)
 for i = 0 to FnAllRepDesc.count-1
     FoundTxt = FnAllRepDesc.getByIndex(i)
     FoundTxt.CharColor = 16753920 ' Orange Color
 next i
 CrRepDesc = ThisComponent.createReplaceDescriptor
 CrRepDesc.searchRegularExpression = True
 CrRepDesc.searchString = "ّ" ' Unicode Character 'ARABIC SHADDA' (U+0651) or Shift+^ on the Arabic keyboard
 FnAllRepDesc = ThisComponent.findAll(CrRepDesc)
 for i = 0 to FnAllRepDesc.count-1
     FoundTxt = FnAllRepDesc.getByIndex(i)
     FoundTxt.CharColor = 6950317 ' Purple Color
 next i
 End Sub

The result

makro3
This is the result using a macro.

Converting colors from hex to decimal

In the macro, I used the decimal value of colors (and not the hex or rgb value). You can easily convert colors to a decimal value using this website: https://convertingcolors.com/


OPTION 2: Using search and replace

Since diacritical marks are separate signs we can also just use the “search and replace” option of LibreOffice. It is actually pretty easy but you need to do it for every sign.

You need to check the following 3 options. Afterwards, don’t forget to change the color (step 4).

tashkeel example2

#1: Regular expressions
#2: Diacritic-sensitive
#3: Kashida-sensitive
#4: Press “Format” and then, on the second tab (“effects”), choose a color.

The result

This is the result. Note that the “Fatha” is not perfectly placed. You may have to adjust the font size (which can be done using the “format”-option of search and replace).

If you know any other solution, please let me know!


Colored Tashkeel in Microsoft Word

In MS Word, you can easily use colored diacritical marks – however, you can only use one color for all marks.

Go to File > Options > Advanced. Under the section “Show document content”, you will see “Diacritics – Use this color for diacritics”. Choose the color you want.

If you can’t find this option there, make sure that Arabic is added to the Editing Languages in File > Options > Language.


Note: Both options also work for other Semitic languages too – for example, for Hebrew.

picture credit: Gerald Drißner; Myriam Zilles from Pixabay

Total
3
Shares

Any thoughts or ideas about this? Leave a reply!

Previous Article
minaret

Did the first mosques in Islam have minarets?

Next Article
berlin

20 questions for: Andreas Dietrich (#26)

Related Posts
Arabic for Nerds
0
    0
    Your Cart
    Your cart is emptyReturn to Shop
      Calculate Shipping
      Apply Coupon