Wikipedia:WikiProject Chemistry/Structure drawing workgroup/Mysid's script: Difference between revisions

Content deleted Content added
No edit summary
change source to syntaxhighlight
 
(2 intermediate revisions by 2 users not shown)
Line 1:
<sourcesyntaxhighlight lang="perl">
#!/usr/bin/perl -i.old
 
# original source: https://en.wikipedia.org/wiki/Wikipedia:WikiProject_Chemistry/Structure_drawing_workgroup/Mysid%27s_script
 
# Note: "-i.old" means original file will be renamed to <filename>.old
# Modify svg file from BKchem to work with librsvg, for use on Wikimedia.
Line 16 ⟶ 19:
$font_size = $1;
}
# Convert relative font sizes to absolute font sizes
s#(font-size=")([0-9]+)%(")#$1.($2*$font_size/100)."pt".$3#ge;
# Replace baseline-shift="super" with a numeric baseline-shift
Line 34 ⟶ 38:
print $_;
}
</syntaxhighlight>
</source>