Advertisement
metalx1000

Convert BMP Text to SVG

Oct 9th, 2022
1,852
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.32 KB | Source Code | 0 0
  1. ######################################################################
  2. #Copyright (C) 2022  Kris Occhipinti                      
  3. #https://filmsbykris.com
  4.  
  5. #This program is free software: you can redistribute it and/or modify
  6. #it under the terms of the GNU General Public License as published by
  7. #the Free Software Foundation, either version 3 of the License, or
  8. #(at your option) any later version.
  9.  
  10. #This program is distributed in the hope that it will be useful,
  11. #but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. #GNU General Public License for more details.
  14.  
  15. #You should have received a copy of the GNU General Public License
  16. #along with this program.  If not, see <http://www.gnu.org/licenses/>.
  17. ######################################################################
  18. #downloads 10 random names and converts them to svg
  19. #Be sure to download a font file and change the font var
  20. #sudo apt install potrace imagemagick
  21.  
  22. font="Athletic Outfit.ttf"
  23. url="https://randomuser.me/api/?results=10&format=csv"
  24. wget "$url" -qO-|cut -d\, -f3,4|tr "," " "|while read name
  25. do
  26.   convert -size 600x100 xc:white -font "$font" -pointsize 72 -fill black  -draw "text 25,65 '$name'" "$name.bmp"
  27.   potrace -s "$name.bmp" -o "$name.svg"
  28.   rm "$name.bmp"
  29. done
  30.  
Tags: svg text
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement