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 » GetFontInfo without a Draw object?
GetFontInfo without a Draw object? [message #4932] Sat, 26 August 2006 13:14 Go to next message
Werner is currently offline  Werner
Messages: 234
Registered: May 2006
Location: Cologne / Germany
Experienced Member
I would like to extend the "reference/Display" example so that only these files are added to the DropList which are scalable (scaleable).

I should be able to write as follows:

...
Font fnt;
FontInfo fi;
for(int i = 0; i < Font::GetFaceCount(); i++)
{
    fnt = Font(i, 20);
    fi = Draw::GetFontInfo(fnt)
    if (fi.IsScaleable)
        dl.Add(i);
}
...


But that doesn't work. The compiler tells me that "GetFontInfo" is a non-static private member function of the Draw class. And "Draw.h" tells me even more that "GetFontInfo" or "private: GetFontInfo" respectively is deprecated.

What now?

Werner
Re: GetFontInfo without a Draw object? [message #4972 is a reply to message #4932] Mon, 28 August 2006 21:31 Go to previous messageGo to next message
Werner is currently offline  Werner
Messages: 234
Registered: May 2006
Location: Cologne / Germany
Experienced Member
Werner wrote on Sat, 26 August 2006 13:14

I would like to extend the "reference/Display" example so that only these files are added to the DropList which are scalable (scaleable).

I should be able to write as follows:

...
Font fnt;
FontInfo fi;
for(int i = 0; i < Font::GetFaceCount(); i++)
{
    fnt = Font(i, 20);
    fi = Draw::GetFontInfo(fnt)
    if (fi.IsScaleable)
        dl.Add(i);
}
...


But that doesn't work. The compiler tells me that "GetFontInfo" is a non-static private member function of the Draw class. And "Draw.h" tells me even more that "GetFontInfo" or "private: GetFontInfo" respectively is deprecated.

What now?

Werner



I did it myself. Very Happy The code reads as follows:

...
Font fnt;
FontInfo fi;
for(int i = 0; i < Font::GetFaceCount(); i++)
{
    fnt = Font(i, 20);
    fi = fnt.Info()
    if (fi.IsScaleable)
        dl.Add(i);
}
...


Werner
Re: GetFontInfo without a Draw object? [message #4976 is a reply to message #4972] Mon, 28 August 2006 23:28 Go to previous message
mirek is currently offline  mirek
Messages: 12105
Registered: November 2005
Ultimate Member
Yes, FontInfo/Draw decoupling was one of changes in "new" U++...

Mirek
Previous Topic: PATCH: Image load progress update
Next Topic: GIF reader BUG? Or BUG in inserting GIF into QTF?
Goto Forum:
  


Current Time: Wed Nov 20 05:54:45 CET 2019

Total time taken to generate the page: 0.01910 seconds