How to get an outline effect on text in SVG?

前端 未结 5 2010
南方客
南方客 2020-12-24 10:53

I just want a simple SVG image that has some arbitrary text on an angle, which I can do. Thing is, I also want the text to have a sort of \"outline\" effect. Like rather t

5条回答
  •  Happy的楠姐
    2020-12-24 11:25

    paint-order: stroke; worked wonders for me in this D3 chart I'm working on.

    My final css:

    .name-text {
        font-size:  18px;
        paint-order: stroke;
        stroke: #000000;
        stroke-width: 1px;
        stroke-linecap: butt;
        stroke-linejoin: miter;
        font-weight: 800;
    }
    

    My source (scroll down just a bit): https://svgwg.org/svg2-draft/painting.html#PaintOrderProperty

提交回复
热议问题