xournalpp / xournalpp

Xournal++ is a handwriting notetaking software with PDF annotation support. Written in C++ with GTK3, supporting Linux (e.g. Ubuntu, Debian, Arch, SUSE), macOS and Windows 10. Supports pen input from devices such as Wacom Tablets.
https://xournalpp.github.io
GNU General Public License v2.0
10.86k stars 787 forks source link

xournal++ 1.1.1.1 not showing IPA fonts/alternative layout characters on mac #4291

Closed natobsid closed 1 year ago

natobsid commented 1 year ago

Affects versions :

Describe the bug Does not render fonts in alternative keyboard layouts. Specifically, I'm trying to use the IPA Unicode layout https://scripts.sil.org/cms/scripts/page.php?item_id=UniIPAKeyboard. When this didn't work, I built my own layout in Ukelele, based on a dvorak layout but with ALT keys for certain IPA symbols. However, in xournal++ these are not recognised and the characters are rendered using the traditional layout. It seems as if xournal++ can't find my layouts but I don't know if this is the case.

To Reproduce

Change keyboard layout to IPA Keyboard layout or alternative .bundle file Type using alternative layout

Expected behavior unicode characters in alternative layout should be rendered

Screenshots of Problem example of the unrendered IPA symbol

image

tattsan commented 1 year ago

U+F03D is in Private Use Area (U+E000-U+F8FF).

natobsid commented 1 year ago

Thanks for the reply and info. Is there any way you know of that I can install these fonts so that Xournal++ recognises them. I'm not very familiar with this, I'm afraid...

natobsid commented 1 year ago

Hi everyone,

I still can't get any joy with this, and I'm not sure why. I'm using MAC OS Big Sur and there are three main font locations: /Users/username/Library/Fonts; /Library/Fonts; /System/Library/Fonts. The last one is now unwriteable in Big Sur and DOESN'T have the IPA fonts. And yet, after installing the fonts systemwide to /Library/Fonts, Xournal++ does see the fonts and I can select them. But it won't TYPE them. Could it be that it is looking for fonts in /System/Library/Fonts—could anyone confirm this please?

If not, it must be a question of recognising keyboard layouts, but again these are installed system-wide. None of the other text programs I'm using (openboard, emacs, etc.) have this issue and unfortunately, as wonderful as Xournal++ is, not being able to type IPA phonetics really is a deal breaker for me.

Any help gratefully received!

natobsid commented 1 year ago

After investigating a little more, it seems this has nothing to do with fonts but with the layouts themselves. I can type out the IPA symbols using alternative keyboard layouts in another text editor and when I paste them into Xournal, the fonts render correctly. However, typing the same keystrokes into Xournal directly produces nothing. Could this have something to do with SIP in Big Sur? Is Xournal looking for the layout in /System? Any help/suggestions for further investigation gratefully appreciated.

natobsid commented 1 year ago

Further to this, and just brainstorming, could it be to do with xournal not recognising dead keys?

tattsan commented 1 year ago

This may be related to the issue #4290, both are the issue of IME on MacOS. But sorry, I can't test these issues because I have no Mac device.

natobsid commented 1 year ago

This may be related to the issue #4290, both are the issue of IME on MacOS. But sorry, I can't test these issues because I have no Mac device.

Yes, this does seem to be the case--when I install canjie, the same thing happens, xournal outputs normal qwerty characters but in other programs I get the full unicode characters...

natobsid commented 1 year ago

Well, I've managed to make some progress with this. I installed a modified keyboard layout that successfully types Unicode IPA characters in Xournal. The problem seemed to be that I had my layouts installed for individual users, and somehow Xournal wasn't seeing them. After installing for All Users, they come up just fine. However, dead combinations keys are still not recognised, and I suspect that this is something that @tattsan mentioned about the Mac IME. I've worked around this by just using ALT as a basic key modifier, which is a bit clunky but does the trick and gives me a usable interface. Thanks @tattsan for your time and thoughts.

tattsan commented 1 year ago

Xournal++ uses GTK+, and to use IME, GTK+ requires immodules. Do you have GTK immodules installed? And does your input application use that GTK immodule?

rolandlo commented 1 year ago

On MacOS the immodules are in Xournal++.app/Contents/Resources/lib/gtk-3.0/3.0.0/immodules grafik Xournal++ sets GTK_IM_MODULE_FILE (in case it is not set by the user) to Xournal++.app/Contents/Resources/lib/gtk-3.0/3.0.0/immodules.cache, see https://github.com/rolandlo/xournalpp/blob/72ce6861065877504254987587a412f9b9140c55/src/exe/osx/setup-env.cpp#L29

It looks like this file has incorrect paths for the localization files (which may not be too relevant though). Here is its content:

"@executable_path/../Resources/lib/gtk-3.0/3.0.0/immodules/im-am-et.so"
"am_et" "Amharic (EZ+)" "gtk30" "/Users/xournal-dev/gtk/inst/share/locale" "am"

"@executable_path/../Resources/lib/gtk-3.0/3.0.0/immodules/im-cedilla.so"
"cedilla" "Cedilla" "gtk30" "/Users/xournal-dev/gtk/inst/share/locale" "az:ca:co:fr:gv:oc:pt:sq:tr:wa"

"@executable_path/../Resources/lib/gtk-3.0/3.0.0/immodules/im-cyrillic-translit.so"
"cyrillic_translit" "Cyrillic (Transliterated)" "gtk30" "/Users/xournal-dev/gtk/inst/share/locale" ""

"@executable_path/../Resources/lib/gtk-3.0/3.0.0/immodules/im-inuktitut.so"
"inuktitut" "Inuktitut (Transliterated)" "gtk30" "/Users/xournal-dev/gtk/inst/share/locale" "iu"

"@executable_path/../Resources/lib/gtk-3.0/3.0.0/immodules/im-ipa.so"
"ipa" "IPA" "gtk30" "/Users/xournal-dev/gtk/inst/share/locale" ""

"@executable_path/../Resources/lib/gtk-3.0/3.0.0/immodules/im-multipress.so"
"multipress" "Multipress" "gtk30" "/Users/xournal-dev/gtk/inst/share/locale" ""

"@executable_path/../Resources/lib/gtk-3.0/3.0.0/immodules/im-quartz.so"
"quartz" "Mac OS X Quartz" "gtk30" "/Users/xournal-dev/gtk/inst/share/locale" "ja:ko:zh:*"

"@executable_path/../Resources/lib/gtk-3.0/3.0.0/immodules/im-thai.so"
"thai" "Thai-Lao" "gtk30" "/Users/xournal-dev/gtk/inst/share/locale" "lo:th"

"@executable_path/../Resources/lib/gtk-3.0/3.0.0/immodules/im-ti-er.so"
"ti_er" "Tigrigna-Eritrean (EZ+)" "gtk30" "/Users/xournal-dev/gtk/inst/share/locale" "ti"

"@executable_path/../Resources/lib/gtk-3.0/3.0.0/immodules/im-ti-et.so"
"ti_et" "Tigrigna-Ethiopian (EZ+)" "gtk30" "/Users/xournal-dev/gtk/inst/share/locale" "ti"

"@executable_path/../Resources/lib/gtk-3.0/3.0.0/immodules/im-viqr.so"
"viqr" "Vietnamese (VIQR)" "gtk30" "/Users/xournal-dev/gtk/inst/share/locale" ""

One could modify that file or save it somewhere else and set GTK_IM_MODULE_FILE accordingly.

tattsan commented 1 year ago

The recent release 1.1.2 resolved the issue #4290. Does it also resolve this issue #4291? @natobsid

natobsid commented 1 year ago

Yes-fantastic! Issue resolved, thank you very much!