How to Color Arabic Diacritics (Tashkeel) in LibreOffice: 3 Easy Methods

This guide offers solutions for coloring Arabic diacritical marks (tashkeel, ุชูŽุดู’ูƒููŠู„) in LibreOffice and Microsoft Word. Learn to use macros, search-and-replace functions, and the Mishkallo extension to enhance Arabic text readability.
A colorful assortment of crayons in various hues including red, orange, yellow, green, blue, and purple, with visible black stripes near the base of each crayon, arranged in a scattered manner on a surface.

Last updated 1 year ago.

Setting different colors for Arabic diacritical marks (tashkeel, ุชูŽุดู’ูƒููŠู„) in LibreOffice can be challenging, but effective tricks and extensions offer solutions.

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 diacritical markerstashkeel (ุชูŽุดู’ูƒููŠู„) – 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.

screenshot LibreOffice

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. Afterward, 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).

OPTION 3: LibreOffice extension Mishkallo

In December 2021, a new LibreOffice extension appeared. It is called Mishkallo and was developed by mejlad alsubaie. Besides using colors for thetashkeel, it actually puts tashkeel automatically on words – but watch out, there are mistakes! (always double check manually).

mishkallo
Screenshot mishkallo from LibreOffice extension repo.

You can download it here: https://extensions.libreoffice.org/en/extensions/show/5805

You should use English, Arabic or French as your user interface language – otherwise, it does not work. Furthermore, make sure that you have libreoffice-script-provider-python installed

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.

256fb384f2f8487883424e8f6f3fbe98
Wanna cite this article?

DriรŸner, G. (2021, March 15). How to Color Arabic Diacritics (Tashkeel) in LibreOffice: 3 Easy Methods. Arabic for Nerds. https://arabic-for-nerds.com/tools/change-color-of-arabic-vowels-diacritics-libreoffice-microsoft-word/

Published: March 15, 2021

Please check the citation before use, especially if your style guide has local requirements.

Publication ISSN: 3055-1730

Subscribe
Notify of

Join the discussion: Sign in with social media for instant commenting, or register with email (comments require approval):

guest

14 Comments
James
James
2 years ago

FYI, in Word for Mac, click “WORD”, “PREFERENCES”, “VIEW”. “Diacritics” is about middle of the window pane that opens and you can pick color to display.

khalid
khalid
2 years ago

voici l’erreur, merci

An error message indicating a ModuleNotFoundError for 'sqlite3' in LibreOffice, detailing the file paths and lines where the error occurred.
khalid
khalid
2 years ago

comment corriger cette erreur de l’extension “mishkal” dans libre office writer

Wolfram Eisenecker
Wolfram Eisenecker
3 years ago

Hello,

I’m looking for a way to color diacritical marks in Hebrew. I guess it should be possible by applying the steps in the third method by I can’t get it to work.

I followed every step and checked every box (except kashida sensitive) and clicked replace but it won’t work. I’m probably missing something but I don’t know what.

With regards

Wolfram

Holger
Holger
3 years ago

Hallo ,

entschuldige dass ich deutsch schreibe…

Vielen Dank fรผr diesen Post , ich hab schon lange nach einer Mรถglichkeit gesucht die Farben der Vokale etc. zu รคndern.

Nun meine Frage ( bin kein Computerexperte ) : benรถtigt man fรผr https://extensions.libreoffice.org/en/extensions/show/5805 eine bestimmte libreofffice-version und funktioniert dies nur mit linux ?

MfG

Holger

Holger
Holger
3 years ago

Danke fรผr die Rรผckmeldung

Ich arbeite mit momentan Windows

Also Punkt 1 mit ‘ Makro ‘ , Punkt 2 mit ‘ Suchen und Ersetzen ‘ hier gibt es keine Probleme nur Punkt 3 ‘ extension Mishkallo ‘ funktioniert nicht ist aber nicht schlimm.

Das Problem ist aber, dass sich die Position der Vokale nach ihrer Fรคrbung รคndert , wie z.B. das Fathah und das Dammah nicht an ihrer richtigen Position stehen ( siehe Beispiel ) , ich weiรŸ nicht ob man wie und ob man dies lรถsen kann .

Mfg

Holger

The image features two Arabic phrases written in decorative script. The top phrase, labeled 'vorher,' reads 'ุงู„ู…ุตู†ู' (al-Muแนฃannaf), and the bottom phrase, labeled 'nachher,' also reads 'ุงู„ู…ุตู†ู' (al-Muแนฃannaf), with numerals color-coded beside each phrase. The contrasting labels suggest a before-and-after context.
mejlad
mejlad
3 years ago
Reply to  Holger

Hello, the extension currently works on Linux only in all versions, as I remember. I have not tried it on a Mac. If you own Mac devices, please let me know if it works. Regarding the problem of changing places after coloring, the problem is in LibreOffice, see here

Previous Article
Stylized illustration of a mosque with a tall minaret topped by a crescent moon and star, a large blue dome, and palm trees in the background under a light sky.

The History of the Minaret: From Prayer Call to Islamic Icon

Next Article
A street scene in Berlin featuring a mix of architectural styles with an orange building on the left, tram tracks weaving through the road, and the iconic TV Tower in the background against a clear sky.

"Learning (languages) should become a joy, your job, and a friend" | Andreas Dietrich | 9273 Roots #26

โžค DIDN'T FIND WHAT YOU ARE LOOKING FOR?

You may also like
Choose a social network
Choose a social network
Choose a social network
Choose a social network