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

System keyboard layout is ignored on Windows #1729

Closed
adrientetar opened this issue Sep 12, 2014 · 11 comments · Fixed by #2782
Closed

System keyboard layout is ignored on Windows #1729

adrientetar opened this issue Sep 12, 2014 · 11 comments · Fixed by #2782

Comments

@adrientetar
Copy link
Member

FontForge always uses QWERTY apparently.

cc @jtanx

@jtanx
Copy link
Contributor

jtanx commented Sep 12, 2014

A quick look at this suggests that it must be set when the X server is launched, e.g. the cygwin build suggests to add (for the Japanese keyboard)

-xkbmodel jp106 -xkblayout jp

So for my builds, that would mean editing this line in fontforge.bat

start /B "" "%FF%\bin\VcXsrv\vcxsrv.exe" :9 -multiwindow -clipboard -silent-dup-error

This document seems pretty good at explaining the xkb layout and models that need to be set. The file in bin/VcXsrv/xkbdata/rules/base.lst lists all models and layouts that it supports.

I don't know how to automate this based on locale though.

@adrientetar
Copy link
Member Author

@jtanx Do you know of a working setting for #1908?

@jtanx
Copy link
Contributor

jtanx commented Nov 11, 2014

Not at this stage no.

@jtanx
Copy link
Contributor

jtanx commented May 14, 2015

Okay, so I did some testing a while back, and it turns out that it's not an issue from VcxSrv. I was able to get VcxSrv to correctly work with a different keyboard layout (can't remember the settings right now) using another program like gedit, but using the same keyboard layout with FontForge does not work.

I narrowed it down to the call to XLookpString in gxdraw.c returning a zero-length response, hence the keyboard not working. I believe it is an encoding issue, but I don't really know that much about Xlib to know what's going on here. I haven't gotten much further than that at this point.

@jtanx
Copy link
Contributor

jtanx commented May 24, 2015

I've been able to work on this some more. So there were a few things that needs fixing:

  1. I was compiling libX11 without xlocaledir from environment variable support (--enable-xlocaledir)
  2. The locales bundled with VcXsrv (locale.alias) were for some reason missing the locale names (e.g. English_Australia.1252)
  3. Not all controls use an input context (e.g. on creation of a text box, should specify gg_text_xim in the flags)

That last point is what prevents it from working fully. E.g. in the file open dialogue, you can't type anything with a non-standard keyboard, but in the font view, you can use it just fine because there's an input context.

A hack would be to check if ((GXWindow) gw)->gic is NULL (here) and if so, to create an input context then (so that it uses Xutf8LookupString instead of XLookupString). This works, but then I don't know why an input context isn't created all the time. E.g. is there any case where an input context is not needed or wanted?

@jtanx
Copy link
Contributor

jtanx commented May 24, 2015

Actually, it looks like at present only the open font dialogue is affected. And in any case you can't open files containing non-ascii characters on Windows (in FontForge) right now anyway. So it might actually be okay as it is. Hmm...

@jtanx
Copy link
Contributor

jtanx commented May 24, 2015

I have a test build for anybody that wants to try - see #2065 and #2156 for example configurations. I've been able to test with Russian and French keyboard layouts (on-screen keyboard testing) but I guess nothing beats having people test it with actual keyboards.

I haven't been able to get Japanese layout to work though (moreover I don't know how this would work anyway).

@adrientetar
Copy link
Member Author

It works for me, nice. I did not need to change configuration.

@adrientetar
Copy link
Member Author

Open dialog also seems to work for me.

@jtanx
Copy link
Contributor

jtanx commented May 24, 2015

I think it is codepage (of your Windows configuration) dependent. E.g. On mine it won't work presumably because somewhere along the path it tries to encode it using my codepage, which only supports English/ASCII characters.

@davelab6
Copy link
Member

davelab6 commented May 24, 2015 via email

jtanx added a commit to jtanx/fontforge that referenced this issue Jun 7, 2015
On Windows, this allows e.g. Cyrillic keyboards to work even if Cyrillic is
not currently the active codepage.

Related issues: fontforge#1729, fontforge#2290
jtanx added a commit to jtanx/fontforge that referenced this issue Jun 15, 2015
On Windows, this allows e.g. Cyrillic keyboards to work even if Cyrillic is
not currently the active codepage.

Related issues: fontforge#1729, fontforge#2290
jtanx added a commit to jtanx/fontforge that referenced this issue Jun 15, 2015
On Windows, this allows e.g. Cyrillic keyboards to work even if Cyrillic is
not currently the active codepage.

Related issues: fontforge#1729, fontforge#2290
jtanx added a commit to jtanx/fontforge that referenced this issue Jun 15, 2015
On Windows, this allows e.g. Cyrillic keyboards to work even if Cyrillic is
not currently the active codepage.

Related issues: fontforge#1729, fontforge#2290
jtanx added a commit to jtanx/fontforge that referenced this issue Jul 23, 2015
On Windows, this allows e.g. Cyrillic keyboards to work even if Cyrillic is
not currently the active codepage.

Related issues: fontforge#1729, fontforge#2290
jtanx added a commit to jtanx/fontforge that referenced this issue Aug 25, 2015
On Windows, this allows e.g. Cyrillic keyboards to work even if Cyrillic is
not currently the active codepage.

Related issues: fontforge#1729, fontforge#2290
jtanx added a commit to jtanx/fontforge that referenced this issue Sep 22, 2015
On Windows, this allows e.g. Cyrillic keyboards to work even if Cyrillic is
not currently the active codepage.

Related issues: fontforge#1729, fontforge#2290
jtanx added a commit to jtanx/fontforge that referenced this issue Oct 20, 2015
On Windows, this allows e.g. Cyrillic keyboards to work even if Cyrillic is
not currently the active codepage.

Related issues: fontforge#1729, fontforge#2290
jtanx added a commit to jtanx/fontforge that referenced this issue Apr 5, 2016
On Windows, this allows e.g. Cyrillic keyboards to work even if Cyrillic is
not currently the active codepage.

Related issues: fontforge#1729, fontforge#2290
jtanx added a commit to jtanx/fontforge that referenced this issue Apr 7, 2016
On Windows, this allows e.g. Cyrillic keyboards to work even if Cyrillic is
not currently the active codepage.

Related issues: fontforge#1729, fontforge#2290
jtanx added a commit to jtanx/fontforge that referenced this issue Aug 13, 2016
On Windows, this allows e.g. Cyrillic keyboards to work even if Cyrillic is
not currently the active codepage.

Related issues: fontforge#1729, fontforge#2290
jtanx added a commit to jtanx/fontforge that referenced this issue Aug 13, 2016
On Windows, this allows e.g. Cyrillic keyboards to work even if Cyrillic is
not currently the active codepage.

Related issues: fontforge#1729, fontforge#2290
jtanx added a commit to jtanx/fontforge that referenced this issue Oct 1, 2016
On Windows, this allows e.g. Cyrillic keyboards to work even if Cyrillic is
not currently the active codepage.

Related issues: fontforge#1729, fontforge#2290
jtanx added a commit to jtanx/fontforge that referenced this issue Oct 1, 2016
On Windows, this allows e.g. Cyrillic keyboards to work even if Cyrillic is
not currently the active codepage.

Related issues: fontforge#1729, fontforge#2290
jtanx added a commit to jtanx/fontforge that referenced this issue Oct 4, 2016
On Windows, this allows e.g. Cyrillic keyboards to work even if Cyrillic is
not currently the active codepage.

Related issues: fontforge#1729, fontforge#2290
jtanx added a commit to jtanx/fontforge that referenced this issue Jul 30, 2017
On Windows, this allows e.g. Cyrillic keyboards to work even if Cyrillic is
not currently the active codepage.

Related issues: fontforge#1729, fontforge#2290
jtanx added a commit to jtanx/fontforge that referenced this issue Jul 31, 2017
On Windows, this allows e.g. Cyrillic keyboards to work even if Cyrillic is
not currently the active codepage.

Related issues: fontforge#1729, fontforge#2290
jtanx added a commit to jtanx/fontforge that referenced this issue Dec 29, 2018
On Windows, this allows e.g. Cyrillic keyboards to work even if Cyrillic is
not currently the active codepage.

Related issues: fontforge#1729, fontforge#2290
jtanx added a commit to jtanx/fontforge that referenced this issue Dec 29, 2018
On Windows, this allows e.g. Cyrillic keyboards to work even if Cyrillic is
not currently the active codepage.

Related issues: fontforge#1729, fontforge#2290
jtanx added a commit to jtanx/fontforge that referenced this issue Jan 27, 2019
On Windows, this allows e.g. Cyrillic keyboards to work even if Cyrillic is
not currently the active codepage.

Related issues: fontforge#1729, fontforge#2290
jtanx added a commit that referenced this issue Mar 16, 2019
On Windows, this allows e.g. Cyrillic keyboards to work even if Cyrillic is
not currently the active codepage.

Related issues: #1729, #2290
jtanx added a commit that referenced this issue Mar 17, 2019
On Windows, this allows e.g. Cyrillic keyboards to work even if Cyrillic is
not currently the active codepage.

Related issues: #1729, #2290
jtanx added a commit to jtanx/fontforge that referenced this issue Apr 13, 2019
On Windows, this allows e.g. Cyrillic keyboards to work even if Cyrillic is
not currently the active codepage.

Related issues: fontforge#1729, fontforge#2290
jtanx added a commit to jtanx/fontforge that referenced this issue Jun 2, 2019
On Windows, this allows e.g. Cyrillic keyboards to work even if Cyrillic is
not currently the active codepage.

Related issues: fontforge#1729, fontforge#2290
jtanx added a commit to jtanx/fontforge that referenced this issue Jun 2, 2019
On Windows, this allows e.g. Cyrillic keyboards to work even if Cyrillic is
not currently the active codepage.

Related issues: fontforge#1729, fontforge#2290
jtanx added a commit to jtanx/fontforge that referenced this issue Jul 31, 2019
On Windows, this allows e.g. Cyrillic keyboards to work even if Cyrillic is
not currently the active codepage.

Related issues: fontforge#1729, fontforge#2290
jtanx added a commit that referenced this issue Aug 1, 2019
On Windows, this allows e.g. Cyrillic keyboards to work even if Cyrillic is
not currently the active codepage.

Related issues: #1729, #2290
jtanx added a commit that referenced this issue Aug 1, 2019
On Windows, this allows e.g. Cyrillic keyboards to work even if Cyrillic is
not currently the active codepage.

Related issues: #1729, #2290
jtanx added a commit to jtanx/fontforge that referenced this issue Mar 1, 2020
On Windows, this allows e.g. Cyrillic keyboards to work even if Cyrillic is
not currently the active codepage.

Related issues: fontforge#1729, fontforge#2290
jtanx added a commit that referenced this issue Mar 14, 2020
On Windows, this allows e.g. Cyrillic keyboards to work even if Cyrillic is
not currently the active codepage.

Related issues: #1729, #2290
jtanx added a commit that referenced this issue Mar 14, 2020
On Windows, this allows e.g. Cyrillic keyboards to work even if Cyrillic is
not currently the active codepage.

Related issues: #1729, #2290
jtanx added a commit to jtanx/fontforge that referenced this issue Nov 7, 2020
On Windows, this allows e.g. Cyrillic keyboards to work even if Cyrillic is
not currently the active codepage.

Related issues: fontforge#1729, fontforge#2290
jtanx added a commit to jtanx/fontforge that referenced this issue Nov 7, 2020
On Windows, this allows e.g. Cyrillic keyboards to work even if Cyrillic is
not currently the active codepage.

Related issues: fontforge#1729, fontforge#2290
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants