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 » Draw, Display, Images, Bitmaps, Icons » Bug in DrawText and Font issue
Bug in DrawText and Font issue [message #13214] Sat, 22 December 2007 11:20 Go to previous message
Werner is currently offline  Werner
Messages: 234
Registered: May 2006
Location: Cologne / Germany
Experienced Member

I have found 2 problems when selecting and displaying fonts:

The ***minor*** issue is that, what a particular font is, seems to be not generally acknowledged. So Ultimate++ tells me (GetFaceCount) that there are 117 fonts on my machine. MS Word finds 71 and AMP Font Viewer sees 93.

It would be nice to know exactly what criteria Ultimate++ uses to define a distinct font.

The ***major*** issue is that DrawText sometimes uses the wrong face to display text in a certain font. Namely on my machine a text in "ZapfDingbats" or in "Zymbol" is displayed in "Windings".

Please check the following listing and have a look at the attached screenshot.

#include <CtrlLib/CtrlLib.h>

using namespace Upp;

class MyWin : public TopWindow
{
	virtual void Paint(Draw& w)
	{
		w.DrawRect(GetSize(), White());
		
		Font f0(87, 12);										// @Arial Unicode MS
		
		Font f1(48, 24);										// Windings
		w.DrawText(10, 10, f1.GetFaceName(), f0, LtBlue);
		w.DrawText(10, 30, "Programming is fun!", f1, LtBlue);

		Font f2(82, 24);										// ZapfDingbats	
		w.DrawText(10, 70, f2.GetFaceName(), f0);
		w.DrawText(10, 90, "Programming is fun!", f2);

		Font f3(83, 24);										// Zymbol
		w.DrawText(10, 130, f3.GetFaceName(), f0);
		w.DrawText(10, 150, "Programming is fun!", f3);
	}
};

GUI_APP_MAIN
{
	MyWin win;
	
	win.SetRect(0, 0, 450, 200);
	win.Run();
}

Werner

index.php?t=getfile&id=891&private=0
  • Attachment: UppVsAMP.jpg
    (Size: 42.64KB, Downloaded 801 times)

[Updated on: Sat, 22 December 2007 18:45]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Antialiasing for lines
Next Topic: Image into a polimorphic array
Goto Forum:
  


Current Time: Sat Apr 20 14:14:55 CEST 2024

Total time taken to generate the page: 0.02525 seconds