Code Monkey home page Code Monkey logo

Comments (6)

GoogleCodeExporter avatar GoogleCodeExporter commented on September 4, 2024
You need to change the SyntaxStyles class.  The createInstance method sets the
different fonts and colors for each TokenType.  The SyntaxStyle class has the 
fonts
to use in the createFont method.  It uses Courier 12 by default.

I'll probably try and find a way to use the font from the component.  But that 
may
take time.  The other reason I did not implement this, is that I may need to 
change
the font for each TokenType, not just color, bold and italic.

Original comment by [email protected] on 21 Jun 2008 at 5:40

  • Changed state: WontFix
  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

from jsyntaxpane.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 4, 2024
Also check the SyntaxStyle constructor that takes a font as an argument.  This 
is
added in 0.2 release.

Original comment by [email protected] on 21 Jun 2008 at 5:48

from jsyntaxpane.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 4, 2024
i've shadowed the syntaxstyles class for the moment.  i've just removed any 
setFont
calls in it -- it uses the one set on g2d, and hence the component.

Original comment by [email protected] on 21 Jun 2008 at 4:00

from jsyntaxpane.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 4, 2024
I'm able to set the font by doing JEditorPane.setFont() but it isn't consistent 
different fonts.  For example changing to Lucida Console which is supposed to 
be fixed-
width loses its width once in a number sequence which is apparently bold.  I'd 
expect 
that fixed-width fonts would always work but that is not true.  Maybe there is 
a bold 
highlighting of certain types?  Is that true?

Original comment by [email protected] on 6 Mar 2010 at 5:13

from jsyntaxpane.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 4, 2024
After a brief but hilarious foray into the source code, I have stumbled upon 
some marvelous undocumented code. Set the "DefaultFont" property to the font 
name followed by the size eg.

    DefaultSyntaxKit.initKit()
    // override default syntax values
    Configuration config = DefaultSyntaxKit.getConfig(DefaultSyntaxKit.class);
    config.put("DefaultFont","monospaced 14");


Original comment by benneybopper on 6 Feb 2013 at 10:39

from jsyntaxpane.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 4, 2024
This is a good trick. Monospaced is a much better default than Courier, because 
it will automatically pick the right monospaced font for the platform.

Original comment by trejkaz on 6 Jul 2014 at 3:43

from jsyntaxpane.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.