HI Dmitri,

Sorry for the delay replying. I assume that by 'add padding' you mean that
the code that generates the 2D drawing coordinates should take account of
the size of the labels and would, from your example, maybe open out the
C9-O23-C14 bond a bit so that O21 and O24 are further apart?  If so, then I
can duck that one cheerfully as it's not part of the MolDraw2D code. The 2D
coordinates are generated in RDDepictor - MolDraw2D just uses the results
from that.  Having just had a peer at $RDBASE/GraphMol/Depictor/Depictor.h,
it would seem as though adding a padding as you suggest might not be
straightforward, but I guess it might be possible to alter the distance
matrix that is being embedded in 2D to take account of atom label sizes.
The joy of open source projects is of course that you have the opportunity
to change things if you don't like how they're done at present.  Maybe
something to think about at the UGM hackathon day?

As you say, your best bet in the short term is probably to adjust the font
size in the drawing.  MolDraw2D.h says that the font sizes are given "in
molecule coordinate units. That's probably Angstrom for RDKit" which in
reality means it's relative to a C-C bond in benzene of 1.5 units. This is
then changed internally to a value appropriate for the drawing engine that
is being used in a particular instance.  If you can see a sensible place to
put this information in the documentation, feel free to send a changed
version to Greg for inclusion in the next release.  I am struggling to find
any such documentation myself, and maybe that was your point ;-).

Cheers,
Dave


On Fri, Sep 2, 2016 at 9:07 PM, Dimitri Maziuk <dmaz...@bmrb.wisc.edu>
wrote:

> Hi all,
>
> I finally got a round tuit for playing with the drawing code and I like
> it -- great job, thank you Greg and Dave and everyone who contributed.
>
> One question though: is it possible to add padding around atom labels?
> Or use some other trick to make the attached look less crowded? (Yes, I
> do want all Hs and all atom labels with numbers.)
>
> The best I can come up with is reduce the font size a little, that works
> fine. I think it'd be nice if the fine manual for MolDraw2D said what
> the units used by FontSize()/SetFontSize() are.
>
> So, any better ideas than just slightly smaller labels?
>
> TIA
> --
> Dimitri Maziuk
> Programmer/sysadmin
> BioMagResBank, UW-Madison -- http://www.bmrb.wisc.edu
>
> ------------------------------------------------------------
> ------------------
>
> _______________________________________________
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
>
------------------------------------------------------------------------------
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to