plantuml / plantuml

Generate diagrams from textual description
https://plantuml.com
Other
10.23k stars 929 forks source link

[Font][`Skinparam` or `Style`] Issues on fall back font #1436

Open The-Lum opened 1 year ago

The-Lum commented 1 year ago

Hi PlantUML team,

(Observed on V1.2023.9beta1): In order to make a sum-up about the fall-back fonts topic.

By skinparam

It seems there are some defects with skinparam:

Source

@startuml
skinparam DefaultFontName "Hack", "DejaVu Sans Mono", "Courier New", "Nimbus Mono L", "Monospaced", Courier, monospace

[Component\nABC]
frame "Frame" {
  card Card
}
@enduml

PNG: KO :x:

:x: KO: The font is not monospaced.

SVG: ~KO :large_orange_diamond:

✔️ The font is monospaced :large_orange_diamond: but here is the not good (with ") SVG output:

<text fill="#000000" font-family="&quot;Hack&quot;, &quot;DejaVu Sans Mono&quot;, &quot;Courier New&quot;, Courier, monospace" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="50" x="155" y="20.9951">Frame</text>

See also similar/pseudo issues here:

By style

And a new question will be:

Possible source proposal

@startuml
<style>
root {
  FontName "Hack", "DejaVu Sans Mono", "Courier New", "Nimbus Mono L", "Monospaced", Courier, monospace
}
</style>

[Component\nABC]
frame "Frame" {
  card Card
}
@enduml

Related issue or discussion

Ref.

Regards, Th.

[FYI @bondden for the mono theme]

arnaudroques commented 1 year ago

Thank you for your tests! This should be fixed in last snapshot and on the online server. Tell us what you think about it!

The-Lum commented 1 year ago

Hi @arnaudroques, and all,

This looks good (see next comment!) except for a difference on the SVG output (with or whitout simple quote) between:

skinparam

<text fill="#000000" font-family="'Hack', 'DejaVu Sans Mono', 'Courier New', 'Nimbus Mono L', 'Monospaced', Courier, monospace" font-size="14" font-weight="bold"
...

style

<text fill="#000000" font-family="Hack, DejaVu Sans Mono, Courier New, Nimbus Mono L, Monospaced, Courier, monospace" font-size="14" font-weight="bold"
...

I don't know if that has any bearing (about simple quote or not)...

Thanks for this fix. We will be able to correct the mono theme...

Regards, Th.

The-Lum commented 1 year ago

Hi @arnaudroques, and PlantUML team,

After tests, here is a PNG non working example from:

Code

skinparam DefaultFontName "jlm_cmmi10"
Title Test: "jlm_cmmi10"

VS

skinparam DefaultFontName "NotExistingFont", "jlm_cmmi10"
Title Test: "NotExistingFont", "jlm_cmmi10"

PNG: OK with only 1 font ✔️

PNG: KO with 2 fonts ❌


Regards, Th.

arnaudroques commented 1 year ago

We have fixed:

skinparam DefaultFontName "NotExistingFont", "jlm_cmmi10"
Title Test: "NotExistingFont", "jlm_cmmi10"

in last snapshot.

There must be other issues, but I think it would be better to open new issues and close this one (if you agree)

The-Lum commented 1 year ago

Hi PlantUML team,

Yes of course... You can close it and I can go to some new tests...

Regards, Th.