This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
# | |
# This script was created because I had a problem with inkscape not recognizing | |
# fonts generated by R's pdf generator. This will go through and make these fonts | |
# scaleable. | |
# | |
# Workflow: Generate PDF > open in inkscape > save as svg > run this script | |
# | |
# Usage: perl -i inkscape_pdf_font.pl <my_file.svg> | |
# | |
# Note, that the i flag means "inline" | |
use strict; | |
use warnings; | |
while(<>){ | |
s/(x=\"[[:digit:][:punct:]]+?)[[:blank:]].+?$/$1"/g; | |
print $_; | |
} |
Good to know!
Link back to original stackoverflow answer: http://stackoverflow.com/questions/18258654/r-inkscape-text-labels-in-svg-graphics-exported-from-r-did-not-recognized-as/26694900#26694900
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This tip is very usefull, thank you.
I only had to use
perl -i.bak inkscape_pdf_font.pl <my_file.svg>
instead of
perl -i inkscape_pdf_font.pl <my_file.svg>
to run the script and avoid a message
Can't do inplace edit without backup