uniscribe | Describes Unicode characters with their name and shows | Command Line Interface library
kandi X-RAY | uniscribe Summary
kandi X-RAY | uniscribe Summary
Describes Unicode characters with their name and shows compositions. Uses a similar color coding like its lower-level companion tool unibits.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of uniscribe
uniscribe Key Features
uniscribe Examples and Code Snippets
Community Discussions
Trending Discussions on uniscribe
QUESTION
I was able to find the following method of determining if a Unicode-16
character is supported by a font. Unfortunately that doesn't work for surrogate pair Unicode characters, since WCRANGE
struct supported by GetFontUnicodeRanges
function returns only WCHAR
(16-bit) parameters as output.
Here's an example of what I'm trying to do:
...ANSWER
Answered 2019-Jun-27 at 01:49 character is actually not supported in Windows 10 Arial font. Windows 10 uses
"Segoe UI Emoji"
as fallback font for that particular code point.
So first we have to figure out if fallback font is used. Then check the glyph index to see if it is tofu character (usually shown as square sign ▯
)
We can use meta file to find if font substitution is used. Select that font in to HDC
.
Use ScriptGetFontProperties
to find the values for unsupported glyphs.
Use GetCharacterPlacement
to find the glyph indices for the string. If the glyph index matches unsupported glyphs, then the code point is being printed as tofu ▯
.
If you try to print Chinese character etc. then you have to choose the appropriate font (SimSun for Chinese)
This part is done by IMLangFontLink
. It's a different type of font substitution.
The example below will test for single code point (it can be expanded to handle a string).
If Segoe UI
font is selected, then for the Chinese character 请
, it will switch Segoe UI
to SimSun
.
For emojis, it will switch Segoe UI
to Segoe UI Emoji
See also this article in oldnewthing. Note the article in OldNewThing does not handle Emojis, it just lets TextOut
handle it (which is handled correctly in Windows 10 so the result appears okay)
QUESTION
Full disclosure: I'm working on my libui GUI framework's text API. This wraps DirectWrite on Windows, Core Text on OS X, and Pango (which uses HarfBuzz for OpenType shaping) on other Unixes. One of the text formatting attributes I want to specify is a collection of OpenType features to use, which all three provide; DirectWrite's is IDWriteTypography
.
Now, when you draw some text with these libraries, by default you'll get a few useful OpenType features enabled, such as the standard ligatures (liga
) like the f+i ligature. I thought this was font-specific, but it turns out this is specific to the script of the text being shaped. Microsoft provides guidelines for all the scripts supported by OpenType (under "Script-specific Development"), and I can see rather complex logic for doing it all in HarfBuzz itself to confirm it.
On Core Text and Pango, if I enable other attributes, they'll be added on top of these defaults. But with DirectWrite, in particular IDWriteTextLayout::SetTypography()
, doing so removes the defaults:
The program that produces this output is can be found here.
Obviously my first option would be to ask how to get the default features on DirectWrite. Someone did so already on this site, though, and the answer seems to be "no".
I am guessing that DirectWrite is allowing me to be in complete control of the list of features to apply to some text. This is nice, except that I can't do this with the other APIs unless I explicitly disable the default features somehow! Of course, I don't know if this list will ever change, so hardcoding it might not be the best idea.
Even if hardcoding is an option, I could just grab HarfBuzz's list for each script, but a) it's rather complicated b) there are multiple possible shapers for a script, depending on (I think) version compatibility (for instance, Myanmar).
So why not use HarfBuzz's lists to recreate the default list of features for DirectWrite anyway? It seems to want to be accurate to other shapers anyway, so this should work, right? Well I would need to do two things: figure out what script to use, and figure out which attributes to use on which characters for script where the position of a character in the word matters.
DirectWrite provides an interface IDWriteTextAnalyzer
that provides facilities to perform shaping. I could use this, but it seems the script data is returned in a DWRITE_SCRIPT_ANALYSIS
structure, and the description for the script ID says "The zero-based index representation of writing system script.".
This doesn't help, so I wrote a program to just dump the script numbers for text I type in. Running it on the input string
...ANSWER
Answered 2017-Jul-23 at 16:53After some discussions with Peter Sikking and Ebrahim Byagowi, I went and debugged a more general-purpose program I built quickly to test things, and I figured out what's going on internally.
First, however, I will say this applies to Uniscribe and DirectWrite equally.
As it turns out, DirectWrite is always providing a set of default OpenType features, regardless of what feature set I use! The situation is that the list of default features provided differs depending on whether I load my own features or not, and depending on the shaping engine. For the latn
script in horizontal writing mode and for English, this is done with the "generic engine".
If I don't provide any features, the generic engine will load script-specific features. For horizontal latn
, this list is
QUESTION
The Arabic letter noon ghunna (ں) is displayed incorrectly on my Windows 10 PC (in Chrome, Edge, Notepad and Word). The sequence ALEF, NOON GHUNNA, ALEF is displayed as:
The same sequence is displayed correctly on my Android phone without the dot:
For completeness, the actual unicode string (for copy/paste purposes) is:
اںاThere has been some controversy regarding this letter (L2-12/381) which has settled by now as seen from the Unicode Standard which states (since version 7 and up to the current 11):
Rendering systems should display U+06BA as a dual-joining letter, with all four contextual forms shown dotless, regardless of the language of the text.
But the dot appears in word-initial (ںا) and mid-word (اںا) positions. Final (اں) and isolated (ں) forms are fine.
QuestionNow my question is, how can this be fixed, other than by waiting for Microsoft to fix it? I want to understand where the problem lies. Is it in the Uniscribe library, or is it down to the font being used? Can it be fixed by using a specifically crafted TrueType/OpenType font?
...ANSWER
Answered 2018-Jun-26 at 19:41This turned out to be a font problem. Quite a few fonts on fonts.google.com show this letter correctly:
QUESTION
I'm currently about to replace the drawing code for an old component from GDI + UniScribe to Direct2D and DirectWrite (the successors).
So far the transition was straight forward as most of the time all I need to do was to replace calls to the Canvas (class TCanvas) to a custom FDirect2DCanvas instance (class TDirect2DCanvas, from the unit Direct2D).
Unfortunately it doesn't seem that simple when trying to draw a glyph from a TImageList instance onto the FDirect2DCanvas as the draw method is only meant for TCanvas and not for the rather general TCustomCanvas (which is the ancestor of both TCanvas and TDirect2DCanvas).
A solution for this dilemma would be to draw the TImageList glyph to a temporary bitmap and draw this to the TDirect2DCanvas. However, I fear this will probably slow down the drawing performance a lot.
Has anyone so far done this so far? What options do I have?
...ANSWER
Answered 2017-Jun-15 at 12:36If you look at how drawing graphic objects to TDirect2DCanvas
is implemented you will find that it routes through this routine.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install uniscribe
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page