Re: Hacktext availability



On Wed, 2005-03-02 at 18:27 -0400, Thomas J. Duck wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Dear Owen,
> 
>      Thanks for your quick response.  I hope that you can appreciate that
> I am trying to contribute, and have come to this list to see if I can get
> some help with a problem that I have been struggling with for some time.
> It's not like I'm a novice programmer.  The questions may sound dumb to
> you, but there are many others struggling with the same problems (google
> "gnomecanvas rotate text" if you like).

Pango support for rotation is quite recent (last fall), so I'd expect
most responses to that search to be older.

Sorry if my responses here sound abrupt, I just don't have a lot of time
to give detailed tutorials at the moment.

>      I am a developer with the plplot project, and have recently written a
> driver for it that can be used to imbed plots in Gnome applications.  I
> have all of this working using gnome-print's Hacktext, but as Jody has
> explained to me, moving to pango (if possible) would be best.
> On Wed, 2 Mar 2005, Owen Taylor wrote:
> > Pango supports shears. Pango handles bounding box rotations. Pango
> > scales under zoom. I think you have some difficulty in your code.
> 
>      When I zoom in with GnomeCanvas, the text doesn't scale.  Maybe
> pango supports scaling, but it's not happening for me on the Canvas,
> although Hacktext scaling works fine.  There is no pango_matrix_shear
> function to go along with pango_matrix_rotate et al (at least not in
> Debian sid). 

Why would you construct the matrices that way? Don't you need to 
match the matrices that the gnome-canvas is passing to you?
There is no pango_matrix_shear() because I don't consider it to be
a common or useful user operation, but you can always construct
a PangoMatrix that shears.

>  And, despite reading the available documentation and
> searching the Web, I can't figure out how to fix this bounding box
> problem.

I think the statement I made earlier that the extents reported by
Pango are in user-space (before transformation) coordinates is
all you need to fix that problem. This is documented in the
docs for pango_context_set_matrix()

>      I would appreciate it if you could provide me with some pointers, and
> have provided a code snippet to that end.  If I haven't given you enough
> information, please let me know and I will elaborate where needed.
> 
> > >      BTW, I am surprised that pango isn't using libart for the matrix
> > > calculations, considering that this is a Gnome project.  Needless
> > > complication, no?
> >
> > Why would I pull in a moderately large, hard to use, scheduled-to-be-
> > replaced library to avoid what ended up being 160 lines of code
> > including documentation?
> 
>      Because standardization is good.  Libart is well documented, and I
> have had no problems using it.  It would be better for the end-user
> application developers like myself if you stuck with the standard until it
> is replaced.

And PangoMatrix is not documented? You have found the Pango docs at
http://developer.gnome.org/doc/API/2.0/pango/, right? (Probably
also installed on your system.) While I wouldn't claim they are great,
PangoMatrix is definitely documented there.
 
There is nothing standard about libart. Honestly, it's a bit of a horror
of a library in many ways. There is no way I'd have made it a dependency
of Pango. There is no *conceivable* way I'd have made it part of the
public Pango API.
						Owen

Attachment: signature.asc
Description: This is a digitally signed message part



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]