[Cairo] Re: Text APIs round 2

graydon hoare graydon at redhat.com
Thu Aug 14 11:18:14 PDT 2003


Keith Packard <keithp at keithp.com> writes:

> > how about also having a couple (maybe-NULL-returning) downcast
> > operators and a query function?
> 
> Hmm.  The idea of using specific types and allowing only a one-way 
> conversion was to identify OS-specific code and not let it "polute" 
> OS-indepedent code.  If you think that kind of B&D design will make your 
> life miserable, then ...

no, I don't think it'll make my life miserable (an API with more
failure cases would, I think, be worse), but I also don't think a
downcast will necessarily cause much pollution; who wants to use
grotty windows/freetype functions where they don't actually need them?

the point I was making is that some users of cairo will in some cases
*certainly* need to use the native font API, so we're going to be
caching a pointer to the native structure anyways. that makes for one
more pointer I have to keep in my struct and one more thing I have to
keep in sync with cairo any time a font call is made. 

> > - someone writing code which has font-system-specific branches can ask
> >   cairo for its opinion on which font system to use, freeing them from
> >   writing font-system-detection configury tests and also enabling say
> >   win32 to silently acquire a fontconfig implementation someday.
> 
> I think the plan is to always prefer the native font system on each
> platform; if win32 (or OS X) move to fontconfig/freetype as their native
> font system, we would migrate along with them. 

fair enough, I didn't mean to suggest otherwise. again, it won't kill
me to do so, I'd just prefer to not have to add lines to my own
configure.ac to set a flag saying which font system to use on a given
platform, when cairo will already know this (for implementing the toy
API). I'd prefer to just ask cairo at runtime, but I can live with it
either way.

-graydon





More information about the cairo mailing list