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 » U++ Library support » U++ Libraries and TheIDE: i18n, Unicode and Internationalization » Basic character set analyzer
Basic character set analyzer [message #19546] Sat, 13 December 2008 11:26 Go to previous message
cbpporter is currently offline  cbpporter
Messages: 1401
Registered: September 2007
Ultimate Contributor
Before starting to write a text output method capable of font substitution, using a little program to see what fonts contain which characters is a good idea (Mirek's idea).

I've already gotten a lot of valuable information from this little program, so if anybody want to give it a try, run it and post it's result here (or as PM if you don't want to fill up the space here) so I can tell if my assumptions hold out for different versions of Linux, that would be great. I would like to see results both from people who just installed a normal Linux, never bothering to look over the font list and from people who have a localized version of Linux or who manually installed a font to be able to use non English characters.

The program covers code ranges from Basic Latin to Arabic. I did not go any farther yet, because clearly a better interface and way to present information is needed (I'm thinking tables, ranges and percents vs. current character list). But this will be enough to verify my assumptions and write a basic method which will handle for now only the above code ranges.

PS:
To make this work, you are going to have to add this to Draw/Draw.h in FontInfo declaration:
bool       HasChar(int codePoint);
bool       HasCharRange(int startCp, int endCp);
bool       CharRangeEmpty(int startCp, int endCp);

and this to Draw/DrawText.cpp:
bool FontInfo::HasChar(int codePoint)
{
	return XftCharExists(Xdisplay, ptr->xftfont, codePoint);
}

bool FontInfo::HasCharRange(int startCp, int endCp)
{
	for (int i = startCp; i <= endCp; i++)
		if (!XftCharExists(Xdisplay, ptr->xftfont, i))
		    return false;
	return true;
}

bool FontInfo::CharRangeEmpty(int startCp, int endCp)
{
	for (int i = startCp; i <= endCp; i++)
		if (XftCharExists(Xdisplay, ptr->xftfont, i))
		    return false;
	return true;
}

These methods are not final, so add them only for the purpose of running this test.
 
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: GetNativeLangName returns English for non-english languages
Next Topic: Improvements to several Lang.cpp functions
Goto Forum:
  


Current Time: Mon Apr 29 07:09:04 CEST 2024

Total time taken to generate the page: 0.04568 seconds