Re: wxEuphoria - get_facenames() issue
- Posted by Matt Lewis <matthewwalkerlewis at ?mail?com> Jan 26, 2008
- 801 views
Pete Lomax wrote: > > Fairly obviously, Edita/Arwen uses winAPI, eg from eafonts.ew: > }}} <eucode> > cbid = CallBack(routine_id("EnumFontFamExProc")) > void = c_func(xEnumFontFamiliesExA,{hDC,lf,cbid,0,0}) > </eucode> {{{ > It just builds a list of allowed font sizes in EnumFonFamExProc(), > which gets called for each and every permitted facename/pointsize combo. Yeah, I took a look at that code as soon as Greg mentioned it. > The only thing I can suggest is that if wxEuphoria is implementing > get_facenames() via: > > >>wxFontEnumerator::GetFacenames > >> > >>static wxArrayString GetFacenames(wxFontEncoding encoding = > >>wxFONTENCODING_SYSTEM, bool fixedWidthOnly = false) > > Then it might be possible to build valid sizes in a similar fashion via: > > >>wxFontEnumerator::EnumerateFacenames > >> [snipped] > Not that I properly understand all that but > it would seem to depend on whether that OnFacename (some kind of virtual > function it seems) gets called the same way or not. Yes, wxEuphoria uses GetFaceNames. Basically, GetFaceNames (if you look at the wxWidgets source) uses a simple object that overrides OnFacename, and just accumulates them for you into a wxArrayString, which I turn into a sequence and pass back. Unfortunately, there is no way to get the available sizes through wxWidgets. I did some research into doing this on GTK through pango (the GTK font lib or whatever), and didn't see any obvious way to do it, or if it were available at all. I suspect that I may have to go down into X itself to get this information. Matt