This repository was archived by the owner on Jun 26, 2022. It is now read-only.
Description Hello,
this code
use plotters:: prelude:: * ;
fn main ( ) {
let root_drawing_area = SVGBackend :: new ( "images/0.1.svg" , ( 1159 , 539 ) )
. into_drawing_area ( ) ;
root_drawing_area. fill ( & WHITE ) . unwrap ( ) ;
let text_style = TextStyle :: from ( ( "monospace" , 25 ) . into_font ( ) ) ;
root_drawing_area. draw_text ( "|___|___|" , & text_style, ( 100 , 100 ) ) . unwrap ( ) ;
root_drawing_area. draw_text ( "| | |" , & text_style, ( 100 , 150 ) ) . unwrap ( ) ;
root_drawing_area. draw_text ( "| | |" , & text_style, ( 100 , 200 ) ) . unwrap ( ) ;
}
produce next image:
while all vertical bars should be aligned.
Looks like the problem is in the svg text tag: If I change from
<text x =" 100" y =" 150" dy =" 0.76em" text-anchor =" start" font-family =" monospace" font-size =" 20.161290322580644" opacity =" 1" fill =" #000000" >
| | |
</text >
to
<text x =" 100" y =" 150" dy =" 0.76em" text-anchor =" start" font-family =" monospace" font-size =" 20.161290322580644" opacity =" 1" fill =" #000000" xml : space =" preserve" >
| | |
</text >
(note xml:space="preserve" inside text tag) then it looks better
Reactions are currently unavailable
Hello,
this code
produce next image:

while all vertical bars should be aligned.
Looks like the problem is in the svg text tag: If I change from
to
(note
xml:space="preserve"inside text tag) then it looks better