I have a couple (20) of svg-fonts (xml based font format), on average each one of them is about 300kb and contains about 100 Glyph-tags. I would like to process each glyph with Inkscape. So the part of XML-processing I would like to do with a Powershell script is:
- Open the font as XML
- Iterate over each glyph, grab the value of an attribute and save a temp svg (XML) parameterised with this value
- Process this file with Inkscape
- Read each of this files
- Built a new font-file with the new data
- Save the font, delete the glyph
I have read a lot of Powershell XML tutorials and tried a few times, and there is one thing I do not know what is wrong, but I'm getting each glyph from the font with this line:
$nodes = Select-Xml -Content $( Get-Content -Path $_.FullName ) -XPath "//glyph" -Namespace $namespaces
needs a lot of time and delivers 60 glyphs, even if their are more in the font. All the rest of the script is working properly, but if I image to process all 20 fonts (will be more in the future) it will take a whole day and not all glyphs are processed.
So, is there a failure in reading the file and parsing the XML? Why is this so incredibly slow and why are not all glyphs processed?