Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13980
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"));
}
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [Proposition] Simply source package manager for Upp
Next Topic: Uppiverse2
Goto Forum:
  


Current Time: Tue May 14 10:01:52 CEST 2024

Total time taken to generate the page: 0.02253 seconds