Not sure if this is really a bug but this cast is a bit naughty:
public void setFontManager(IFontManager fontManager) { this.fontManager = (AWTFontManager) fontManager; }
I haven't check whether this is also in JChemPaint - it may have been resolved. Either way it would be nice to be able to set the font on the rendering. Currently it is fixed as Arial.
I tried to add my own font manager but it seems you have to use the AWTFontManager due to the case.
J
I will fix that...
But, did you try:
public void setFontName("Times New Roman")
?
Patch available from: https://sourceforge.net/p/cdk/patches/657/
You're probably right... I need to check the font manager used by Bioclipse...
Yeah, I was more referring to the starting size via a Font object etc.. setFont(Font f)
J
On 2 Aug 2013, at 11:55, Egon Willighagen egonw@users.sf.net wrote:
Related
Bugs: #1276
OK, what about introducing an intermediate level IAWTFontManager with the getFonts() method?
I'm not exactly sure how it's supposed to work but that doesn't sound right…
Maybe see how the fonts will be done in the SVGGenerator?
J
On 3 Aug 2013, at 13:22, Egon Willighagen egonw@users.sf.net wrote:
Related
Bugs: #1276
On Sat, Aug 3, 2013 at 3:40 PM, John May jwmay@users.sf.net wrote:
Not via a font manager...
But this is the SWTRenderer using:
http://pele.farmbio.uu.se/nightly-jcp/api/org/openscience/cdk/renderer/font/SWTFontManager.html
And SWT does indeed have it's own Font...
Egon
--
Dr E.L. Willighagen
Postdoctoral Researcher
Department of Bioinformatics - BiGCaT
Maastricht University (http://www.bigcat.unimaas.nl/)
Homepage: http://egonw.github.com/
LinkedIn: http://se.linkedin.com/in/egonw
Blog: http://chem-bla-ics.blogspot.com/
PubList: http://www.citeulike.org/user/egonw/tag/papers
Okay, just had another look. I think a good fix would be to tie the the FontManager to the draw visitor as an attribute. If the AWTDrawVisitor only accepts an AWTFontManager (or interface) and the SWTDrawVisitor only accepts an SWTFontManager having these a member of the DrawVisitor would allow the type to be enforce.
It would need some reshuffling to set the font zoom before drawing but I think this would make more sense.
J
On 3 Aug 2013, at 15:48, Egon Willighagen egonw@users.sf.net wrote:
Related
Bugs: #1276