Skip to content

Commit 169b560

Browse files
author
Cynthia Sanchez
authored
Merge pull request #1 from D4N/main
Initial prototype of the eos icons extension for VSCode
2 parents 710313f + d92842b commit 169b560

File tree

8 files changed

+610
-1
lines changed

8 files changed

+610
-1
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules
2+
vscode-eos-icons-*.vsix
3+
.log
4+
theme
5+
.env3

.vscode/launch.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Launch Extension",
6+
"type": "extensionHost",
7+
"request": "launch",
8+
"runtimeExecutable": "${execPath}",
9+
"args": ["--extensionDevelopmentPath=${workspaceRoot}"],
10+
"stopOnEntry": false
11+
}
12+
]
13+
}

.vscodeignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
**/*
2+
!theme/eos-icons.woff
3+
!theme/eos-icons-product-icon-theme.json

README.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,35 @@
1-
# eos-icons-vsc
1+
# EOS Icons for VSCode
2+
3+
This extension allows you to replace VSCode's default icons with those from the
4+
[EOS icon set](https://eos-icons.com/).
5+
6+
7+
## Usage
8+
9+
Install the extension from the Marketplace, execute the command `Preferences:
10+
Product Icon Theme` and select the entry `EOS Icons` in the presented drop down:
11+
12+
![select_product_theme.png](select_product_theme.png)
13+
14+
15+
## Development
16+
17+
To build the extension yourself, you will need the following packages installed:
18+
19+
- nodejs
20+
- yarn
21+
- python
22+
23+
and execute the following commands to setup your development environment:
24+
```ShellSession
25+
$ yarn install
26+
$ yarn run prepare
27+
```
28+
29+
To build the extension itself, execute `yarn run package`.
30+
31+
To try the extension out in VSCode, open this folder in VSCode and press `<f5>`
32+
to launch a debugging session. This will create a fresh VSCode instance with the
33+
extension pre-installed and loaded. Note that sometimes the icon theme is not
34+
properly loaded on launch, in that case switch the Product Icon Theme to the
35+
default and back to EOS Icons.

create_icon_theme.py

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
#!/usr/bin/python3
2+
3+
import shutil
4+
import json
5+
from os.path import dirname, join
6+
7+
from fontTools.ttLib import TTFont
8+
9+
dest = join(dirname(__file__), "./theme/eos-icons.woff")
10+
shutil.copyfile(
11+
join(
12+
dirname(__file__), "./node_modules/eos-icons/dist/fonts/eos-icons.woff"
13+
),
14+
dest,
15+
)
16+
17+
code_points = {}
18+
19+
with TTFont(dest, 0, ignoreDecompileErrors=True) as ttf:
20+
for x in ttf["cmap"].tables:
21+
for (code, name) in x.cmap.items():
22+
code_points[name] = code
23+
24+
25+
icon_to_glyph_mapping = [
26+
["accounts-view-bar-icon", "account_circle"],
27+
["callhierarchy-incoming", "call_received"],
28+
["callhierarchy-outgoing", "call_made"],
29+
["callstack-view-session", "bug_report"],
30+
["comments-view-icon", "comment"],
31+
["debug-configure", "settings_applications"],
32+
["extensions-manage", "settings_applications"],
33+
["settings-view-bar-icon", "settings_applications"],
34+
]
35+
36+
eos_icons_theme = {
37+
"fonts": [
38+
{
39+
"id": "eos-icons",
40+
"src": [
41+
{
42+
"path": "./eos-icons.woff",
43+
"format": "woff",
44+
},
45+
],
46+
"weight": "normal",
47+
"style": "normal",
48+
},
49+
],
50+
"iconDefinitions": {},
51+
}
52+
53+
for (icon_name, glyph_name) in icon_to_glyph_mapping:
54+
eos_icons_theme["iconDefinitions"][icon_name] = {
55+
"fontCharacter": chr(code_points[glyph_name]),
56+
}
57+
58+
with open(
59+
join(dirname(__file__), "theme/eos-icons-product-icon-theme.json"), "w"
60+
) as product_icon_file:
61+
product_icon_file.write(json.dumps(eos_icons_theme, indent=2))

package.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"name": "eos-icons-vscode",
3+
"version": "0.0.1",
4+
"publisher": "EOS-uiux-Solutions",
5+
"license": "MIT",
6+
"description": "The iconic and open source font made for EOS Design System for VSCode.",
7+
"keywords": ["iconic", "font", "eos", "icons", "product-icon"],
8+
"author": "SUSE UX/UI team",
9+
"engines": {
10+
"vscode": ">=1.53.0"
11+
},
12+
"scripts": {
13+
"cleandeps": "rm -rf node_modules .env3",
14+
"package": "vsce package --yarn",
15+
"prepare": "python3 -m venv .env3 && . .env3/bin/activate && pip install fonttools",
16+
"vscode:prepublish": ". .env3/bin/activate && ./create_icon_theme.py"
17+
},
18+
"contributes": {
19+
"productIconThemes": [
20+
{
21+
"id": "eos-icons",
22+
"label": "EOS Icons",
23+
"path": "./theme/eos-icons-product-icon-theme.json"
24+
}
25+
]
26+
},
27+
"devDependencies": {
28+
"eos-icons": "^4.12.0",
29+
"vsce": ">=1.85"
30+
},
31+
"homepage": "https://eos-icons.com/",
32+
"bugs": {
33+
"url": "https://github.com/EOS-uiux-Solutions/eos-icons-vscode/issues"
34+
},
35+
"repository": {
36+
"type": "git",
37+
"url": "https://github.com/EOS-uiux-Solutions/eos-icons-vscode.git"
38+
}
39+
}

select_product_theme.png

14 KB
Loading

0 commit comments

Comments
 (0)