Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to set the font of the substituent independently #22

Closed
miracle1111111 opened this issue Jun 15, 2020 · 7 comments
Closed

Comments

@miracle1111111
Copy link

image
Hello, there is a question recently that is very troublesome. Is it possible to set the font of the substituent separately, because the default substituent is italic, and the substituent I want to generate is a normal font. In addition, can the number in the upper right corner of the substituent be placed in the lower right corner? I don’t know where to set it. thank you very much

@johnmay
Copy link
Member

johnmay commented Jun 15, 2020

No it's not an option. The reason it is italic is because people use labels other than R, for example W, Y and even B. Using italics allows us to visually distinguish these from tungsten, yttrium and boron.

image

Note if you want an abbreviation, e.g. -CO2H these will be plain font. We could add option for it but what is the use case, just you don't like it?

@miracle1111111
Copy link
Author

miracle1111111 commented Jun 15, 2020

image
image

Thank you very much for your reply. I want to generate the same picture as the literature, because in the literature, the substituents are plain fonts. The superscripts of substituents in the literature are sometimes in the lower right corner.
image
As you mentioned, the chemical structure pictures generated by the CDK for the above CONH2, CH3, etc. are all expanded, and I don’t know how to generate this.
I really want to know how to solve these problems. thank you very much.

@johnmay
Copy link
Member

johnmay commented Jun 15, 2020

You can use Abbreviations API to contract functional groups.

Why do you want to generate the same picture as in the literature? Even including the ; on the R2 label and the bent ketone bond? The super/subscript is purely a stylistic and not something I think is useful to control in CDK atm - these types of details are more akin to a sketcher (e.g. ChemDraw)

@miracle1111111
Copy link
Author

miracle1111111 commented Jun 15, 2020

Thank you for your reply. Not including the ; I added it by mistake. Because I want to generate the same picture as the literature to train the model, so the effect is better. Finally, I want to change by modifying the source code, but in the source code, I did not find where the settings for the substitute font are

@johnmay
Copy link
Member

johnmay commented Jun 15, 2020

Okay - since this is a 1 off case I think it's best if you change your local version. You need to modify: StandardAtomGenerator.generatePseudoSymbol()

@johnmay johnmay closed this as completed Jun 15, 2020
@johnmay
Copy link
Member

johnmay commented Jul 20, 2020

I've add the following option:

depictgen = depictgen.withParam(StandardGenerator.PseudoFontStyle.class,
                                                          Font.PLAIN);

to configure this. The superscript vs subscript I've left for now.

@miracle1111111
Copy link
Author

miracle1111111 commented Jul 20, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants