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

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

2 Answers

0 votes
answered Aug 21, 2015 by plantuml (131,070 points)

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

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

 

commented Aug 21, 2015 by anonymous
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
answered Aug 21, 2015 by plantuml (131,070 points)

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)
}
 

commented Aug 21, 2015 by anonymous
Thanks for the answer. It would be nice if there's a counterpart to defaultFontName for specifying the font for monospaced text.
commented Aug 24, 2015 by plantuml (131,070 points)
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 ?
...