Compare commits

...

3 Commits

Author SHA1 Message Date
Sri Aspari
3e61ee5832 Add more bookmark icon variant (#413)
* Add bookmark-add icon

Signed-off-by: Sri Aspari <mail@siarie.me>

* Rename icon to bookmark-plus and add tags

Signed-off-by: Sri Aspari <mail@siarie.me>

* Fix icon size

Signed-off-by: Sri Aspari <mail@siarie.me>

* Fix bookmark icon

* Add bookmark-minus icon

Signed-off-by: Sri Aspari <mail@siarie.me>

* Fix coding style
2021-09-27 21:10:33 +02:00
Eric Fennis
38b14425a0 try to speed up the font build 2021-09-27 20:52:21 +02:00
Eric Fennis
87a18985f1 Add yarn --prefer-offline 2021-09-27 20:32:16 +02:00
6 changed files with 63 additions and 30 deletions

View File

@@ -39,7 +39,7 @@ jobs:
cache: 'yarn'
- name: Install dependencies
run: yarn
run: yarn --prefer-offline
- name: Set Auth Token
run: npm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }}
@@ -74,7 +74,7 @@ jobs:
cache: 'yarn'
- name: Install dependencies
run: yarn
run: yarn --prefer-offline
- name: Set Auth Token
run: npm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }}
@@ -109,7 +109,7 @@ jobs:
cache: 'yarn'
- name: Install dependencies
run: yarn
run: yarn --prefer-offline
- name: Set Auth Token
run: npm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }}
@@ -144,7 +144,7 @@ jobs:
cache: 'yarn'
- name: Install dependencies
run: yarn
run: yarn --prefer-offline
- name: Set Auth Token
run: npm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }}
@@ -179,7 +179,7 @@ jobs:
cache: 'yarn'
- name: Install dependencies
run: yarn --pure-lockfile
run: yarn --prefer-offline
- name: Set Auth Token
run: npm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }}
@@ -214,7 +214,7 @@ jobs:
cache: 'yarn'
- name: Install dependencies
run: yarn
run: yarn --prefer-offline
- name: Set Auth Token
run: npm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }}
@@ -248,9 +248,6 @@ jobs:
node-version: '14'
cache: 'yarn'
- name: Update repos
run: sudo apt-get update
- name: Install FontForge
run: sudo apt-get install zlib1g-dev fontforge
@@ -276,10 +273,7 @@ jobs:
run: sudo gem install fontcustom
- name: Install
run: yarn
- name: "Outline SVG"
run: yarn build:outline-icons
run: yarn --prefer-offline
- name: Build Icon Font
run: |
@@ -288,7 +282,7 @@ jobs:
command=''
for name in "${list[@]}"
do
subcommand="(fontcustom compile "./converted_icons${name}" -h -n "lucide${name}" -o ./tmp -F && mv ./tmp/* build)"
subcommand="(yarn build:outline-icons --outputDir=converted_icons${name} && fontcustom compile "./converted_icons${name}" -h -n "lucide${name}" -o ./build -F)"
if [ -z "$command" ]
then
command="$subcommand";

14
icons/bookmark-minus.svg Normal file
View File

@@ -0,0 +1,14 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16Z" />
<line x1="15" x2="9" y1="10" y2="10" />
</svg>

After

Width:  |  Height:  |  Size: 317 B

15
icons/bookmark-plus.svg Normal file
View File

@@ -0,0 +1,15 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16Z" />
<line x1="12" x2="12" y1="7" y2="13" />
<line x1="15" x2="9" y1="10" y2="10" />
</svg>

After

Width:  |  Height:  |  Size: 359 B

View File

@@ -9,5 +9,5 @@
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M19 21l-7-5-7 5V5a2 2 0 012-2h10a2 2 0 012 2z" />
<path d="m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16Z" />
</svg>

Before

Width:  |  Height:  |  Size: 269 B

After

Width:  |  Height:  |  Size: 275 B

View File

@@ -1,9 +1,13 @@
import { promises as fs } from 'fs';
import outlineStroke from 'svg-outline-stroke';
import { parse, stringify } from 'svgson'; // eslint-disable-line import/no-extraneous-dependencies
import getArgumentOptions from 'minimist';
const inputDir = `./icons/`;
const outputDirs = {
const cliArguments = getArgumentOptions(process.argv.slice(2));
const { outputDir } = cliArguments;
const widthMap = {
'converted_icons-200': '1',
'converted_icons-300': '1.5',
converted_icons: '2',
@@ -39,8 +43,7 @@ function transformBackwards(node) {
async function init() {
console.time('icon outliner');
try {
const createDirectories = Object.keys(outputDirs).map(directory => fs.mkdir(`./${directory}`));
await Promise.all(createDirectories);
await fs.mkdir(`./${outputDir}`);
const icons = await fs.readdir(inputDir);
const parsedIconNodes = await Promise.all(
@@ -53,19 +56,19 @@ async function init() {
}),
);
await Promise.all(
Object.entries(outputDirs).map(async ([directory, width]) => {
await Promise.all(
parsedIconNodes.map(async ([file, iconNode]) => {
iconNode.attributes['stroke-width'] = width;
const outlined = await outlineStroke(stringify(iconNode));
const outlinedWithoutAttrs = await parse(outlined, {
transformNode: transformBackwards,
});
if (widthMap?.[outputDir] === undefined) {
throw new Error(`Could not find the directory: ${outputDir}.`)
}
await fs.writeFile(`./${directory}/${file}`, stringify(outlinedWithoutAttrs));
}),
);
await Promise.all(
parsedIconNodes.map(async ([file, iconNode]) => {
iconNode.attributes['stroke-width'] = widthMap[outputDir];
const outlined = await outlineStroke(stringify(iconNode));
const outlinedWithoutAttrs = await parse(outlined, {
transformNode: transformBackwards,
});
await fs.writeFile(`./${outputDir}/${file}`, stringify(outlinedWithoutAttrs));
}),
);

View File

@@ -251,6 +251,13 @@
"marker",
"tag"
],
"bookmark-minus": [
"delete",
"remove"
],
"bookmark-plus": [
"add"
],
"bot": [
"robot"
],