Re: Hacktext availability



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



     Can somebody offer me some advice for this?  With a little
information or documentation, I will be able to continue our project and
also hopefully fix what's broke in the GnomeCanvas.  --Tom


On Wed, 2 Mar 2005, Thomas J. Duck wrote:

> Dear Owen,
>
> > Sorry if my responses here sound abrupt, I just don't have a lot of time
> > to give detailed tutorials at the moment.
>
>      No worries.  I can certainly understand time constraints.
>
>      I think that maybe we are talking about two different things.  I
> create text on the Gnome Canvas using
>
>   item = gnome_canvas_item_new (group,
> 				GNOME_TYPE_CANVAS_TEXT,
> 				"markup",markup,
> 				"font-desc",description,
> 				"fill-color-rgba",dev->color,
> 				"x",0.,
> 				"y",0.,
> 				NULL);
>
> and then request a magnification with
>
>   gnome_canvas_set_pixels_per_unit(canvas,magnification);
>
> One would expect the text to increase in size by the magnification (as is
> the behaviour of gnome-print's Hacktext), but it doesn't.  I suppose that
> I could scale pango text manually, but that isn't consistent with what is
> expected on the Gnome Canvas.
>
>      I have read the documentation that you suggested on
> pango_context_set_matrix (), but can't understand how I would use this
> information to fix the bounding box problem under rotations.  The code
> snippet that I provided before rotates the text, but it is clipped by
> an unrotated bounding box.  I have read the docs extensively, but there is
> not enough information for me to understand why this is happening or
> to change the behaviour.  I (and the plplot authors) would be very
> grateful if you could point out how it is done.  The Hacktext api is not
> public, and we would very much like to move to pango instead.
>
>      With respect to shear transforms, I agree that I can just set the
> matrices directly, and will do so in the future.
>
>      I also agree that the documentation for the pango matrices is
> sufficient.  However, it is helpful to have consistent standards for any
> project:  I now have a mix of libart matrices (for GnomeCanvas),
> PangoMatrix, and PLplot transformation matrices in a single Gnome project.
> I think that this kind of complication uneccessarily adds complexity for
> your end-user developers.  I'm not trying to be critical, but am just
> trying to provide some (hopefully helpful) feedback here.
>
> Sincerely,
> Tom
>
> --
>
> On Wed, 2 Mar 2005, Owen Taylor wrote:
>
> > On Wed, 2005-03-02 at 18:27 -0400, Thomas J. Duck wrote:
> > >
> > > 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
> >
> >

- --
Thomas J. Duck <tomduck fizz phys dal ca>

  Department of Physics and Atmospheric Science, Dalhousie University,
    Halifax, Nova Scotia, Canada, B3H 3J5.
  Tel: (902)494-1456 | Fax: (902)494-5191 | Lab: (902)494-3813
  Web: http://aolab.phys.dal.ca/~tomduck/
  Public key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x17D965DB
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFCKHwUndxDHhfZZdsRAgO4AJ9WSaXJX2oqPepTWBZg7z8uLhPSWQCePwV5
FmEp8RM5IYXGGSjiZtaDRLY=
=FpMF
-----END PGP SIGNATURE-----




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