@joint/core 4.0.0 → 4.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -123,12 +123,16 @@ const textAttributesNS = {
123
123
  if (text === undefined) text = attrs.text;
124
124
  if (text !== undefined) {
125
125
  const breakTextFn = value.breakText || breakText;
126
+ const computedStyles = getComputedStyle(node);
127
+
126
128
  wrappedText = breakTextFn('' + text, size, {
127
- 'font-weight': attrs['font-weight'],
128
- 'font-size': attrs['font-size'],
129
- 'font-family': attrs['font-family'],
129
+ 'font-weight': computedStyles.fontWeight,
130
+ 'font-family': computedStyles.fontFamily,
131
+ 'text-transform': computedStyles.textTransform,
132
+ 'font-size': computedStyles.fontSize,
133
+ 'letter-spacing': computedStyles.letterSpacing,
134
+ // The `line-height` attribute in SVG is JoinJS specific.
130
135
  'lineHeight': attrs['line-height'],
131
- 'letter-spacing': attrs['letter-spacing']
132
136
  }, {
133
137
  // Provide an existing SVG Document here
134
138
  // instead of creating a temporary one over again.