Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Brands/Logos #86

Open
mdSlash opened this issue Jul 2, 2024 · 4 comments · Fixed by #90
Open

Brands/Logos #86

mdSlash opened this issue Jul 2, 2024 · 4 comments · Fixed by #90
Labels
new pack Add/Create a new icon pack
Milestone

Comments

@mdSlash
Copy link
Member

mdSlash commented Jul 2, 2024

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

@mdSlash mdSlash added the new pack Add/Create a new icon pack label Jul 2, 2024
@mdSlash mdSlash added this to the Someday/Maybe milestone Jul 2, 2024
@mdSlash mdSlash changed the title Brands Brands/Logos Jul 2, 2024
@shadowgaming-backup
Copy link
Contributor

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
Copy link
Member Author

mdSlash commented Aug 10, 2024

@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
Copy link
Contributor

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

@mdSlash mdSlash modified the milestones: Someday/Maybe, v1.2.0 Aug 14, 2024
@mdSlash
Copy link
Member Author

mdSlash commented Aug 15, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new pack Add/Create a new icon pack
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants