A few quick questions

From: Roland Kay <roland.kay_at_ox.compsoc.net>
Date: Wed Aug 10 2005 - 07:06:16 CEST

Hi guys,

I'm working on a fix for #9240. Sadly, this requires a much bigger patch
than I'd initially expected, so this will be another one to go in once
2.5 is branched. Nevertheless, I have a few questions that I was hoping
someone would know the answers to.

Firstly, if I get a pointer to a font like this...

        GR_Font *pFont;
        pFont = findFont("Times New Roman", ... , "15pt");

Do I need to worry about subsequently freeing the font pointer. The
impression I get from looking at the code is that the GR_Graphics
class caches this pointer and frees it itself when necessary. Is that
right?

Secondly, is there an agreed approach for handling out of memory and
similar errors in class constructors? I gather there are portability
issues for AbiWord with using exceptions for this. Can I use the
UT_THROW() / UT_CATCH() macros as suggested in ut_exceptions.h ?

Finally, is there any way to accurately get the horizontal space
that will be used by a string when displayed on a particular
graphics context? The GR_Graphics::measureString() functions looks
like it's meant to do this. However, it appears to neglect the
inter-character space and so the values it returns rather
underestimate the actual string width.

Any help with these would be much appreciated.

Best wishes,

R.
Received on Wed Aug 10 07:08:10 2005

This archive was generated by hypermail 2.1.8 : Wed Aug 10 2005 - 07:08:11 CEST