Home » Developing U++ » U++ Developers corner » Will UPP support full UNICODE (21bits long codepoint)?
Re: Will UPP support full UNICODE (21bits long codepoint)? [message #54623 is a reply to message #54611] |
Sat, 22 August 2020 18:01 |
|
mirek
Messages: 14049 Registered: November 2005
|
Ultimate Member |
|
|
I am now investigating the whole thing in Win32. Let us say we would want just to support 32-bit codepoints as the first step.
Now current model needs following info: a) that the font has glyph for required, b) at least advance width for the glyph.
If we do not want to use Uniscribe, just good old GDI, so far I have only found solution to b), but unfortunately it returns just dimensions of that "box" character that is used in case glyph is missing instead of indicating anyhow that it is actually missing....
void Test(int ch, Font fnt)
{
TIMING("Glyph");
HFONT hfont = GetWin32Font(fnt, 0);
VERIFY(hfont);
if(hfont) {
HDC hdc = CreateIC("DISPLAY", NULL, NULL, NULL);
HFONT ohfont = (HFONT) ::SelectObject(hdc, hfont);
GLYPHMETRICS gm;
memset(&gm, 0, sizeof(gm));
MAT2 m_matrix;
memset8(&m_matrix, 0, sizeof(m_matrix));
m_matrix.eM11.value = 1;
m_matrix.eM22.value = 1;
int gsz = GetGlyphOutlineW(hdc, ch, GGO_NATIVE|GGO_UNHINTED|GGO_METRICS, &gm, 0, NULL, &m_matrix);
if(gsz == GDI_ERROR)
DLOG("Failed " << ch);
if(gm.gmCellIncX != 75)
DLOG(ch << " " << gm.gmCellIncX << ", " << gm.gmCellIncY << ", " << gm.gmptGlyphOrigin.x);
::SelectObject(hdc, ohfont);
::DeleteDC(hdc);
}
}
GUI_APP_MAIN
{
for(int i = 32; i < 100000; i++)
Test(i, Font().Height(100).FaceName("MingLiU-ExtB"));
}
|
|
|
|
Re: Will UPP support full UNICODE (21bits long codepoint)? [message #54627 is a reply to message #54625] |
Sun, 23 August 2020 10:06 |
|
mirek
Messages: 14049 Registered: November 2005
|
Ultimate Member |
|
|
Oblivion wrote on Sat, 22 August 2020 19:29Quote:If we do not want to use Uniscribe, just good old GDI,
Why not? Does U++ also takes care of devices that rely exclusively on GDI?
I guess it is about a) minimising changes in the code b) implementing in other platforms.
I believe we should do this in several phases:
Phase 1: Moving to code to utf8 (that is String instead of WString) and 32-bit codepoints support.
Phase 2: Basic combining characters support
Phase 3: Advanced text layout
for phase 3, we can either decide to use platform specific library (Uniscribe/pango), which would mean encapsulating it to something platform independent, or just use Harfbuzz on all platforms, which I guess will require dealing with glyph metrics and presence.
Mirek
[Updated on: Sun, 23 August 2020 10:07] Report message to a moderator
|
|
|
|
|
|
Goto Forum:
Current Time: Fri Oct 04 14:45:27 CEST 2024
Total time taken to generate the page: 0.02125 seconds
|