Skip to content

Commit 2f838db

Browse files
update: CONTRIBUTING guide to document process for adding new icons
Added instructions for adding new icons to the existing font family, including steps for using Icomoon and updating the style.css file.
1 parent acc3bcc commit 2f838db

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

CONTRIBUTING.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,41 @@ refactor: simplify file loading logic
166166
pnpm run lang update # Update translations
167167
```
168168

169+
## ℹ️ Adding New Icons (to the existing font family)
170+
> [!NOTE]
171+
> Acode uses SVG and converts them into a font family, to be used inside the editor and generally for plugin devs.
172+
>
173+
> **Plugin-specific icons SHOULD NOT be added into the editor. Only generally helpful icons SHOULD BE added**
174+
175+
Many font editing software and web-based tools exist for this purpose. Some of them are listed below.
176+
177+
| Name | Platform |
178+
|------|----------|
179+
| https://icomoon.io/ | Free (Web-Based, PWA-supported, Offline-supported |
180+
| https://fontforge.org/ | Open-Source (Linux, Mac, Windows)
181+
182+
### Steps in Icomoon to add new Icons
183+
184+
1. Download the `icons.ttf` file from https://github.com/Acode-Foundation/Acode/tree/main/src/res/icons
185+
2. Go to https://icomoon.io/ > Start a new Project
186+
3. Import the `icons.ttf` downloaded (in step 1)
187+
3. All icons will be displayed after importing.
188+
4. Import the SVG icon created/downloaded to be added to the Font Family.
189+
5. On the right side, press **enable Show Characters** to view unicode character for that icon.
190+
6. Copy the newly added icon's Unicode character (required for later steps)
191+
7. Repeat Step 4 and Step 6 until all needed new icons are added.
192+
8. Press the export icon from the top left-hand side.
193+
9. Add **Font** in the formats section, expand the **Font**, enter **code-editor-icon** as the font-family for `icons.ttf` file.
194+
10. Press the download button, and a zip file will be downloaded.
195+
196+
### Adding the Unicode characters to style.css.
197+
198+
1. Open `style.css` file present at https://github.com/Acode-Foundation/Acode/tree/main/src/res/icons
199+
2. Add new class called `.icon.icon-name::before` i.e ```.icon.all_inclusive:before { content: "\ea18"; }```
200+
3. `content` (i.e `ea18` -> `\ea18`) property's value is the Unicode Character copied after importing the icon in the font family.
201+
4. Save the file, extract the zip file (downloaded), from the fonts folder, rename `code-editor-icon.ttf` to `icons.ttf`, copy & paste the `icons.ttf` onto https://github.com/Acode-Foundation/Acode/tree/main/src/res/icons
202+
5. commit the changes <ins><b>ON A NEW branch</b></ins> (by following: [Commit Messages guide](#commit-messages))
203+
169204
## 🔌 Plugin Development
170205

171206
To create plugins for Acode:

0 commit comments

Comments
 (0)