Skip to content

Compiling a D2 diagram with Markdown labels to PNG fails depending on the font size. #2546

Description

@akiles-esta-usado

The example can be compiled correctly to a png image if the font size is 22 in both classes. If the size is 17, the db_users entity is displayed incorrectly, and when the size is 16, nothing is displayed correctly.

vars: {
  d2-config: {
    layout-engine: elk
  }
}

classes: {
  model-proxy: {
    shape: hexagon
    style.font-size: 22
    # style.font-size: 17 # Proxy is shown correctly
    # style.font-size: 16 # Nothing is shown correctly
  }

  model-database: {
    shape: cylinder
    style.font-size: 22
    # style.font-size: 17 # Users is not shown correctly
    # style.font-size: 16 # Nothing is shown correctly
  }
}

proxy: |md
  # Reverse Proxy

  [Web Server: Nginx]
| {class: model-proxy}

db_users: |md
  # Users

  BD: PostgreSQL
| {class: model-database}

db_system: |md
  # Content

  BD: PostgreSQL
| {class: model-database}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions