mirror of
https://github.com/FortAwesome/Font-Awesome.git
synced 2025-01-13 00:30:29 +08:00
Export works
This commit is contained in:
parent
c46c7f0e1c
commit
5f44b9dce9
@ -9,8 +9,8 @@
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="32"
|
||||
height="32"
|
||||
width="900"
|
||||
height="900"
|
||||
id="svg6044"
|
||||
version="1.1"
|
||||
inkscape:version="0.48.2 r9819"
|
||||
@ -24,9 +24,9 @@
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="11"
|
||||
inkscape:cx="14.519665"
|
||||
inkscape:cy="17.277308"
|
||||
inkscape:zoom="0.12153398"
|
||||
inkscape:cx="-785.06398"
|
||||
inkscape:cy="-68.264027"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="true"
|
||||
inkscape:document-units="px"
|
||||
@ -35,7 +35,11 @@
|
||||
inkscape:window-height="627"
|
||||
inkscape:window-x="1616"
|
||||
inkscape:window-y="258"
|
||||
inkscape:window-maximized="0" />
|
||||
inkscape:window-maximized="0"
|
||||
fit-margin-top="0"
|
||||
fit-margin-left="0"
|
||||
fit-margin-right="0"
|
||||
fit-margin-bottom="0" />
|
||||
<metadata
|
||||
id="metadata6049">
|
||||
<rdf:RDF>
|
||||
@ -52,9 +56,9 @@
|
||||
id="layer1"
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
transform="translate(0,-31.999983)">
|
||||
transform="translate(0.0625,0.0625)">
|
||||
<path
|
||||
style="fill:#000000;stroke:#000000;stroke-width:0.03897692000000000px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;fill-opacity:1"
|
||||
style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:0.03897692px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="###INSERTGLYPH###"
|
||||
id="path6054"
|
||||
inkscape:connector-curvature="0" />
|
||||
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.9 KiB |
@ -1,13 +1,8 @@
|
||||
icons = {}
|
||||
glyphs = {}
|
||||
|
||||
sass_file = File.open('../sass/font-awesome.sass')
|
||||
sass_lines = sass_file.readlines
|
||||
sass_file.close
|
||||
|
||||
svg_file = File.open('../font/fontawesome-webfont.svg')
|
||||
svg_lines = svg_file.readlines
|
||||
svg_file.close
|
||||
sass_lines = File.open('../sass/font-awesome.sass').readlines
|
||||
svg_lines = File.open('../font/fontawesome-webfont.svg').readlines
|
||||
|
||||
index = 0
|
||||
while index < sass_lines.length
|
||||
@ -23,7 +18,6 @@ while index < sass_lines.length
|
||||
end
|
||||
index += 1
|
||||
end
|
||||
puts icons.length
|
||||
|
||||
index = 0
|
||||
while index < svg_lines.length
|
||||
@ -32,13 +26,19 @@ while index < svg_lines.length
|
||||
if line.start_with? '<glyph unicode="&#x' and d_index != nil
|
||||
icon_code = line[19.. 22]
|
||||
start_index = d_index + 3
|
||||
icon_glyph = line[start_index .. line.length - 4]
|
||||
icon_glyph = line[start_index .. line.length - 6]
|
||||
glyphs[icon_code] = icon_glyph
|
||||
puts "#{icon_code}: "
|
||||
#puts "#{icon_code}: '#{icon_glyph}'"
|
||||
end
|
||||
index += 1
|
||||
end
|
||||
|
||||
icons.each_pair do |icon_name, icon_code|
|
||||
puts "#{icon_name}: #{glyphs[icon_code]}"
|
||||
end
|
||||
# icons.each_pair do |icon_name, icon_code|
|
||||
# puts "#{icon_name}: #{glyphs[icon_code]}"
|
||||
# end
|
||||
|
||||
requested_icon = ARGV[0]
|
||||
requested_glyph = glyphs[icons[requested_icon]]
|
||||
blank_svg_content = File.open('empty.svg').read
|
||||
output_svg = blank_svg_content.sub '###INSERTGLYPH###', requested_glyph
|
||||
File.open("#{requested_icon}.svg", 'w') {|out_svg| out_svg.write(output_svg) }
|
Loading…
Reference in New Issue
Block a user