iconicFonts / iconic-fonts

Over 50 patched fonts with 60,000+ icons. ⭐️ to support us!
39 stars 2 forks source link

Brands/Logos #86

Open mdSlash opened 3 months ago

mdSlash commented 3 months ago

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...

shadowgaming-backup commented 2 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

mdSlash commented 2 months ago

@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:

  1. 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.

  2. 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>
  3. 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.

  4. 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.

Stroke to fill

./<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

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",
  ],
};
shadowgaming-backup commented 2 months ago

Thanks, I will get started, I will create a pr

mdSlash commented 2 months ago

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.