Comments (6)
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.
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.
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.
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.
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.
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)
- Doesn't play nice with Groovy's SwingBuilder HOT 2
- sql.flex - SQL identifiers can contain #
- PATCH: Allow kit config to specify multiple fonts
- Can't change font in jsyntaxpane HOT 1
- "Find next" bug when no searches have been performed
- Popup menu text not being set
- java.lang.NullPointerException when double click on autocomlete in GroovySyntaxKit HOT 2
- HTML/JavaScript/PHP/CSS Combo-Content-Type
- Do not install the popup menu
- Feature Request - Save Content To Disk
- Unable to access ComboCompletitonAction to create own autocomplites
- LineNumbersRuler font doesn't follow JEditorPane font
- Ctrl-F find enhancement
- NPE when the ruler is installed before the scrollPane
- Question
- SQL display error ("T" = 7) looks like '"T" = 7)
- Some forks/patches
- Cannot properly place text cursor with Japanese characters
- Performance problem for loading large files (>3MB) - and a fix HOT 2
- New, bugfixed, updated version available at GitHub
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jsyntaxpane.