Tokamak icon indicating copy to clipboard operation
Tokamak copied to clipboard

Font size is not working properly

Open jhonatn opened this issue 3 years ago • 3 comments

Describe the bug Texts are not reflecting custom sizes. That is because Font's font-size attribute is getting ignored for not using a proper length unit.

To Reproduce Steps to reproduce the behavior:

  1. Use The TokamakStaticHTML renderer
  2. Use the Font.system() or Font.custom() method for any text Text("Example").font(.system(size: 64, weight: .bold))
  3. See error, visually and in the inspection console

Expected behavior The text should be displayed using the specified text size.

Desktop (please complete the following information):

  • OS: macOS 11.6.2
  • Browser: Safari
  • Version of the browser: 15.2
  • Version of Tokamak: 0.9.0

Additional context The problem seems to happen here, line 87, where a length unit is never set

jhonatn avatar Jan 15 '22 19:01 jhonatn

Experiencing same issue. Is it simply about adding px, e.g. "font-size": "\(proxy._size)px"? Or am I too optimistic?

DimaMishchenko avatar Mar 09 '22 14:03 DimaMishchenko

@carson-katri could we expect any improvements in this as a result of your work in #472?

MaxDesiatov avatar Mar 09 '22 14:03 MaxDesiatov

No, it doesn’t handle any text styling yet.

carson-katri avatar Mar 09 '22 15:03 carson-katri