GDI+ font fallback not working for emojis - windows

In our app we draw text using GDI+ (Graphics::DrawString()). We're using a clone of a StringFormat::GenericTypographic() string format with StringFormatFlagsMeasureTrailingSpaces as the only additional flag. StringFormatFlagsNoFontFallback is definitely not set in the format.
This all works great, except for emojis when the selected font doesn't include the emoji glyph. My expectation is that GDI+ will fall back on a font that does have this glyph (e.g. Segoe UI Emoji), however this doesn't seem to be working. If we manually switch to Segoe UI Emoji then all the emojis render correctly.
This is on Windows 10.

Related

How to prevent android and ios font settings to bold / larger font size in xamarin?

When changing the font to bold in the device some of the labels are overlapping and the text will be bold. also, when we change font size it also affects the Ui.

How to get the vibrant effect for a NSTextField/NSSearchField like Safari's address bar in Big Sur

I have a Mac app with a search field in its toolbar (actually a NSTextField, but I tried NSSearchField as well).
My problem is that the text field background on Big Sur is just plain white, which makes it hard to recognize.
Safari's location bar on Big Sur has more contrast. I believe this is somehow achieved by using vibrancy (How to change background color of NSSearchField (like in Messages app in OS X)), but I cannot get the same effect.
I tried:
testTextField.appearance = NSAppearance(named: .vibrantLight)
various combinations of drawing/not drawing backgrounds
various background colors
wrapping my toolbar item into NSVisualEffectView, but that shows around the text field
Edit:
I should mention that I use roundedBezel border style. This alone seems to affect the background color (i.e. background is always white, no matter which color was set).

Today Extension: how to display long text?

I don't know whether I'm doing something wrong or if it's not possible: I'd like to display a longer text, but the height seems to be limited to 568 pixels (Maximum height of iOS 8 Today Extension?). I'm using a UITextView, so I would expect it to scroll, but that's not possible either.
Isn't there any way to display the full text?
Displaying such large text on a Notification Center widget, especially in iPhone 4S, 5 or 6, where space is limited, is a bad idea.
Instead, show a preview of the text, indicate that there is more text, and add a button to open the full app to read the rest of it.

Qt font families and styles on Mac OS X

I have a GUI application based on Qt (PyQt) running on Mac OS X (and other platforms). It allows the user to select fonts and has check boxes for bold and italic options.
On updating to the new Cocoa-based Qt, a user found the QFontComboBox no longer displays the different font styles (e.g. condensed, oblique, bold...) and just displays the font family name. Under Carbon it showed both. The user also cannot enter the name with the style in the combo box. Furthermore, I cannot construct the same font passing the name into the QFont constructor.
QFont doesn't seem to know anything about these missing styles. Confusingly it has another different notion of style. It looks like QFontDatabase has the information about the style variants. It can also construct fonts based on a family, style and point size.
So, are the following changes the correct approach?
Rather than have bold and italic buttons, have a combobox filled with the styles from QFontDatabase for the font selected in the QFontComboBox.
Store the style in saved documents (as text), rather than bold or italic.
So
Can I rely on the style being the same on systems with different languages? Can I include it in saved documents?
Is a style "Bold Italic" as robust a way of making a QFont with the desired properties, than setting the bold and italic properties of that QFont?
If I want to retain bold and italic checkboxes, how can I convert these attributes into the correct style? Can I just guess "Bold", "Italic" or "Bold Italic"?

Problem with ssOption control in VB6: Text background color changes from Win 98 to Win XP

I'm using the ssOption control (Sheridan 3d Option control) in VB6.
In Windows 98 the text area background color is the same color as the background color around the Option Circle, and that color is the default form color. So the Option button appears to be transparent.
There is no Background color property and on Windows XP the background color of the text area is a different color from the background color around the Option circle.
Any ideas as to why this would happen? The control's wrapper is in Threed32.ocx and I have the same version of it in the Windows\system32 directory on both the Win98 and WinXP systems.
Why might it behave differently on 98 vs XP?
Any ideas on a fix?
SSOption sets it background to the Windows Button Face on Windows XP. This the same background you get when you make a new form. You will need to use a frame or another type of enclosure that has a background of button face if you want to use it on a multi-colored form. Otherwise use VB6's Option button.
The advantages of the SSOption is the ability to display it's text in a 3D raised or inset format. This really only works well using the default button face color which is why it is hard coded into the control. It also has better formatting of the text when the option button is to the right of the text.
If you can't use a enclosing frame or panel then you have a tedious alternative. You can make an VB6 option with no text. If you are using the 3D font. Then you can use two labels to achieve the same effect. Make the bottom white (or top depending on raised vs inset) and offset by one pixel or 15 twips.
You can use the ZoomIn tool if you installed VB6 as part of the Visual Studio 6 package to make sure it is right.
If you are using it for the Alignment. Then you can fiddle with the width of the VB6 native option control until it looks right or make the option with no text and use a label.
Threed32.ocx is ancient - it was designed for VB4. I would replace it with the built-in VB6 option control.
Alex is right. Threed32.ocx is old and has a number of problems. It's not supported on Vista, it grabs the focus when it's made visible, it's hard to upgrade to VB.NET - there are more. For my company these are strong enough to outweigh the extra functionality it gives - we're droppping it from all our programs.

Resources