Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix arabic font mono keepass #20473

Open
ghost opened this issue Oct 10, 2020 · 4 comments
Open

Fix arabic font mono keepass #20473

ghost opened this issue Oct 10, 2020 · 4 comments

Comments

@ghost
Copy link

ghost commented Oct 10, 2020

Hello .. as you see in screenshot the arabic text displayed in reversed and seperated way ...

Even if i change font .. (most of them show arabic as rectangle) .

kp

You can copy this sample text for quick test ... and also copy it to any text editor (leafpad,kwrite,gedit,kate) to see how should text look like OR as you see here is right ... :

Sample Text:{

هذه جملة أو عبارة عن جملة للتجربة....
this is a test sentence....

كيباس هو مدير كلمات مرور مجاني ومفتوح المصدر لنظام ويندوز بشكل أساسي.
keepass is a free and open-source password manager primarily for Windows.

يدعم رسميًا أنظمة تشغيل الماك و لينوكس من خلال استخدام مونو.
It officially supports macOS and Linux operating systems through the use of Mono.

بالإضافة إلى ذلك ، هناك العديد من المنافذ غير الرسمية لأجهزة Windows Phone و Android و iOS و BlackBerry.
Additionally, there are several unofficial ports for Windows Phone, Android, iOS, and BlackBerry devices.

}

------------------------------ more info

2020@2020:~$ mono --version
Mono JIT compiler version 4.6.2 (Debian 4.6.2.7+dfsg-1ubuntu1)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: amd64
Disabled: none
Misc: softdebug
LLVM: supported, not enabled.
GC: sgen

2020@2020:~$ uname -a
Linux ubuntu-budgie-18.04 4.15.0-20-generic #21-Ubuntu SMP Tue Apr 24 06:16:15 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

I also test it on kubuntu 18.04 with mono version 6 ... same result.

If i run keepass from command line with terminal like this: (mono "/mnt/shared/KeePass.exe") no log or problem ...

The KeePass developer say : "KeePass in Windows seems to handle the font correctly, so it seems likely the mono font selection doesn't work correctly."

@HinTak
Copy link
Contributor

HinTak commented Oct 11, 2020

It is not font selection but text shaping. On linux, you need to have at least some Arabic fonts installed first. One of google noto Arabic fonts should be available on Ubuntu 18.x. Mono 4.6 is maybe 5 years old? Your messages says 2014... Anyway, besides having at least one Arabic fonts, you need to have a text shaping engine that understands Arabic. On windows, that's uniscribe. On mac os x, it is coretext, on linux that's harfbuzz.

I think recent mono (5,6...) can use coretext on mac os x, but I am quite sure mono on linux does not yet use harfbuzz. Pango (which mono may or may not use) on linux is quite limited in Arabic capabilities.

@ghost
Copy link
Author

ghost commented Oct 13, 2020

Is that mean there is no hope or workaround ?

Here is another test with Lubuntu 20.04
I installed these packages with synaptic:

  • libharfbuzz-bin 2.6.4
  • libpango-1.0-0 1.44.7 and libpangocairo-1.0-0 1.44.7 <<< are already installed
  • fonts-sil-scheherazade 2.100 <<< Arabic support font
  • mono-complete version 6.8

Then i opened mono/KeePass ,changing font ... and got same result.


Another test ... i installed current latest wine-mono-5.1.1-x86.msi with wine ..... and run it (:~$ wine /path/to/keepass.exe)
And it's works!

02

But then i am facing another issues ....

1.first ...... whereas they work with mono complete, plugins cannot be loaded because according to different sources the easiest way to make plugins work is installing mono-complete and wine-mono-5.1.1 seems not equal to mono-complete !

01

2.second ...... cannot render color format of entries whereas it's works with mono-complete ...

3.third ....... if i add and enable Arabic.lngx language for the UI .. there is a lot of bugs should be fixed ... this screenshot explain :

03

  1. when i close program i got this log in terminal , i don't knew if related or not ...

2020:~$ wine /mnt/4FE1559C3983C80F/desktop/KeePass-O/KeePass.exe
0126:err:listview:LISTVIEW_WindowProc unknown msg 1091 wp=00000001 lp=00c4d198
0126:err:listview:LISTVIEW_WindowProc unknown msg 1096 wp=00000000 lp=00000000
0126:err:listview:LISTVIEW_WindowProc unknown msg 1091 wp=00000001 lp=00dfe0d8

Unhandled Exception:
System.InvalidOperationException: Invoke or BeginInvoke cannot be called on a control until the window handle has been created.
at System.Windows.Forms.Control.MarshaledInvoke (System.Windows.Forms.Control caller, System.Delegate method, System.Object[] args, System.Boolean synchronous) [0x00011] in <4b7d326f792d4378bd436300c6961411>:0
at (wrapper remoting-invoke-with-check) System.Windows.Forms.Control.MarshaledInvoke(System.Windows.Forms.Control,System.Delegate,object[],bool)
at System.Windows.Forms.Control.BeginInvoke (System.Delegate method, System.Object[] args) [0x0000f] in <4b7d326f792d4378bd436300c6961411>:0
at (wrapper remoting-invoke-with-check) System.Windows.Forms.Control.BeginInvoke(System.Delegate,object[])
at System.Windows.Forms.WindowsFormsSynchronizationContext.Post (System.Threading.SendOrPostCallback d, System.Object state) [0x0000f] in <4b7d326f792d4378bd436300c6961411>:0
at System.__ComObject.Finalize () [0x0001a] in <7713cb95b33244ed9608bf0b23fbdce9>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.InvalidOperationException: Invoke or BeginInvoke cannot be called on a control until the window handle has been created.
at System.Windows.Forms.Control.MarshaledInvoke (System.Windows.Forms.Control caller, System.Delegate method, System.Object[] args, System.Boolean synchronous) [0x00011] in <4b7d326f792d4378bd436300c6961411>:0
at (wrapper remoting-invoke-with-check) System.Windows.Forms.Control.MarshaledInvoke(System.Windows.Forms.Control,System.Delegate,object[],bool)
at System.Windows.Forms.Control.BeginInvoke (System.Delegate method, System.Object[] args) [0x0000f] in <4b7d326f792d4378bd436300c6961411>:0
at (wrapper remoting-invoke-with-check) System.Windows.Forms.Control.BeginInvoke(System.Delegate,object[])
at System.Windows.Forms.WindowsFormsSynchronizationContext.Post (System.Threading.SendOrPostCallback d, System.Object state) [0x0000f] in <4b7d326f792d4378bd436300c6961411>:0
you are registering the same counter address twice: Discarded method code at 103A167C
you are registering the same counter address twice: Time spent JITting discarded code at 103A1680
you are registering the same counter address twice: Try holes memory size at 103A1688
you are registering the same counter address twice: Dynamic code allocs at 103AEA20
you are registering the same counter address twice: Dynamic code bytes at 103AEA24
you are registering the same counter address twice: Dynamic code frees at 103AEA28
you are registering the same counter address twice: Unwind info size at 103A1F00
you are registering the same counter address twice: Calls to trampolines at 103A1CE8
you are registering the same counter address twice: JIT trampolines at 103A1D08
you are registering the same counter address twice: Unbox trampolines at 103A1CE4
you are registering the same counter address twice: Static rgctx trampolines at 103A1CE0
you are registering the same counter address twice: RGCTX unmanaged lookups at 103A1D0C
you are registering the same counter address twice: RGCTX num lazy fetch trampolines at 103A1D10
you are registering the same counter address twice: Async JIT info size at 103A1B50

  • Assertion: should not be reached at /vagrant/mono/mono/metadata/domain.c:522

abnormal program termination
at System.__ComObject.Finalize () [0x0001a] in <7713cb95b33244ed9608bf0b23fbdce9>:0 Process exited with a Mono runtime loaded.

@HinTak
Copy link
Contributor

HinTak commented Oct 13, 2020

Wine-mono uses wine's gdiplus, which probably uses wine's usp10 (uniscribe) eventually. Mono on linux uses libgdiplus which is less complete, I think.

Wine-mono is quite different from mono. You might find something intermediate by using win32/win64 mono under wine instead of wine-mono; and you might be able to improve on wine-mono's behavior by using genuine Microsoft gdiplus via winetricks. And lastly, you might also get something else running genuine Microsoft dotnet under wine...

@ghost
Copy link
Author

ghost commented Oct 14, 2020

I remember that before months i tested installing dotnet framework 4.x under wine and keepass worked but suddonly crush if i press something so unusable ...
.............
The new test here is installing current latest "mono-6.12.0.98-gtksharp-2.12.45-win32-0.msi" under wine after uninstalling wine-mono ....
now if i run like this:

2020@2020:~$ wine "/media/sf_shared/exe TesTs/KeePass-O/KeePass.exe"
0009:err:mscoree:CLRRuntimeInfo_GetRuntimeHost Wine Mono is not installed

will not work .. i have to run it like this:

2020@2020:~$ wine "/path/to/.wine/drive_c/Program Files (x86)/Mono/bin/mono.exe" "/path/to/KeePass-O/KeePass.exe"

Color format of entries will work ... but these the issues .....

1.first ..... cannot recognize that there is plugins and languages files at all ... will not loading them without any error message.

2.second ..... Arabic text will rendered but in buggy way .... at first will be reversed then if i moved the slide of entry view will be fixed then if i moved again the slide of entry view will text will be mixed some lines reversed and some lines right ....

04

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant