Skip to content

ClassAttributeFont(Style|Size|…) overrides ClassFontStyle(Style|Size|…) #1335

@nstanger

Description

@nstanger

Describe the bug

From version 1.2022.2, ClassAttributeFont(Style|Size|…) skinparams change font attributes for all text in a class, not just the attributes, also overriding the effect of any explicit ClassFont(Style|Size|…). This didn’t happen up to version 1.2022.1.

To Reproduce

Minimum working example:

@startuml
skinparam {
    ClassFontStyle bold
    ClassFontSize 14
    ClassAttributeFontStyle plain
    ClassAttributeFontSize 10
}
class Class {
    -attr1
    --
    +method1()
}
@enduml

Expected behavior

Class title should be size 14 and bold, attributes and methods should be size 10 and not bold.

Screenshots

Output of MWE using 1.2022.1 (old default rose skin):
test_1_2022_1

Class title is larger and bold, as expected.

Output of MWE using 1.2023.4 (new default grey skin):
test_1_2023_4

Class title is the same size as the attributes and not bold. I’ve also confirmed the same behaviour in 1.2022.2, 1.2022.14, and 1.2023.0.

Desktop (please complete the following information)

  • OS: macOS Monterey 12.6.3 (behaviour also confirmed under a couple of different Linuxes)
  • Browser Vivaldi
  • Version 5.7.2921.63 (stable)

Smartphone (please complete the following information)

N/A

Additional context

This behaviour first appeared in version 1.2022.2 and is presumably present in all subsequent versions (definitely present in 1.2022.2, 1.2022.14, 1.2023.0, and 1.2023.3). I note that version 1.2022.2 introduced the new default skin, so I wonder whether it is somehow related to that?

It is possible to work around this using Creole and or HTML formatting in the class title, e.g.:

class "<size:14><b>Class2</b></size>" as c2 {
   ...
}

class "<size:14>**Class3**</size>" as c3 {
   ...
}

But this is a bit of a hack and regardless it still seems incorrect for ClassAttributeFont... to override ClassFont....

I guess this will eventually be made obsolete by the new style/theme engine, but that still has a ways to go 😄.

Note that this is not the same thing as #1287, which as far as I’m concerned is expected behaviour and not a bug. (If you set skinparam ClassFontStyle bold, then of course all the text in the class will be bold! 😆)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions