Setting circledChargeFont on png exportToBinFormat

User 956e0ca334

15-11-2013 09:06:06

Hi there,


We are using the marvin sketch applet on our input system to create a series of images on saving of the marvin file.  We use Times New Roman as our default font.  As charges are not dispalying correctly in Times New Roman  I set circledChargeFont to SansSerief on the applet. However on export I cannot seem to get this value to be picked up. Please see below:


    String formatString = ",atsiz0.4000000000000001,"
                    + "atomFont:Times New Roman-PLAIN-12,"
                    + "bondw0.125,"
                    + "wireThickness0.045,"
                    + "stickThickness0.07,"
                    + "ballRadius0.35,"
                    + "H_hetero,"
                    + "anybond_solid,"
                    + "cv_inChain,"
                    + "#ffffff,"
                    + "ligandOrderVisibility_withDef,"
                    + "mono,"
                    + "aprop,"
                    + "downwedge_mdl,"
                    + "coordBondStyle_solid,"
                    + "coordBondStyleAtMulticenter_solid,"
                    + "chargeWithCircle,"
                    + "circledChargeFont:SansSerif,"
                    + "wireframe";


 


   byte[] moldata = MolExporter.exportToBinFormat(doc, "png:scale30" + formatString);
            File destinationFile = new File("myFile.png");


The charges keep coming out incorrectly- i.e. still Times New Roman and appear as squares as it can not find the character - not in SansSerif.  Am I seting this incorrectly?


Regards


Megan


 

ChemAxon 5433b8e56b

25-11-2013 14:37:16

Hi Megan,


sorry for the late reply, in the release rush I have just had the time to check on this question deeply. Please find my answer below.


First of all, the circled charge font parameter is not public yet, since it is a subject to change along with the atomFont parameter. They are currently working as is, and they definitelly will change in the future, as soon as we will have the time to replace the export option handling. We will try to do this in a backward compatible manner, but please be prepared for an incompatible change in relation to the font related parameters.


The charge font parameter is called "chargeFont" and in your case it needs to be specified as "SansSerif-PLAIN-12" for example to work as expected.


In your code example the incriminated line has to be changed to the following:


+ "chargeFont:SansSerif-PLAIN-12,"

The interpreting mechanism of the chargeFont paramter is similar to the atomFont parameter, we discussed before in an other thread.


Regards,
Istvan