Compare commits

...
9 Commits
Author SHA1 Message Date
Maxim CoppietersandDaniel Bayley 2bd7748562 Add theater/drama icons (#1474)
* Add theater/drama icons

Related to #1399

Co-Authored-By: Daniel Bayley <daniel.bayley@me.com>

* Remove alternate drama icon

* Improve tags

---------

Co-authored-by: Daniel Bayley <daniel.bayley@me.com>
2023-09-16 13:04:13 +02:00
Daniel Bayley da8a6c5a1b Add missing bookmark-* icons (#1259)
* Add `bookmark-x` icon

* Add `bookmark-off` icon

* Remove `bookmark-off` icon

* Add `bookmark-slash` icon

* Swap `bookmark-slash` with `bookmark-check`
2023-09-16 12:57:53 +02:00
Eric Fennis 5736028dfa Update sponsor logos 2023-09-14 11:11:18 +02:00
Eric Fennis 45d2063340 Add digital ocean logo in readme 2023-09-14 10:42:02 +02:00
Erwann LagoucheandEric Fennis f71d3ffd1d Add speech icon (#1337)
* add speech icon

* center icon and apply global attributes

* fix: make paddings wider

* fix: smoothe angle on base of neck

* fix: add jguddas to contributors

* Update speech.svg

* Update speech.json

---------

Co-authored-by: Eric Fennis <eric.fennis@gmail.com>
2023-09-13 21:05:54 +02:00
Oliver SchmidtandEric Fennis b8c3a5fa0b Changed font creation process (#1413)
* Changed font creation process

* Class name prefix

Class name prefix added for backward compatibility.

* Container option in workflow removed

Removed the container option in github workflow lucide-font because it is not needed anymore, workflow was changed to nodejs only

* Fixed whitespaces in package.json

* Use releaseInformation instead of info.json

* Added workflow step

* Moved unicode numbers to convert function

* Added locale argument to sort function

* Delete pnpm-lock

* Updated versions, recreated pnpm-lock

* Updated dependencies

---------

Co-authored-by: Eric Fennis <eric.fennis@gmail.com>
2023-09-13 21:05:22 +02:00
Eric Fennis a4076db69b fix: Allow slash icon with double release 2023-09-11 09:07:14 +02:00
Eric Fennis 55cb681461 Remove conflicting alias (#1555) 2023-09-09 08:29:41 +02:00
Eric Fennis 09d9bb747d Add bot-2 icon (#1544)
* Add bot-2 icon

* replace existing bot icon
2023-09-08 09:46:47 +02:00
25 changed files with 2108 additions and 1013 deletions
+4 -5
View File
@@ -10,7 +10,6 @@ on:
jobs:
lucide-font:
runs-on: ubuntu-latest
container: ericfennis/lucide-font:latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3.4.1
@@ -43,11 +42,11 @@ jobs:
- name: Outline svg Icons
run: pnpm build:outline-icons
- name: Create directory
run: mkdir lucide-font
- name: Install dependencies
run: pnpm install --filter build-font
- name: Build font
run: fontcustom compile "./outlined" -h -n "lucide" -o ./lucide-font -F
- name: Create font in ./lucide-font
run: pnpm build:font
- name: "Upload to Artifacts"
uses: actions/upload-artifact@v1
+4 -1
View File
@@ -285,6 +285,9 @@ Thank you to all the people who contributed to Lucide!
## Sponsors
<a href="https://vercel.com?utm_source=lucide&utm_campaign=oss">
<img src="/docs/public/vercel.svg" alt="Powered by Vercel" width="200" />
<img src="docs/public/vercel.svg" alt="Powered by Vercel" width="200" />
</a>
<a href="https://www.digitalocean.com/?refcode=b0877a2caebd&utm_campaign=Referral_Invite&utm_medium=Referral_Program&utm_source=badge"><img src="docs/public/digitalocean.svg" width="200" alt="DigitalOcean Referral Badge" /></a>
@@ -36,15 +36,22 @@ const links = computed(() => [
<template>
<footer v-if="theme.footer" class="VPFooter" :class="{ 'has-sidebar': hasSidebar }">
<div class="container">
<p v-if="theme.footer.message" class="message" v-html="theme.footer.message"></p>
<p v-if="theme.footer.copyright" class="copyright" v-html="theme.footer.copyright"></p>
<div class="sponsors">
<a href="https://vercel.com?utm_source=lucide&utm_campaign=oss" rel="noreferrer noopener">
<img src="/vercel.svg" alt="Powered by Vercel" width="200" />
</a>
<a href="https://vercel.com?utm_source=lucide&utm_medium=referral&utm_campaign=oss">
<img src="/digitalocean.svg" alt="Digital Ocean" width="200" />
</a>
</div>
<div class="links">
<VPLink v-for="link in links" :href="link.href" :key="link.text" :rel="link.href.startsWith('http') ? 'noreferrer noopener': undefined">
{{ link.text }}
</VPLink>
<a href="https://vercel.com?utm_source=lucide&utm_campaign=oss" rel="noreferrer noopener">
<img src="/vercel.svg" alt="Powered by Vercel" width="200" />
</a>
</div>
<div>
<p v-if="theme.footer.message" class="message" v-html="theme.footer.message"></p>
<p v-if="theme.footer.copyright" class="copyright" v-html="theme.footer.copyright"></p>
</div>
</div>
</footer>
@@ -67,7 +74,7 @@ const links = computed(() => [
.container {
margin: 0 auto;
max-width: var(--vp-layout-max-width);
max-width: calc(var(--vp-layout-max-width) - 64px);
display: flex;
flex-direction: column;
align-items: center;
@@ -85,7 +92,7 @@ const links = computed(() => [
.message { order: 2; }
.copyright { order: 1; }
.links {
.links, .sponsors {
display: flex;
gap: 32px;
align-items: center;
@@ -102,7 +109,7 @@ const links = computed(() => [
flex-direction: row-reverse;
}
.links {
margin-left: auto;
margin-right: auto;
}
}
</style>
File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 7.3 KiB

-1
View File
@@ -3,7 +3,6 @@
"contributors": [
"danielbayley"
],
"aliases": ["slash"],
"tags": [
"cancel",
"no",
+16
View File
@@ -0,0 +1,16 @@
{
"$schema": "../icon.schema.json",
"tags": [
"read",
"finished",
"complete",
"clip",
"marker",
"tag",
"task",
"todo"
],
"categories": [
"account"
]
}
+14
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 2Z" />
<path d="m9 10 2 2 4-4" />
</svg>

After

Width:  |  Height:  |  Size: 301 B

+17
View File
@@ -0,0 +1,17 @@
{
"$schema": "../icon.schema.json",
"tags": [
"read",
"clip",
"marker",
"tag",
"cancel",
"close",
"delete",
"remove",
"clear"
],
"categories": [
"account"
]
}
+15
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 2Z" />
<path d="m14.5 7.5-5 5" />
<path d="m9.5 7.5 5 5" />
</svg>

After

Width:  |  Height:  |  Size: 329 B

+1 -2
View File
@@ -1,7 +1,6 @@
{
"$schema": "../icon.schema.json",
"contributors": [
"mittalyashu",
"ericfennis"
],
"tags": [
@@ -14,4 +13,4 @@
"development",
"social"
]
}
}
+6 -5
View File
@@ -9,9 +9,10 @@
stroke-linecap="round"
stroke-linejoin="round"
>
<rect width="18" height="10" x="3" y="11" rx="2" />
<circle cx="12" cy="5" r="2" />
<path d="M12 7v4" />
<line x1="8" x2="8" y1="16" y2="16" />
<line x1="16" x2="16" y1="16" y2="16" />
<path d="M12 8V4H8" />
<rect width="16" height="12" x="4" y="8" rx="2" />
<path d="M2 14h2" />
<path d="M20 14h2" />
<path d="M15 13v2" />
<path d="M9 13v2" />
</svg>

Before

Width:  |  Height:  |  Size: 403 B

After

Width:  |  Height:  |  Size: 380 B

+17
View File
@@ -0,0 +1,17 @@
{
"$schema": "../icon.schema.json",
"contributors": [
"danielbayley"
],
"tags": [
"drama",
"masks",
"theater",
"theatre",
"entertainment",
"show"
],
"categories": [
"multimedia"
]
}
+20
View File
@@ -0,0 +1,20 @@
<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="M 10 11h.01"/>
<path d="M 14 6h.01"/>
<path d="M 18 6h.01"/>
<path d="M 6.5 13.1h.01"/>
<path d="M22 5c0 9-4 12-6 12s-6-3-6-12c0-2 2-3 6-3s6 1 6 3"/>
<path d="M17.4 9.9c-.8.8-2 .8-2.8 0"/>
<path d="M10.1 7.1C9 7.2 7.7 7.7 6 8.6c-3.5 2-4.7 3.9-3.7 5.6 4.5 7.8 9.5 8.4 11.2 7.4.9-.5 1.9-2.1 1.9-4.7"/>
<path d="M9.1 16.5c.3-1.1 1.4-1.7 2.4-1.4"/>
</svg>

After

Width:  |  Height:  |  Size: 578 B

+22
View File
@@ -0,0 +1,22 @@
{
"$schema": "../icon.schema.json",
"contributors": [
"doerge",
"airone01",
"jguddas",
"karsa-mistmere"
],
"tags": [
"disability",
"disabled",
"dda",
"human",
"accessibility",
"people",
"sound"
],
"categories": [
"accessibility",
"communication"
]
}
+15
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="M8.8 20v-4.1l1.9.2a2.3 2.3 0 0 0 2.164-2.1V8.3A5.37 5.37 0 0 0 2 8.25c0 2.8.656 3.054 1 4.55a5.77 5.77 0 0 1 .029 2.758L2 20" />
<path d="M19.8 17.8a7.5 7.5 0 0 0 .003-10.603" />
<path d="M17 15a3.5 3.5 0 0 0-.025-4.975" />
</svg>

After

Width:  |  Height:  |  Size: 447 B

+18
View File
@@ -0,0 +1,18 @@
{
"$schema": "../icon.schema.json",
"contributors": [
"danielbayley"
],
"tags": [
"theater",
"theatre",
"entertainment",
"podium",
"stage",
"musical"
],
"categories": [
"buildings",
"social"
]
}
+21
View File
@@ -0,0 +1,21 @@
<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="M2 10s3-3 3-8"/>
<path d="M22 10s-3-3-3-8"/>
<path d="M10 2c0 4.4-3.6 8-8 8"/>
<path d="M14 2c0 4.4 3.6 8 8 8"/>
<path d="M2 10s2 2 2 5"/>
<path d="M22 10s-2 2-2 5"/>
<path d="M8 15h8"/>
<path d="M2 22v-1a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v1"/>
<path d="M14 22v-1a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v1"/>
</svg>

After

Width:  |  Height:  |  Size: 529 B

+1
View File
@@ -16,6 +16,7 @@
"lucide-static": "pnpm --filter lucide-static",
"build:icons": "node ./scripts/buildIcons.mjs --templateSrc ./packages/lucide/scripts/exportTemplate.mjs",
"build:outline-icons": "pnpm --filter outline-svg start",
"build:font": "pnpm --filter docs prebuild:releaseJson && pnpm --filter build-font start",
"generate:supersprite": "node ./scripts/generateSuperSVG.mjs",
"optimize": "node ./scripts/optimizeSvgs.mjs",
"addjsons": "node scripts/addMissingIconJsonFiles.mjs",
+1737 -934
View File
File diff suppressed because it is too large Load Diff
+8 -3
View File
@@ -1,8 +1,8 @@
/* eslint-disable no-restricted-syntax, no-await-in-loop */
import { simpleGit } from 'simple-git';
import semver from 'semver';
import fs from 'fs';
import path from 'path';
import { simpleGit } from 'simple-git';
import semver from 'semver';
import { readSvgDirectory } from './helpers.mjs';
const DATE_OF_FORK = '2020-06-08T16:39:52+0100';
@@ -15,6 +15,8 @@ const iconJsonFiles = readSvgDirectory(ICONS_DIR, '.json');
const location = path.resolve(currentDir, '.vitepress/data', 'releaseMetaData.json');
const releaseMetaDataDirectory = path.resolve(currentDir, '.vitepress/data', 'releaseMetadata');
const allowedIconNameWithDoubleRelease = ['slash'];
if (fs.existsSync(location)) {
fs.unlinkSync(location);
}
@@ -107,7 +109,10 @@ comparisons.forEach(({ tag, iconFiles, date } = {}) => {
}
if (status === 'A') {
if ('changedRelease' in newReleaseMetaData[iconName]) {
if (
'changedRelease' in newReleaseMetaData[iconName] &&
!allowedIconNameWithDoubleRelease.includes(iconName)
) {
throw new Error(`Icon '${iconName}' has already changedRelease set.`);
}
+124
View File
@@ -0,0 +1,124 @@
import { readJson } from 'fs-extra/esm';
import svgtofont from 'svgtofont';
import getArgumentOptions from 'minimist';
import path from 'path';
const fontName = 'lucide';
const classNamePrefix = 'icon';
const startUnicode = 57400;
const inputDir = path.join(process.cwd(), '../../', 'outlined');
const cliArguments = getArgumentOptions(process.argv.slice(2));
const { outputDir = 'lucide-font' } = cliArguments;
const targetDir = path.join(process.cwd(), '../../', outputDir);
const releaseMetaDataDir = path.join(process.cwd(), '../../', 'docs/.vitepress/data');
const releaseMetaDataPath = path.resolve(releaseMetaDataDir, 'releaseMetaData.json');
const releaseMetaData = convertReleaseMetaData(await getReleaseMetaData());
async function getReleaseMetaData() {
let releaseMetaData = {};
try {
releaseMetaData = await readJson(releaseMetaDataPath);
} catch (err) {
throw new Error('Execution stopped because no release information was found.');
}
return releaseMetaData;
}
function convertReleaseMetaData(releaseMetaData) {
return Object.entries(releaseMetaData)
.map(([key, value]) => [key, addAttribute(value, 'name', key)])
.map(([, value]) => value)
.sort((a, b) => sortMultiple(a, b, [sortByCreatedReleaseDate, sortByName]))
.map((value, index) => addAttribute(value, 'index', index))
.map((value, index) => addAttribute(value, 'unicode', index + startUnicode));
}
function addAttribute(obj, attribute, value) {
obj[attribute] = value;
return obj;
}
function sortMultiple(a, b, collators = []) {
const comparison = collators.shift()(a, b);
if (comparison === 0 && collators.length > 0) return sortMultiple(a, b, collators);
return comparison;
}
function sortByCreatedReleaseDate(a, b) {
const dates = [a, b].map((value) => new Date(value.createdRelease.date).valueOf());
return (dates[0] > dates[1]) - (dates[0] < dates[1]);
}
function sortByName(a, b) {
return new Intl.Collator('en-US').compare(a.name, b.name);
}
function getIconUnicode(name) {
const { unicode } = releaseMetaData.find(({ name: iconname }) => iconname === name);
return String.fromCharCode(unicode);
}
async function init() {
console.time('Font generation');
try {
await svgtofont({
src: path.resolve(process.cwd(), inputDir),
dist: path.resolve(process.cwd(), targetDir),
// styleTemplates: path.resolve(process.cwd(), 'styles'), // Add different templates if needed
fontName,
classNamePrefix,
css: {
fontSize: 'inherit',
},
emptyDist: true,
useCSSVars: false,
outSVGReact: false,
outSVGPath: false,
svgicons2svgfont: {
fontHeight: 1000, // At least 1000 is recommended
normalize: false,
},
generateInfoData: true,
website: {
title: 'Lucide',
logo: null,
meta: {
description: 'Lucide icons as TTF/EOT/WOFF/WOFF2/SVG.',
keywords: 'Lucide,TTF,EOT,WOFF,WOFF2,SVG',
},
corners: {
url: 'https://github.com/lucide-icons/lucide',
width: 62, // default: 60
height: 62, // default: 60
bgColor: '#dc3545', // default: '#151513'
},
links: [
{
title: 'GitHub',
url: 'https://github.com/lucide-icons/lucide',
},
{
title: 'Feedback',
url: 'https://github.com/lucide-icons/lucide/issues',
},
{
title: 'Font Class',
url: 'index.html',
},
{
title: 'Unicode',
url: 'unicode.html',
},
],
},
getIconUnicode,
});
} catch (err) {
console.log(err);
}
console.timeEnd('Font generation');
}
init();
+18
View File
@@ -0,0 +1,18 @@
{
"name": "build-font",
"private": true,
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "node ./main.mjs"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"fs-extra": "^11.1.1",
"minimist": "^1.2.8",
"svgtofont": "^3.25.4"
}
}
View File
+5 -50
View File
@@ -1,6 +1,5 @@
import { promises as fs } from 'fs';
import outlineStroke from 'svg-outline-stroke';
import { parse, stringify } from 'svgson';
import SVGFixer from 'oslllo-svg-fixer';
import getArgumentOptions from 'minimist';
import path from 'path';
@@ -9,31 +8,6 @@ const cliArguments = getArgumentOptions(process.argv.slice(2));
const { outputDir = 'outlined' } = cliArguments;
const targetDir = path.join(process.cwd(), '../../', outputDir);
function transformForward(node) {
if (node.name === 'svg') {
return {
...node,
attributes: {
...node.attributes,
width: 960,
height: 960,
},
};
}
return node;
}
function transformBackwards(node) {
if (node.name === 'svg') {
const { width, height, ...attributes } = node.attributes;
return {
...node,
attributes,
};
}
return node;
}
async function init() {
console.time('icon outliner');
try {
@@ -41,29 +15,10 @@ async function init() {
await fs.mkdir(targetDir);
} catch (error) {} // eslint-disable-line no-empty
const icons = (await fs.readdir(inputDir)).filter((file) => path.extname(file) === '.svg');
const parsedIconNodes = await Promise.all(
icons.map(async (file) => {
const inputFilePath = path.resolve(process.cwd(), inputDir, file);
const iconContent = await fs.readFile(inputFilePath);
const iconNode = await parse(iconContent.toString(), {
transformNode: transformForward,
});
return [file, iconNode];
}),
);
await Promise.all(
parsedIconNodes.map(async ([file, iconNode]) => {
const outlined = await outlineStroke(stringify(iconNode));
const outlinedWithoutAttrs = await parse(outlined, {
transformNode: transformBackwards,
});
const filePath = path.join(targetDir, file);
await fs.writeFile(filePath, stringify(outlinedWithoutAttrs));
}),
);
await SVGFixer(inputDir, targetDir, {
showProgressBar: true,
traceResolution: 800,
}).fix();
console.timeEnd('icon outliner');
} catch (err) {
+3 -4
View File
@@ -1,7 +1,7 @@
{
"name": "outline-svg",
"private": true,
"version": "1.0.0",
"version": "2.0.0",
"description": "",
"main": "index.js",
"scripts": {
@@ -11,8 +11,7 @@
"author": "",
"license": "ISC",
"dependencies": {
"minimist": "^1.2.6",
"svg-outline-stroke": "^1.3.1",
"svgson": "^5.2.1"
"minimist": "^1.2.8",
"oslllo-svg-fixer": "^2.2.0"
}
}