label (other than english lang) in dialog box created using dialogeWidgetClass does not comes properly on ubuntu using libXt - ubuntu-18.04

I have created a dialog box using dialogWidgetClass with Xt function XtCreateManagedWidget. If label is in English it is shown correctly but when its in different language it does not come properly. I am using ubuntu 18. All label string i am converting into utf-8

Related

Windows API: Programmatically moving the Windows IME Input box possible?

Question
On Windows, if a program does not use one of the native APIs to produce a GUI, then Windows IME shows a tiny Textbox in the upper left corner to input IME strings, as is the case with Japanese.
Can this textbox be moved programmatically via the Windows API? I just want it moved roughly where the text input happens, so it's not so jarring having to look in the upper left corner all the time. Can someone point me in the right direction, what to read where to search?
Details
I have an OpenGL Program with a simple Immediate-Mode GUI Toolkit on top. As such this program does not interface with the OS's GUI capabilities in any meaningful way to provide OS native behaviour or accessibility functions. For my use-case, similar to many video games, this is fine. If I have textboxes inside the program however, inputting text via Windows or Google IME is an awful experience and I would like to improve it. I am not looking to integrate with Windows any more that this, just moving the IME Textbox roughly to the correct position of the "in program" textbox. It is compiled with MinGW64 and I already used Win32 API functions like changing the program's window and taskbar icon. Is this a possibility via the Win32 api?
The following code works in moving the IME position from default to current cursor position:
if (msg.message == WM_IME_STARTCOMPOSITION) { // msg is windows message
HIMC imc = ImmGetContext(msg.hwnd);
COMPOSITIONFORM cf;
cf.dwStyle = CFS_FORCE_POSITION;
POINT ptPos;
bool ret = GetCursorPos(&ptPos);
if (ret)
{
cf.ptCurrentPos.x = ptPos.x;
cf.ptCurrentPos.y = ptPos.y;
}
ImmSetCompositionWindow(imc, &cf);
ImmReleaseContext(msg.hwnd, imc);
}
WM_IME_STARTCOMPOSITION is a message type which windows sends to application when it starts IME. In your application when you peek or process windows messages try to catch for WM_IME_STARTCOMPOSITION and then force set the IME composition window position.

Convert data like :) into a smiley in React

I am working on a messaging application built with ReactJS. I am using emoji-mart to get the emoji table. And it is working fine but I want it to behave in a manner such that if I type :) in the textbox then it should convert it into its corresponding smiley like this 😊. How can I do it? This is how most of the text application work. Right now :) -> this is being treated as a normal text.

GTK+ tray/status menu not showing - arrows displayed instead

Trying to add a tray menu to a GTK+ (2.24) application on Windows 10, in C. Code is exactly as in this example, except the icon. The result is as follows, menu is not visible and there are up and down arrows instead:
In this example (French forum, code works when an image is provided), only down arrow appears and it is possible sometimes (1 over 10) to actually display the menu entry by right-clicking long time on the arrow.
Question is: is this a GTK+ bug, as stated in several forums, or is there a way to create a menu from a tray icon using GTK+ without implementing a custom-drawn one?
Edit: replaced wrong GTK2 tag by GTK.

How to verify font created by Windows?

I'm using the ChooseFont system dialog to populate a LOGFONT structure that is passed to CreateFontIndirect and the resulting font handle is selected into the device context and used. But it doesn't resemble the requested font in any way (well, OK, similar character sets, but otherwise not the same). Here's an image of the screen showing the ChooseFont dialog selecting an old DOS-style VGA font and in the background (behind the ChooseFont dialog) shows the font that I got when I selected the values shown in the dialog:
Notice that the Sample in the dialog and what Windows puts on the screen when the created font is selected into the DC are quite different. This doesn't happen for ALL fonts, only some of them, which is why I'm trying to correct and/or detect this.
I've tried getting the LOGFONT for the new font from the DC using (GetCurrentObject and GetObject) and it is identical to my request, except that the lfQuality has changed to NONANTIALIASED_QUALITY from anything else I've tried setting it to.
I have a kinda two part question:
How can I force Windows to use the font I've selected. Obviously there is a way, or it wouldn't look right in the ChooseFont dialog, either.
If no one can answer #1, how can I reliably find out that Windows has selected a totally wrong font, when asking Windows for the font info about the created font when selected into the device context doesn't work?
EDIT: July 8
If this helps at all, my basic calling sequence is:
LOGFONT lf;
CHOOSEFONT cf;
HFONT hf;
cf.lpLogFont = &lf; // plus other necessary stuff
ChooseFont( &cf );
hf = CreateFontIndirect( &lf );
SelectObject( hdc, hf );
ExtTextOut( hdc, ... );
Then, when I use the font, it doesn't always match what I requested. At all. (I just tried using Arial Monospaced MT and was rewarded with Courier -- Lucida Console would be a better substitute, at least it doesn't have serifs!) I don't do ANYTHING to the DC other than call GetDC(). I don't call any GDI setup/configuration functions, either, so I'm in whatever default mode one gets with a standard Windows program written in C to the WIN32API.
I've discovered that the Windows version of PuTTY shows the correct fonts while my program doesn't, but I have not yet been able to find anything different between the functions/parameters it uses to handle font creation and the way I do it. I'll keep looking though. Thanks to anyone who's given my question any thought, with or without suggestions. :-)

Highlight text in a PDF document viewer

I have a WinForms application and am using AxAcroPDF COM component to display PDF files in my application. I want to highlight occurrences of some text in the PDF document using the AxAcroPDF component. Is there a way to do that?
just since there are no answers here - according to Adobe's API there is a method SetCurrentHighlight, which hightlights text within the specified rectangle (I haven't tried this):
SetCurrentHighlight
Highlights the text selection within the specified bounding rectangle
on the current page.
Syntax void setCurrentHighlight(LONG nLeft, LONG nTop, LONG nRight,
LONG nBottom);
Another alternative way is there, you may like to do all kind of text editing features using Foxit PDF Reader. It is now available for major platforms like linux, Windows and Mac.
Mendeley (https://www.mendeley.com/) does the work like a charm!
In fact, Mendeley is more than a PDF-reader. You can use it to organize your docs and references .

Resources