Welcome to PlantUML Q&A, where you can ask questions and receive answers from other members of the community.

You can also submit new features request and vote for them.

How do you change the font used for monospaced-style text?

0 votes
How do you change the font used for monospaced-style text?
asked Aug 21, 2015 by anonymous

2 Answers

0 votes

You can use creole parser for that. http://plantuml.com/creole.html

class foo {
this is normal
""this is monospaced""
}
 

 

answered Aug 21, 2015 by plantuml (122,630 points)
This is not what I was trying to figure out how to do. The default font for monospaced text seems to be Courier, or something that looks like it. How do I tell PlantUML to use another font, e.g. Consolas, for all monospaced text?
0 votes

Currently, I think that you cannot. What you can do, is to change the default setting for all fonts ( http://plantuml.com/font.html ) but I guess that this is not what you want

To be clear, you need something like:

skinparam CreoleMonospacedFont Consolas

Is this what you are expecting ?

Note that a possible workaround would be to have:

class Foo {
 This is <font:Consolas>monospaced</font>
}


 

Using the preprocessor ( http://plantuml.com/preprocessing.html ) , you can also have:

!define MS(x) <font:Consolas>x</font>
class Foo {
 This is also MS(monospaced)
}
 

answered Aug 21, 2015 by plantuml (122,630 points)
Thanks for the answer. It would be nice if there's a counterpart to defaultFontName for specifying the font for monospaced text.
Ok, in the last beta https://dl.dropboxusercontent.com/u/13064071/plantuml.jar

You can have:

skinparam defaultFontName Elephant
skinparam defaultMonospacedFontName Forte
class foo {
  This is normal
  ""This is monospaced""
}

Is this what you are expecting ?
Support This Project Offer 250 Mo! Follow PlantUML on Twitter
...