Open mdSlash opened 3 months ago
Hi, can I help. I can create a pull request for this. I will be using svg files from another repository and joining into one folder
@shadowgaming-backup Thanks for offering to help! I haven't created a CONTRIBUTING.md
file yet, but you're welcome to submit a PR for new icons. Here are some guidelines to follow:
No Strokes, Solid Icons: Make sure the SVGs don't have any strokes and are solid shapes. You can use Inkscape to achieve this. The provided script should work as expected as long as the SVG files don’t contain hidden elements.
ViewBox Attribute: Each SVG should have a viewBox
attribute that matches the width
and height
attributes. For example:
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">...</svg>
SVG Optimization: After completing the steps above, you can use SVGO to optimize the SVG files in the directory. You can use the provided SVGO configuration.
Consistent Directory Structure: The icon pack should include a LICENSE
file and a svgs
directory containing all icons. Ensure icon filenames do not have spaces.
./<path-to-script.sh> <path-to-icons-directory>
#!/bin/bash
stroke_to_fill() {
local icon_file="$1"
if grep -q 'stroke-width' "$icon_file"; then
inkscape "$icon_file" \
--actions="select-all; object-stroke-to-path; path-union;" \
--export-filename="$icon_file"
echo "$icon_file converted to fill."
fi
}
ICONS_DIR="$1"
ICONS="${ICONS_DIR}/*.svg"
if [[ -d $ICONS_DIR ]]; then
for icon in $ICONS; do stroke_to_fill "$icon"; done
else
echo "Directory $ICONS_DIR does not exist." >&2
exit 1
fi
svgo --config <path-to-config.js> <path-to-icons-directory>
module.exports = {
plugins: [
"cleanupEnableBackground",
"cleanupIds",
"cleanupNumericValues",
"collapseGroups",
"convertColors",
"convertEllipseToCircle",
{
name: "convertPathData",
params: {
removeUseless: false,
},
},
"convertShapeToPath",
"convertTransform",
"inlineStyles",
"mergePaths",
"mergeStyles",
"minifyStyles",
"moveElemsAttrsToGroup",
"moveGroupAttrsToElems",
"removeComments",
{
name: "removeAttrs",
params: {
attrs: [
"class",
"fill-rule",
"fill",
"stroke-linecap",
"stroke-linejoin",
"stroke-width",
"stroke",
"style",
"version",
],
},
},
"removeDesc",
"removeDoctype",
"removeEditorsNSData",
"removeEmptyAttrs",
"removeEmptyContainers",
"removeEmptyText",
"removeHiddenElems",
"removeMetadata",
"removeNonInheritableGroupAttrs",
"removeOffCanvasPaths",
"removeTitle",
"removeUnknownsAndDefaults",
"removeUnusedNS",
"removeUselessDefs",
"removeUselessStrokeAndFill",
"removeXMLProcInst",
{
name: "sortAttrs",
params: {
order: ["xmlns", "width", "height", "viewBox"],
},
},
"sortDefsChildren",
],
};
Thanks, I will get started, I will create a pr
Hi @shadowgaming-backup, I'm gonna start collecting the brand icons now. If you've already begun working on this, feel free to push your changes to continue in your PR. I don't want to duplicate efforts or waste any work you've done so far.
New Icon Pack Request
Link to Icon Pack
Reason for Addition
I noticed that many of the icon packs have the same brand icons. To avoid redundancy and make better use of the available Unicode space, IconicFonts should consider consolidating these icons into a single, unified pack. This approach would help prevent duplicate icons in the patched fonts and also conserve Unicode slots, given the 65,535 glyph limit per font.
Additional Information
Some of the packs might be removed from the patched fonts entirely, like...