Right To left Text direction in [ToolTip] Is this possible Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
HiSoKa
Posts: 480
Joined: 27 Jan 2020, 15:43

Right To left Text direction in [ToolTip] Is this possible

22 Sep 2022, 02:31

I am trying to make a small hint using ToolTip Command when i using some program
But my problem is that the text that I want to show is in Arabic, and when I try to use ToolTip to show this hint the text appears unreadable for example in Notepad
When you press Ctrl + LShift, the text appears from left to right
As in the Image Bellow
l to r.png
l to r.png (14.3 KiB) Viewed 448 times
And when you press Ctrl + RShift, the text appears from right to left as you can see in the image below (This is what i wants to appear in the ToolTip)
r to l.png
r to l.png (9.37 KiB) Viewed 448 times
And note that there is a difference between the letter positions and this affects the meaning.
Is there some way to display the Text as appears when I go through the Notepad after pressing Ctrl + RShift to show my Text Right To left..
Here is the code below,

Code: Select all

#Persistent
POS_Shourtcut_Hint =
(
* عدد: مثال (*5) تغير مقدار كمية المادة لتصبح 5.
)

ToolTip, % POS_Shourtcut_Hint
SetTimer, RemoveToolTip, -5000
return

RemoveToolTip:
ToolTip
return

Esc::ExitApp
Thank you.
Rohwedder
Posts: 7768
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Right To left Text direction in [ToolTip] Is this possible

22 Sep 2022, 03:14

Hallo,
perhaps?:

Code: Select all

#Persistent
POS_Shourtcut_Hint =
(
* عدد: مثال (*5) تغير مقدار كمية المادة لتصبح 5.
)

ToolTip, % StrReverse(POS_Shourtcut_Hint)
SetTimer, RemoveToolTip, -5000
return

RemoveToolTip:
ToolTip
return

StrReverse(String)
{
    Return, DllCall("msvcrt.dll\_wcsrev", "Str", String, "CDecl Str")
}

Esc::ExitApp
User avatar
HiSoKa
Posts: 480
Joined: 27 Jan 2020, 15:43

Re: Right To left Text direction in [ToolTip] Is this possible

22 Sep 2022, 03:27

Thanks @Rohwedder
But I got completely reversed text and inconsistent characters
I got this text
.5 حبصتل ةداملا ةيمك رادقم ريغت )5*( لاثم :ددع *
In my case, the text should be as follows
r to l.png
r to l.png (9.37 KiB) Viewed 423 times
This is the main text.
* عدد: مثال (*5) تغير مقدار كمية المادة لتصبح 5.
My problem is that Text appears for me from left to right, that's why the positions of some characters change (And that's what I don't want)
You can copy the text to Notepad and switch the text direction from right to left using Ctrl + RShift to notice the difference
BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: Right To left Text direction in [ToolTip] Is this possible  Topic is solved

22 Sep 2022, 03:33

@Rohwedder - Nice try :mrgreen: AFAICS, it mirrors the sentence vertically (quite interesting the appearance of the brackets)

Code: Select all

#SingleInstance, Force

str := "عدد: مثال (*5) تغير مقدار كمية المادة لتصبح 5"
toolTip(str, 5)

toolTip(msg, delay) {
   Gui, Color, white
   Gui, -caption +border
   Gui, Add, Text,w420 +0x2,% ". " . msg . " *"
   Gui, Show,,
   Sleep % delay*1000
   Gui, Destroy
   }
 
Esc::ExitApp

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Draken, Google [Bot], oktavimark and 311 guests