Menu

#1276 AWTDrawVisitor expects AWTFontManager

cdk-1.4.x
open
nobody
None
1
2013-08-03
2012-11-05
John May
No

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

Related

Bugs: #1276

Discussion

  • Egon Willighagen

    I will fix that...

    But, did you try:

    public void setFontName("Times New Roman")

    ?

     
  • Egon Willighagen

     
  • Egon Willighagen

    You're probably right... I need to check the font manager used by Bioclipse...

     
  • John May

    John May - 2013-08-02

    public void setFontName("Times New Roman")

    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:

    I will fix that...

    But, did you try:

    public void setFontName("Times New Roman")

    ?

    [bugs:#1276] AWTDrawVisitor expects AWTFontManager

    Status: open
    Created: Mon Nov 05, 2012 09:38 PM UTC by John May
    Last Updated: Mon Nov 05, 2012 09:38 PM UTC
    Owner: nobody

    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

    Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/cdk/bugs/1276/

    To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

     

    Related

    Bugs: #1276

  • Egon Willighagen

    OK, what about introducing an intermediate level IAWTFontManager with the getFonts() method?

     
  • John May

    John May - 2013-08-03

    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:

    OK, what about introducing an intermediate level IAWTFontManager with the getFonts() method?

    [bugs:#1276] AWTDrawVisitor expects AWTFontManager

    Status: open
    Created: Mon Nov 05, 2012 09:38 PM UTC by John May
    Last Updated: Fri Aug 02, 2013 06:37 PM UTC
    Owner: nobody

    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

    Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/cdk/bugs/1276/

    To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

     

    Related

    Bugs: #1276

  • John May

    John May - 2013-08-03

    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:

    On Sat, Aug 3, 2013 at 3:40 PM, John May jwmay@users.sf.net wrote:

    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?

    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

    [bugs:#1276] AWTDrawVisitor expects AWTFontManager

    Status: open
    Created: Mon Nov 05, 2012 09:38 PM UTC by John May
    Last Updated: Sat Aug 03, 2013 12:22 PM UTC
    Owner: nobody

    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

    Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/cdk/bugs/1276/

    To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

     

    Related

    Bugs: #1276