Xft - problem with XftFontOpenName and XftFontOpen functions.
I am trying to use Xft but stuck with following problem - when I open font with XftFontOpenName and XftFontOpen functions, I can't switch antialias and hinting properties. For example, opening font with name: "FreeMono:pixelsize=16:weight=bold:antialias=false:rgba=0:slant=italic", creates a font with proper typeface, size, weight and slant, but antialiased. The other group of properties that are not settable are the hinting properties. The same result was reached with XftFontOpen function. I am importing the functions from the library "libXft.so.2.1.13" Can someone help me on this problem? Any suggestions are welcome. Regards. http://fresh.flatassembler.net Assembly language visual programming. ___ xorg@lists.x.org: X.Org support Archives: http://lists.freedesktop.org/archives/xorg Info: http://lists.x.org/mailman/listinfo/xorg Your subscription address: arch...@mail-archive.com
Re: Xft - problem with XftFontOpenName and XftFontOpen functions.
Hm, nobody knows or nobody cares? Or it is a great secret, for the internal circle only? :D -- Original Message -- To: (xorg@lists.x.org) From: John Found (johnfo...@evrocom.net) Subject: Xft - problem with XftFontOpenName and XftFontOpen functions. Date: 13.02.2012 21:14:44 >I am trying to use Xft but stuck with following problem - when I open font >with XftFontOpenName and XftFontOpen functions, I can't switch antialias and >hinting properties. >For example, opening font with name: >"FreeMono:pixelsize=16:weight=bold:antialias=false:rgba=0:slant=italic", >creates a font with >proper typeface, size, weight and slant, but antialiased. >The other group of properties that are not settable are the hinting >properties. >The same result was reached with XftFontOpen function. >I am importing the functions from the library "libXft.so.2.1.13" > >Can someone help me on this problem? Any suggestions are welcome. > >Regards. > >http://fresh.flatassembler.net >Assembly language visual programming. > >___ >xorg@lists.x.org: X.Org support >Archives: http://lists.freedesktop.org/archives/xorg >Info: http://lists.x.org/mailman/listinfo/xorg >Your subscription address: johnfo...@evrocom.net http://fresh.flatassembler.net Assembly language visual programming. ___ xorg@lists.x.org: X.Org support Archives: http://lists.freedesktop.org/archives/xorg Info: http://lists.x.org/mailman/listinfo/xorg Your subscription address: arch...@mail-archive.com
The keyboard interfaces and protocols in X
Hi. I am trying to create a X client that to communicate to X server by the raw protocol, not using any libraries, such as XLib or XCB. While with the graphics part it was simple and straightforward task, solved by simply following the protocol (The documentation on X11 is pretty complete and well written) and extensions documentation is available (although the MIT-SHM documentation on the protocol does not exists at all), I have stuck with the keyboard part of the protocol. The biggest problem is the conversion from the keycodes into the Unicode characters (of course where it is possible). Do I need XKEYBOARD extension? On only XINPUT. Or both. The documentation is complex and poorly written. I have a feeling that part of it was written not to be useful, but simply because it had to be written. So, the question: What is the simplest, canonical, expected way to handle the keyboard events in X protocol in order to obtain the Unicode codes of the pressed keys? In raw protocol therms. And supporting multiple languages, of course. I understand that some processing on the client side is required, but I am missing the whole picture of the process. Best Regards. John Found
Re: The keyboard interfaces and protocols in X
> If you want to avoid libx11/xcb, you should use libxkbcommon. Well, what is the difference? I want to avoid as many external libraries as possible. And (what is maybe more important) to understand how the whole system works under the library cover. OK, let try asking specific questions: 1. The reply of XkbGetMap: What is the meaning of the fields in the following structure, in the XkbGetMap reply: KB_KEYSYMMAP 8+4n 4 LISTofCARD8ktIndex ; What is this? 1 CARD8 groupInfo; What is this? 1 CARD8 width; Width of what? 2 n nSyms; more or less clear 4nLISTofKEYSYM syms ; clear as well. For example the following record: 01 14 00 00 = ktIndex - what this means? 02 = groupInfo - what info? 04 = width - of what? 08 00 = 8 keysyms follow 34 00 00 00 = "4" 24 00 00 00 = "$" 00 00 00 00 = NULL 00 00 00 00 = NULL 34 00 00 00 = "4" 24 00 00 00 = "$" AC 20 00 00 = "€" (euro sign) AC 20 00 00 = "€" (euro sign) It is not explained in the documentation. Well, or I missed to find it. 2. The events generated: When selected events with xkbUseCoreKbd the application receives multiply XkbMapNotify events (10 or more) - one per every deviceID. What are all these devices for? I have actually only two keyboards on the computer, but more than 10 devices. How to make to get only one event per map change? These two for now. Cheers! John Found On Tue, 15 Feb 2022 10:35:58 +1000 Peter Hutterer wrote: > On Sun, Feb 13, 2022 at 07:01:04PM +0200, John Found wrote: > > Hi. > > > > I am trying to create a X client that to communicate to X server by > > the raw protocol, not using any libraries, such as XLib or XCB. > > > > While with the graphics part it was simple and straightforward task, > > solved by simply following the protocol (The documentation on X11 is > > pretty complete and well written) and extensions documentation is > > available (although the MIT-SHM documentation on the protocol does > > not exists at all), I have stuck with the keyboard part of > > the protocol. > > > > The biggest problem is the conversion from the keycodes into the > > Unicode characters (of course where it is possible). > > > > Do I need XKEYBOARD extension? On only XINPUT. Or both. The > > documentation is complex and poorly written. I have a feeling that > > part of it was written not to be useful, but simply because it had > > to be written. > > > > So, the question: > > > > What is the simplest, canonical, expected way to handle the keyboard > > events in X protocol in order to obtain the Unicode codes of the > > pressed keys? In raw protocol therms. And supporting multiple > > languages, of course. > > > > I understand that some processing on the client side is required, > > but I am missing the whole picture of the process. > > Slightly more than "some" but yes, you need to process this. Think of > the keyboard as a 105-key mouse. Now you get a button event for > button 72 - what unicode code is that? The correct answer is: "this > is the wrong question". > > X works with keycodes which are _hardware_ codes. [1] You *need* a > keymap, which tells you that hardware code N maps to unicode point M. > You can deal with the core keymap only, or you can accept that > everyone has been using XKB for decades now. The server gives you > that core keymap but that still means you need to do the state > handling for modifiers etc yourself. > > If you want to avoid libx11/xcb, you should use libxkbcommon. > Handling all this yourself means you'll spend the majority figure all > this out. I doubt that's the goal. There's still some extra work > needed since you don't get the component names from the core protocol > but you can hack around that. At least you won't have to implement > all of XKB client-side with libxkbcommon. > > Cheers, > Peter > > [1] They are now mostly normalized on Linux to evdev codes (+ offset > 8) but that's a relatively recent addition given the age of X.
Re: The keyboard interfaces and protocols in X
On Tue, 15 Feb 2022 14:29:05 + Dave Howorth wrote: > On Tue, 15 Feb 2022 15:21:07 +0200 > John Found wrote: > > > What is the meaning of the fields in the following structure, in the > > XkbGetMap reply: > > > > KB_KEYSYMMAP 8+4n > > 4 LISTofCARD8ktIndex ; What is this? > > 1 CARD8 groupInfo; What is this? > > 1 CARD8 width; Width of what? > > 2 n nSyms; more or less clear > > 4nLISTofKEYSYM syms ; clear as well. > > Oh, and assuming you found this in the XKB Protocol Specification then > the answers to your question are in the same document, I think. For > example groupInfo is explained on p32. Just search the document. Please, could you explain it on this example: 01 14 00 00 = ktIndex - what this means? 02 = groupInfo - what info? 04 = width - of what? 08 00 = 8 keysyms follow 34 00 00 00 = "4" 24 00 00 00 = "$" 00 00 00 00 = NULL 00 00 00 00 = NULL 34 00 00 00 = "4" 24 00 00 00 = "$" AC 20 00 00 = "€" (euro sign) AC 20 00 00 = "€" (euro sign) What the constants 0x01, 0x14 (ktIndex), 0x02 (groupInfo) and 0x04 (width) means? Thanks. John Found
Re: The keyboard interfaces and protocols in X
> And XKB is probably one of the most extensively documented protocols, I don't know what "extensively" means in your understanding, but the documentation of XKB is sloppily written. They even didn't labeled the items in "Appendix D: Protocol encoding". Which is the main document if one have to implement the protocol in code. On Wed, 16 Feb 2022 09:59:55 +1000 Peter Hutterer wrote: > On Tue, Feb 15, 2022 at 05:42:39PM +0200, John Found wrote: > > On Tue, 15 Feb 2022 14:29:05 + > > Dave Howorth wrote: > > > > > On Tue, 15 Feb 2022 15:21:07 +0200 > > > John Found wrote: > > > > > > > What is the meaning of the fields in the following structure, > > > > in the XkbGetMap reply: > > > > > > > > KB_KEYSYMMAP 8+4n > > > > 4 LISTofCARD8ktIndex ; What is this? > > > > 1 CARD8 groupInfo; What is this? > > > > 1 CARD8 width; Width of what? > > > > 2 n nSyms; more or less clear > > > > 4nLISTofKEYSYM syms ; clear as well. > > > > > > Oh, and assuming you found this in the XKB Protocol Specification > > > then the answers to your question are in the same document, I > > > think. For example groupInfo is explained on p32. Just search the > > > document. > > > > Please, could you explain it on this example: > > > > 01 14 00 00 = ktIndex - what this means? > > 02 = groupInfo - what info? > > 04 = width - of what? > > 08 00 = 8 keysyms follow > > 34 00 00 00 = "4" > > 24 00 00 00 = "$" > > 00 00 00 00 = NULL > > 00 00 00 00 = NULL > > 34 00 00 00 = "4" > > 24 00 00 00 = "$" > > AC 20 00 00 = "€" (euro sign) > > AC 20 00 00 = "€" (euro sign) > > > > What the constants 0x01, 0x14 (ktIndex), 0x02 (groupInfo) and > > 0x04 (width) means? > > From: > https://www.x.org/releases/X11R7.7/doc/kbproto/xkbproto.html#XKB_Protocol_Requests > """ > Key Symbol Map > > The key symbol map for a key contains all of the information that a > client needs to process events generated by that key. Each key symbol > mapping reports: > > The number of groups of symbols bound to the key ( numGroups ). > The treatment of out-of-range groups ( groupInfo ). > The index of the key type to for each possible group ( > kt_index[MaxKbdGroups] ). The width of the widest type associated > with the key ( groupsWidth ). The two-dimensional (numGroups × > groupsWidth) array of symbols bound to the key. """ > > XKB is a huge spec and you will need to support virtually *all* of it > to get anywhere meaningful. Some terms that you don't know are > specific terms used in the protocol, e.g. if you do not know what > group "width" is that means you do not yet understand XKB well enough > to implement a protocol parser. > > And XKB is probably one of the most extensively documented protocols, > both originally and in terms of follow ups by people who had to wrap > their brains around it later. > > Which is also why I said earlier: you can either become an XKB expert > [1] or use libxkbcommon. XKB isn't *hard*, it's just complicated and > a lot to implement. > > Oh, and there's a PDF too https://www.x.org/docs/XKB/XKBproto.pdf in > case you want to inflict that on your ebook reader. > > Cheers, > Peter > > [1] fwiw, the job market for those is rather small and you rarely get > your face on TV during a crisis