Hi Mark,

I'm afraid that a lot of the fine control that it looks like you want is
not going to be possible. But I will do what I can.

Your questions are all connected to the old, pure Python, drawing code.
We're not doing anything further with this and I'm encouraging people to
switch over to the new C++ drawing code. There are some functions in
rdkit.Chem.Draw that use this, but if you're interested in having a bit
more control over the options, you should use the MolDraw2DSVG or
MolDraw2DCairo classes for this.

A general point is that all of this stuff is "under documented". There is
some info on the RDKit blog, but the best way to figure out how to use it
is generally via searching the mailing list, asking here, or just
experimenting with the options that are there. I will eventually write docs
for this, but it's one of those things that can also be done by members of
the community.

A couple more detailed answers, in the context of using MolDraw2DSVG since
I think that's what you're looking to generate, are below.

On Wed, Oct 18, 2017 at 7:21 AM, mark <em...@ej73.com> wrote:

> This outputs several files for various screen sizes of mobile I'm
> developing for.
>
> 1) How can I make the font weight bold?  or italic for that matter.  The
> sping/piddle docs list these with the font face and size but these are
> split out in the rdkit docs
>

At the moment there's no way to do this other than editing the SVG that
comes out of the rendering code. As long as you want all the text to be the
same, this is a straightforward string replacement operation. Finer control
than that is not currently possible.


> 2) I found http://www.rdkit.org/docs/api/rdkit.Chem.Draw.
> MolDrawing%27.DrawingOptions-class.html
> <http://www.rdkit.org/docs/api/rdkit.Chem.Draw.MolDrawing'.DrawingOptions-class.html>
>  having
> looked at the code for MolDrawing, but there appears to be no documentation
> as regard what each of these options does. Where is this documentation?
>

non-existent, see above


> 3) Even with options.defaultColor = (1, 1, 1) non-carbon atoms display
> coloured (O red, N blue etc). But I need a monochrome image.  Can anyone
> confirm if monochrome images are possible please and how this is done?
>

Here's how you draw a molecule in black and white using the new code:
    d = Draw.MolDraw2DSVG(300, 300)
    d.drawOptions().useBWAtomPalette()
    d.DrawMolecule(dm)
    d.FinishDrawing()



> 4) In the attached image, you will notice that the non-carbon,
> non-hydrogen atoms are slightly out of place, too far down from exactly
> where they are expected to be drawn.  How can this be adjusted?  It appears
> not to matter what I set the font size to, they are always out of place.  I
> think this might be because of the fact the glyphs are aligned to the
> bottom of their containers in the svg.
>
>
>
Dealing with this stuff in a cross-platform way is a really hard problem.
Try the new code out. You may find that it's better at this. It should at
least have different pathologies. :-S


> Great kit!
>

Thanks!

-greg


>
> Thanks IA,
>
> Mark Lewis
>
>
>
>
>
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to