Inkscape.org
Beyond the Basics Text size with CSS
  1. #1
    Bzz Bzz @Bzz

    I set the text size with a class. Actual size is larger than defined in the class, magnifying facto is 96/90 or 1.0666666666.

    How ro set text size correctly.

  2. #2
    Bzz Bzz @Bzz

    Looks like a more general problem with unit conversion. When I set stroke within a class specifying as  0.25 mm, the actual sie reported in "Stroke style" window is .267 mm. Again similar factor 1.068 (I guess it is actually 96/90 but only three digits of the new size are shown).

  3. #3
    Aero Aero @Aero◻️

    Depends on your template I guess.
    If you set your page size to 1 x 1 inch in document properties, your viewBox is 0 0 90 90.
    If you do the same with File - New from template... - Print - A4, the viewBox is 0 0 96 96.

  4. #4
    Bzz Bzz @Bzz

    OK. But 1mm should be always 1mm and 24pt should be 24pt, at least inside the Inkscape.

    Do you think it is a bu and I should report it as such?

  5. #5
    Bzz Bzz @Bzz

    Do you think it is a bug and I should report it as such?

  6. #6
    Aero Aero @Aero◻️

    The Windows version already have some issues with updating the display when switching units.
    Take a look at the attached samples. Compare Inkscape with browser. The font-size is set in pixels.

     

    Drawing @25.4
    Drawing @96
    Drawing @90
  7. #7
    Bzz Bzz @Bzz

    Thank you for the examples, very helpful. I also red about viewbox in the SVG specification.

    Look that the problem lies in the fact that lengths specified in CSS refers to "internal measurement" that is scaled by viewbox settings, while the Inkscape interface an printouts refer to "external measurement" after scaling. What result in the fact that 10pt or 1mm set in the interface is a different length that 10pt or 1 mm set by a class.

    There are two possibilities:

    1. To set scaling factor to 1 in the Document Properties dialog (Ctrl+Shift+D)

    2. To scale manually every length according to the stetting of your document.

    ANd it also means that it is not possible to write a CSS code that is universal and independent from the setting of viewbox.