From 4cc7dde896ab98722523aaf03564d0b014ac9f41 Mon Sep 17 00:00:00 2001 From: Alexander Wang Date: Sun, 25 Dec 2022 21:49:26 -0800 Subject: [PATCH 1/3] text font sizes and bold, italic, underline --- d2exporter/export.go | 24 +- d2graph/d2graph.go | 15 +- d2renderers/d2svg/d2svg.go | 81 +- e2etests/stable_test.go | 9 + .../text_font_sizes/dagre/board.exp.json | 221 +++++ .../text_font_sizes/dagre/sketch.exp.svg | 805 ++++++++++++++++++ .../stable/text_font_sizes/elk/board.exp.json | 211 +++++ .../stable/text_font_sizes/elk/sketch.exp.svg | 805 ++++++++++++++++++ 8 files changed, 2122 insertions(+), 49 deletions(-) create mode 100644 e2etests/testdata/stable/text_font_sizes/dagre/board.exp.json create mode 100644 e2etests/testdata/stable/text_font_sizes/dagre/sketch.exp.svg create mode 100644 e2etests/testdata/stable/text_font_sizes/elk/board.exp.json create mode 100644 e2etests/testdata/stable/text_font_sizes/elk/sketch.exp.svg diff --git a/d2exporter/export.go b/d2exporter/export.go index 1eb2e6445..9706365f0 100644 --- a/d2exporter/export.go +++ b/d2exporter/export.go @@ -81,19 +81,17 @@ func applyStyles(shape *d2target.Shape, obj *d2graph.Object) { if obj.Attributes.Style.FontColor != nil { shape.Color = obj.Attributes.Style.FontColor.Value } - if obj.Attributes.Shape.Value != d2target.ShapeText { - if obj.Attributes.Style.Italic != nil { - shape.Italic, _ = strconv.ParseBool(obj.Attributes.Style.Italic.Value) - } - if obj.Attributes.Style.Bold != nil { - shape.Bold, _ = strconv.ParseBool(obj.Attributes.Style.Bold.Value) - } - if obj.Attributes.Style.Underline != nil { - shape.Underline, _ = strconv.ParseBool(obj.Attributes.Style.Underline.Value) - } - if obj.Attributes.Style.Font != nil { - shape.FontFamily = obj.Attributes.Style.Font.Value - } + if obj.Attributes.Style.Italic != nil { + shape.Italic, _ = strconv.ParseBool(obj.Attributes.Style.Italic.Value) + } + if obj.Attributes.Style.Bold != nil { + shape.Bold, _ = strconv.ParseBool(obj.Attributes.Style.Bold.Value) + } + if obj.Attributes.Style.Underline != nil { + shape.Underline, _ = strconv.ParseBool(obj.Attributes.Style.Underline.Value) + } + if obj.Attributes.Style.Font != nil { + shape.FontFamily = obj.Attributes.Style.Font.Value } } diff --git a/d2graph/d2graph.go b/d2graph/d2graph.go index ebaf0274c..da137cc12 100644 --- a/d2graph/d2graph.go +++ b/d2graph/d2graph.go @@ -441,7 +441,14 @@ func (obj *Object) AbsIDArray() []string { } func (obj *Object) Text() *d2target.MText { - isBold := !obj.IsContainer() + isBold := !obj.IsContainer() && obj.Attributes.Shape.Value != "text" + isItalic := false + if obj.Attributes.Style.Bold != nil && obj.Attributes.Style.Bold.Value == "true" { + isBold = true + } + if obj.Attributes.Style.Italic != nil && obj.Attributes.Style.Italic.Value == "true" { + isItalic = true + } fontSize := d2fonts.FONT_SIZE_M if obj.OuterSequenceDiagram() == nil { if obj.IsContainer() { @@ -464,7 +471,7 @@ func (obj *Object) Text() *d2target.MText { Text: obj.Attributes.Label.Value, FontSize: fontSize, IsBold: isBold, - IsItalic: false, + IsItalic: isItalic, Language: obj.Attributes.Language, Shape: obj.Attributes.Shape.Value, @@ -908,12 +915,14 @@ func (g *Graph) SetDimensions(mtexts []*d2target.MText, ruler *textmeasure.Ruler return err } dims = d2target.NewTextDimensions(width, height) - } else { + } else if obj.Attributes.Language != "" { var err error dims, err = getMarkdownDimensions(mtexts, ruler, obj.Text(), fontFamily) if err != nil { return err } + } else { + dims = getTextDimensions(mtexts, ruler, obj.Text(), fontFamily) } innerLabelPadding = 0 } else if obj.Attributes.Shape.Value == d2target.ShapeClass { diff --git a/d2renderers/d2svg/d2svg.go b/d2renderers/d2svg/d2svg.go index c237483e4..90e7bb191 100644 --- a/d2renderers/d2svg/d2svg.go +++ b/d2renderers/d2svg/d2svg.go @@ -741,9 +741,11 @@ func drawShape(writer io.Writer, targetShape d2target.Shape, sketchRunner *d2ske } else if targetShape.Italic { fontClass += "-italic" } + if targetShape.Underline { + fontClass += " text-underline" + } - switch targetShape.Type { - case d2target.ShapeCode: + if targetShape.Type == d2target.ShapeCode { lexer := lexers.Get(targetShape.Language) if lexer == nil { return labelMask, fmt.Errorf("code snippet lexer for %s not found", targetShape.Language) @@ -784,38 +786,36 @@ func drawShape(writer io.Writer, targetShape d2target.Shape, sketchRunner *d2ske fmt.Fprint(writer, "") } fmt.Fprintf(writer, "") - case d2target.ShapeText: - if targetShape.Language == "latex" { - render, err := d2latex.Render(targetShape.Label) - if err != nil { - return labelMask, err - } - fmt.Fprintf(writer, ``, box.TopLeft.X, box.TopLeft.Y, targetShape.Opacity) - fmt.Fprint(writer, render) - fmt.Fprintf(writer, "") - } else { - render, err := textmeasure.RenderMarkdown(targetShape.Label) - if err != nil { - return labelMask, err - } - fmt.Fprintf(writer, ``, - box.TopLeft.X, box.TopLeft.Y, targetShape.Width, targetShape.Height, - ) - // we need the self closing form in this svg/xhtml context - render = strings.ReplaceAll(render, "
", "
") - - var mdStyle string - if targetShape.Fill != "" { - mdStyle = fmt.Sprintf("background-color:%s;", targetShape.Fill) - } - if targetShape.Stroke != "" { - mdStyle += fmt.Sprintf("color:%s;", targetShape.Stroke) - } - - fmt.Fprintf(writer, `
%v
`, mdStyle, render) - fmt.Fprint(writer, `
`) + } else if targetShape.Type == d2target.ShapeText && targetShape.Language == "latex" { + render, err := d2latex.Render(targetShape.Label) + if err != nil { + return labelMask, err } - default: + fmt.Fprintf(writer, ``, box.TopLeft.X, box.TopLeft.Y, targetShape.Opacity) + fmt.Fprint(writer, render) + fmt.Fprintf(writer, "") + } else if targetShape.Type == d2target.ShapeText && targetShape.Language != "" { + render, err := textmeasure.RenderMarkdown(targetShape.Label) + if err != nil { + return labelMask, err + } + fmt.Fprintf(writer, ``, + box.TopLeft.X, box.TopLeft.Y, targetShape.Width, targetShape.Height, + ) + // we need the self closing form in this svg/xhtml context + render = strings.ReplaceAll(render, "
", "
") + + var mdStyle string + if targetShape.Fill != "" { + mdStyle = fmt.Sprintf("background-color:%s;", targetShape.Fill) + } + if targetShape.Stroke != "" { + mdStyle += fmt.Sprintf("color:%s;", targetShape.Stroke) + } + + fmt.Fprintf(writer, `
%v
`, mdStyle, render) + fmt.Fprint(writer, `
`) + } else { fontColor := "black" if targetShape.Color != "" { fontColor = targetShape.Color @@ -903,6 +903,7 @@ func embedFonts(buf *bytes.Buffer, fontFamily *d2fonts.FontFamily) { triggers := []string{ `class="text"`, + `class="text `, `class="md"`, } @@ -921,6 +922,20 @@ func embedFonts(buf *bytes.Buffer, fontFamily *d2fonts.FontFamily) { } } + triggers = []string{ + `text-underline`, + } + + for _, t := range triggers { + if strings.Contains(content, t) { + buf.WriteString(` +.text-underline { + text-decoration: underline; +}`) + break + } + } + triggers = []string{ `class="text-bold"`, ``, diff --git a/e2etests/stable_test.go b/e2etests/stable_test.go index 6a95949be..2df367f50 100644 --- a/e2etests/stable_test.go +++ b/e2etests/stable_test.go @@ -1615,6 +1615,15 @@ i am bottom right: { shape: text; near: bottom-right } poll the people -> results results -> unfavorable -> poll the people results -> favorable -> will of the people +`, + }, + { + name: "text_font_sizes", + script: `bear: { shape: text; style.font-size: 22; style.bold: true } +mama bear: { shape: text; style.font-size: 28; style.italic: true } +papa bear: { shape: text; style.font-size: 32; style.underline: true } +mama bear -> bear +papa bear -> bear `, }, } diff --git a/e2etests/testdata/stable/text_font_sizes/dagre/board.exp.json b/e2etests/testdata/stable/text_font_sizes/dagre/board.exp.json new file mode 100644 index 000000000..fdb475c2b --- /dev/null +++ b/e2etests/testdata/stable/text_font_sizes/dagre/board.exp.json @@ -0,0 +1,221 @@ +{ + "name": "", + "fontFamily": "SourceSansPro", + "shapes": [ + { + "id": "bear", + "type": "text", + "pos": { + "x": 143, + "y": 141 + }, + "width": 44, + "height": 28, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "transparent", + "stroke": "#0A0F25", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "bear", + "fontSize": 22, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 44, + "labelHeight": 28, + "zIndex": 0, + "level": 1 + }, + { + "id": "mama bear", + "type": "text", + "pos": { + "x": 0, + "y": 3 + }, + "width": 135, + "height": 36, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "transparent", + "stroke": "#0A0F25", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "mama bear", + "fontSize": 28, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 135, + "labelHeight": 36, + "zIndex": 0, + "level": 1 + }, + { + "id": "papa bear", + "type": "text", + "pos": { + "x": 195, + "y": 0 + }, + "width": 134, + "height": 41, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "transparent", + "stroke": "#0A0F25", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "papa bear", + "fontSize": 32, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": false, + "underline": true, + "labelWidth": 134, + "labelHeight": 41, + "zIndex": 0, + "level": 1 + } + ], + "connections": [ + { + "id": "(mama bear -> bear)[0]", + "src": "mama bear", + "srcArrow": "none", + "srcLabel": "", + "dst": "bear", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 67.5, + "y": 39.5 + }, + { + "x": 67.5, + "y": 80.7 + }, + { + "x": 82.7, + "y": 101 + }, + { + "x": 143.5, + "y": 141 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(papa bear -> bear)[0]", + "src": "papa bear", + "srcArrow": "none", + "srcLabel": "", + "dst": "bear", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 262, + "y": 41 + }, + { + "x": 262, + "y": 81 + }, + { + "x": 246.8, + "y": 101 + }, + { + "x": 186, + "y": 141 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + } + ] +} diff --git a/e2etests/testdata/stable/text_font_sizes/dagre/sketch.exp.svg b/e2etests/testdata/stable/text_font_sizes/dagre/sketch.exp.svg new file mode 100644 index 000000000..5c31b0803 --- /dev/null +++ b/e2etests/testdata/stable/text_font_sizes/dagre/sketch.exp.svg @@ -0,0 +1,805 @@ + +bearmama bearpapa bear + + + \ No newline at end of file diff --git a/e2etests/testdata/stable/text_font_sizes/elk/board.exp.json b/e2etests/testdata/stable/text_font_sizes/elk/board.exp.json new file mode 100644 index 000000000..ae4e7c84e --- /dev/null +++ b/e2etests/testdata/stable/text_font_sizes/elk/board.exp.json @@ -0,0 +1,211 @@ +{ + "name": "", + "fontFamily": "SourceSansPro", + "shapes": [ + { + "id": "bear", + "type": "text", + "pos": { + "x": 64, + "y": 153 + }, + "width": 44, + "height": 28, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "transparent", + "stroke": "#0A0F25", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "bear", + "fontSize": 22, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 44, + "labelHeight": 28, + "zIndex": 0, + "level": 1 + }, + { + "id": "mama bear", + "type": "text", + "pos": { + "x": 12, + "y": 17 + }, + "width": 135, + "height": 36, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "transparent", + "stroke": "#0A0F25", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "mama bear", + "fontSize": 28, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 135, + "labelHeight": 36, + "zIndex": 0, + "level": 1 + }, + { + "id": "papa bear", + "type": "text", + "pos": { + "x": 167, + "y": 12 + }, + "width": 134, + "height": 41, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "transparent", + "stroke": "#0A0F25", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "papa bear", + "fontSize": 32, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": false, + "underline": true, + "labelWidth": 134, + "labelHeight": 41, + "zIndex": 0, + "level": 1 + } + ], + "connections": [ + { + "id": "(mama bear -> bear)[0]", + "src": "mama bear", + "srcArrow": "none", + "srcLabel": "", + "dst": "bear", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 79.5, + "y": 53 + }, + { + "x": 79.5, + "y": 153 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(papa bear -> bear)[0]", + "src": "papa bear", + "srcArrow": "none", + "srcLabel": "", + "dst": "bear", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 234, + "y": 53 + }, + { + "x": 234, + "y": 103 + }, + { + "x": 94.16666666666666, + "y": 103 + }, + { + "x": 94.16666666666666, + "y": 153 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + } + ] +} diff --git a/e2etests/testdata/stable/text_font_sizes/elk/sketch.exp.svg b/e2etests/testdata/stable/text_font_sizes/elk/sketch.exp.svg new file mode 100644 index 000000000..506609593 --- /dev/null +++ b/e2etests/testdata/stable/text_font_sizes/elk/sketch.exp.svg @@ -0,0 +1,805 @@ + +bearmama bearpapa bear + + + \ No newline at end of file From 9e658adf089c33d04eaf93c906d7352e15c62a94 Mon Sep 17 00:00:00 2001 From: Alexander Wang Date: Sun, 25 Dec 2022 21:50:40 -0800 Subject: [PATCH 2/3] update tests --- .../d2sketch/testdata/twitter/sketch.exp.svg | 2 +- .../regression/elk_order/dagre/board.exp.json | 8 +- .../regression/elk_order/dagre/sketch.exp.svg | 2 +- .../regression/elk_order/elk/board.exp.json | 8 +- .../regression/elk_order/elk/sketch.exp.svg | 2 +- .../stable/chaos2/dagre/board.exp.json | 132 +++++++++--------- .../stable/chaos2/dagre/sketch.exp.svg | 13 +- .../testdata/stable/chaos2/elk/board.exp.json | 50 +++---- .../testdata/stable/chaos2/elk/sketch.exp.svg | 15 +- .../constant_near_stress/dagre/board.exp.json | 58 ++++---- .../constant_near_stress/dagre/sketch.exp.svg | 13 +- .../constant_near_stress/elk/board.exp.json | 58 ++++---- .../constant_near_stress/elk/sketch.exp.svg | 13 +- .../constant_near_title/dagre/board.exp.json | 2 +- .../constant_near_title/dagre/sketch.exp.svg | 2 +- .../constant_near_title/elk/board.exp.json | 2 +- .../constant_near_title/elk/sketch.exp.svg | 2 +- .../giant_markdown_test/dagre/board.exp.json | 2 +- .../giant_markdown_test/dagre/sketch.exp.svg | 2 +- .../giant_markdown_test/elk/board.exp.json | 2 +- .../giant_markdown_test/elk/sketch.exp.svg | 2 +- .../testdata/stable/hr/dagre/board.exp.json | 2 +- .../testdata/stable/hr/dagre/sketch.exp.svg | 2 +- .../testdata/stable/hr/elk/board.exp.json | 2 +- .../testdata/stable/hr/elk/sketch.exp.svg | 2 +- .../stable/latex/dagre/board.exp.json | 6 +- .../stable/latex/dagre/sketch.exp.svg | 2 +- .../testdata/stable/latex/elk/board.exp.json | 6 +- .../testdata/stable/latex/elk/sketch.exp.svg | 2 +- .../testdata/stable/li1/dagre/board.exp.json | 2 +- .../testdata/stable/li1/dagre/sketch.exp.svg | 2 +- .../testdata/stable/li1/elk/board.exp.json | 2 +- .../testdata/stable/li1/elk/sketch.exp.svg | 2 +- .../testdata/stable/li2/dagre/board.exp.json | 2 +- .../testdata/stable/li2/dagre/sketch.exp.svg | 2 +- .../testdata/stable/li2/elk/board.exp.json | 2 +- .../testdata/stable/li2/elk/sketch.exp.svg | 2 +- .../testdata/stable/li3/dagre/board.exp.json | 2 +- .../testdata/stable/li3/dagre/sketch.exp.svg | 2 +- .../testdata/stable/li3/elk/board.exp.json | 2 +- .../testdata/stable/li3/elk/sketch.exp.svg | 2 +- .../testdata/stable/li4/dagre/board.exp.json | 2 +- .../testdata/stable/li4/dagre/sketch.exp.svg | 2 +- .../testdata/stable/li4/elk/board.exp.json | 2 +- .../testdata/stable/li4/elk/sketch.exp.svg | 2 +- .../stable/lone_h1/dagre/board.exp.json | 2 +- .../stable/lone_h1/dagre/sketch.exp.svg | 2 +- .../stable/lone_h1/elk/board.exp.json | 2 +- .../stable/lone_h1/elk/sketch.exp.svg | 2 +- .../stable/markdown/dagre/board.exp.json | 2 +- .../stable/markdown/dagre/sketch.exp.svg | 2 +- .../stable/markdown/elk/board.exp.json | 2 +- .../stable/markdown/elk/sketch.exp.svg | 2 +- .../markdown_stroke_fill/dagre/board.exp.json | 4 +- .../markdown_stroke_fill/dagre/sketch.exp.svg | 2 +- .../markdown_stroke_fill/elk/board.exp.json | 4 +- .../markdown_stroke_fill/elk/sketch.exp.svg | 2 +- .../md_2space_newline/dagre/board.exp.json | 2 +- .../md_2space_newline/dagre/sketch.exp.svg | 2 +- .../md_2space_newline/elk/board.exp.json | 2 +- .../md_2space_newline/elk/sketch.exp.svg | 2 +- .../md_backslash_newline/dagre/board.exp.json | 2 +- .../md_backslash_newline/dagre/sketch.exp.svg | 2 +- .../md_backslash_newline/elk/board.exp.json | 2 +- .../md_backslash_newline/elk/sketch.exp.svg | 2 +- .../md_code_block_fenced/dagre/board.exp.json | 2 +- .../md_code_block_fenced/dagre/sketch.exp.svg | 2 +- .../md_code_block_fenced/elk/board.exp.json | 2 +- .../md_code_block_fenced/elk/sketch.exp.svg | 2 +- .../dagre/board.exp.json | 2 +- .../dagre/sketch.exp.svg | 2 +- .../md_code_block_indented/elk/board.exp.json | 2 +- .../md_code_block_indented/elk/sketch.exp.svg | 2 +- .../md_code_inline/dagre/board.exp.json | 2 +- .../md_code_inline/dagre/sketch.exp.svg | 2 +- .../stable/md_code_inline/elk/board.exp.json | 2 +- .../stable/md_code_inline/elk/sketch.exp.svg | 2 +- .../testdata/stable/p/dagre/board.exp.json | 2 +- .../testdata/stable/p/dagre/sketch.exp.svg | 2 +- e2etests/testdata/stable/p/elk/board.exp.json | 2 +- e2etests/testdata/stable/p/elk/sketch.exp.svg | 2 +- .../testdata/stable/pre/dagre/board.exp.json | 2 +- .../testdata/stable/pre/dagre/sketch.exp.svg | 2 +- .../testdata/stable/pre/elk/board.exp.json | 2 +- .../testdata/stable/pre/elk/sketch.exp.svg | 2 +- .../TestExport/shape/text_color.exp.json | 2 +- 86 files changed, 258 insertions(+), 274 deletions(-) diff --git a/d2renderers/d2sketch/testdata/twitter/sketch.exp.svg b/d2renderers/d2sketch/testdata/twitter/sketch.exp.svg index f93b93c1f..a45b29f99 100644 --- a/d2renderers/d2sketch/testdata/twitter/sketch.exp.svg +++ b/d2renderers/d2sketch/testdata/twitter/sketch.exp.svg @@ -796,7 +796,7 @@ width="3454" height="2449" viewBox="-100 -100 3454 2449">aabbllmm

nn

-
oocciikkdd

gg

-
hhjj

ee

-
ff1122 334455667788 - +aabbllmmnnoocciikkddgghhjjeeff1122 334455667788 + - + - + aabbllmm

nn

-
oocciikkdd

gg

-
hhjj

ee

-
ff1122 334455667788 - +aabbllmmnnoocciikkddgghhjjeeff1122 334455667788 + - + - - + + xy

The top of the mountain

-
JoeDonald

Cats, no less liquid than their shadows, offer no angles to the wind.

+xyThe top of the mountainJoeDonald

Cats, no less liquid than their shadows, offer no angles to the wind.

If we can't fix it, it ain't broke.

Dieters live life in the fasting lane.

-

i am top left

-

i am top right

-

i am bottom left

-

i am bottom right

-
- +
i am top lefti am top righti am bottom lefti am bottom right + xy

The top of the mountain

-
JoeDonald

Cats, no less liquid than their shadows, offer no angles to the wind.

+xyThe top of the mountainJoeDonald

Cats, no less liquid than their shadows, offer no angles to the wind.

If we can't fix it, it ain't broke.

Dieters live life in the fasting lane.

-

i am top left

-

i am top right

-

i am bottom left

-

i am bottom right

-
- +
i am top lefti am top righti am bottom lefti am bottom right + poll the peopleresultsunfavorablefavorablewill of the people

A winning strategy

-
+ poll the peopleresultsunfavorablefavorablewill of the people

A winning strategy

-
+ mixed togethersugarsolution we get +mixed togethersugarsolution we get mixed togethersugarsolution we get +mixed togethersugarsolution we get

Markdown: Syntax

-
ab +ab

Markdown: Syntax

-
ab +ab markdown

Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

-
+ markdown

Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

-
+ markdown

Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

-
+ markdown

Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

-
+

code

-
ab +ab

code

-
ab +ab