Skip to content

Commit

Permalink
Add Material Design Icons 6.3.95
Browse files Browse the repository at this point in the history
  • Loading branch information
kumattau committed Oct 20, 2021
1 parent e7c4ef3 commit ed4a36e
Show file tree
Hide file tree
Showing 8 changed files with 6,425 additions and 15 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ The following prefixes are currently available to use:

- `ei` prefix holds [**Elusive Icons** 2.0 with its 304 icons](http://elusiveicons.com/icons/).

- `mdi` prefix holds [**Material Design Icons** 5.9.55 with its 5955 icons.](https://cdn.materialdesignicons.com/5.9.55/)
- [**Material Design Icons**](https://cdn.materialdesignicons.com)

- `mdi6` prefix holds [**Material Design Icons** 6.3.95 with its 6395 icons.](https://cdn.materialdesignicons.com/6.3.95/)

- `mdi` prefix holds [**Material Design Icons** 5.9.55 with its 5955 icons.](https://cdn.materialdesignicons.com/5.9.55/)

- `msc` prefix holds [**Codicon Icons** 0.0.25 with its 385 icons.](https://github.com/microsoft/vscode-codicons)

Expand All @@ -84,8 +88,8 @@ asl_icon = qta.icon('ei.asl')
elusive_button = QtWidgets.QPushButton(asl_icon, 'Elusive Icons!')

# or Material Design Icons:
apn_icon = qta.icon('mdi.access-point-network')
mdi_button = QtWidgets.QPushButton(apn_icon, 'Material Design Icons!')
apn_icon = qta.icon('mdi6.access-point-network')
mdi6_button = QtWidgets.QPushButton(apn_icon, 'Material Design Icons!')

# or Microsoft's Codicons:
squirrel_icon = qta.icon('msc.squirrel')
Expand Down
8 changes: 4 additions & 4 deletions UPDATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ with open('charmap.json', 'w') as file:

## Material Design Icons

To update _Material Design Icons_, you must:
To update _Material Design Icons 6.x_, you must:

- download ttf from <https://raw.githubusercontent.com/Templarian/MaterialDesign-Webfont/master/fonts/materialdesignicons-webfont.ttf>
- regenerate the json charmap with the `materialdesignicons.css` file from <https://raw.githubusercontent.com/Templarian/MaterialDesign-Webfont/master/css/materialdesignicons.css>
Expand All @@ -52,15 +52,15 @@ import hashlib
TTF_URL = 'https://raw.githubusercontent.com/Templarian/MaterialDesign-Webfont/master/fonts/materialdesignicons-webfont.ttf'
CSS_URL = 'https://raw.githubusercontent.com/Templarian/MaterialDesign-Webfont/master/css/materialdesignicons.css'

with open('materialdesignicons-webfont.ttf', 'wb') as fp:
with open('materialdesignicons6-webfont.ttf', 'wb') as fp:
req = urllib.request.urlopen(TTF_URL)
if req.status != 200:
raise Exception('Failed to download TTF')
fp.write(req.read())
req.close()

hasher = hashlib.md5()
with open('materialdesignicons-webfont.ttf', 'rb') as f:
with open('materialdesignicons6-webfont.ttf', 'rb') as f:
content = f.read()
hasher.update(content)

Expand All @@ -83,7 +83,7 @@ for name, key in data:
name = name.lower()
charmap[name] = key

with open('materialdesignicons-webfont-charmap.json', 'w') as fp:
with open('materialdesignicons6-webfont-charmap.json', 'w') as fp:
json.dump(charmap, fp, indent=4, sort_keys=True)

```
Expand Down
15 changes: 10 additions & 5 deletions docs/source/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ The following prefixes are currently available to use:

- ``ei`` prefix holds `Elusive Icons 2.0 with its 304 icons`_.

- ``mdi`` prefix holds `Material Design Icons 5.9.55 with its 5955
icons.`_
- `Material Design Icons`_:

- ``mdi6`` prefix holds `Material Design Icons 6.3.95 with its 6395 icons.`_

- ``mdi`` prefix holds `Material Design Icons 5.9.55 with its 5955 icons.`_

- ``msc`` prefix holds Microsoft's `Codicon Icons 0.0.25 with its 385 icons.`_

Expand All @@ -33,6 +36,8 @@ The following prefixes are currently available to use:
.. _414 icons of various brands.: https://fontawesome.com/icons?d=gallery&s=brands&v=5.0.0,5.0.1,5.0.2,5.0.3,5.0.4,5.0.5,5.0.6,5.0.7,5.0.8,5.0.9,5.0.10,5.0.11,5.0.12,5.0.13,5.1.0,5.1.1,5.2.0,5.3.0,5.3.1,5.4.0,5.4.1,5.4.2,5.5.0,5.6.0,5.6.1,5.6.3&m=free
.. _FA 4.7 version with its 675 icons: https://fontawesome.com/v4.7.0/icons/
.. _Elusive Icons 2.0 with its 304 icons: http://elusiveicons.com/icons/
.. _Material Design Icons: https://cdn.materialdesignicons.com/
.. _Material Design Icons 6.3.95 with its 6395 icons.: https://cdn.materialdesignicons.com/6.3.95/
.. _Material Design Icons 5.9.55 with its 5955 icons.: https://cdn.materialdesignicons.com/5.9.55/
.. _Codicon Icons 0.0.25 with its 385 icons.: https://github.com/microsoft/vscode-codicons

Expand Down Expand Up @@ -61,9 +66,9 @@ Examples
asl_icon = qta.icon('ei.asl')
elusive_button = QtWidgets.QPushButton(asl_icon, 'Elusive Icons!')
# Get Material Design icons by name
apn_icon = qta.icon('mdi.access-point-network')
mdi_button = QtWidgets.QPushButton(apn_icon, 'Material Design Icons!')
# Get Material Design icons 6.x by name
apn_icon = qta.icon('mdi6.access-point-network')
mdi6_button = QtWidgets.QPushButton(apn_icon, 'Material Design Icons!')
# Get Microsoft Codicons icons by name
squirrel_icon = qta.icon('msc.squirrel')
Expand Down
4 changes: 2 additions & 2 deletions example.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ def __init__(self):
elusive_button = QtWidgets.QPushButton(asl_icon, 'Elusive Icons!')

# Get Material Design icons by name
apn_icon = qta.icon('mdi.access-point-network')
mdi_button = QtWidgets.QPushButton(apn_icon, 'Material Design Icons!')
apn_icon = qta.icon('mdi6.access-point-network')
mdi6_button = QtWidgets.QPushButton(apn_icon, 'Material Design Icons!')

# Rotated
rot_icon = qta.icon('mdi.access-point-network', rotated=45)
Expand Down
5 changes: 4 additions & 1 deletion qtawesome/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ def _instance():
('ei', 'elusiveicons-webfont.ttf', 'elusiveicons-webfont-charmap.json'),
('mdi', 'materialdesignicons-webfont.ttf',
'materialdesignicons-webfont-charmap.json'),
('mdi6', 'materialdesignicons6-webfont.ttf',
'materialdesignicons6-webfont-charmap.json'),
('ph', 'phosphor.ttf', 'phosphor-charmap.json'),
('ri', 'remixicon.ttf', 'remixicon-charmap.json'),
('msc', 'codicon.ttf', 'codicon-charmap.json'),
Expand Down Expand Up @@ -102,7 +104,8 @@ def icon(*names, **kwargs):
- The prefix corresponding to Font-Awesome 5.x (solid) is 'fa5s'
- The prefix corresponding to Font-Awesome 5.x (brands) is 'fa5b'
- The prefix corresponding to Elusive-Icons is 'ei'
- The prefix corresponding to Material-Design-Icons is 'mdi'
- The prefix corresponding to Material-Design-Icons 5.x is 'mdi'
- The prefix corresponding to Material-Design-Icons 6.x is 'mdi6'
When requesting a single glyph, options (such as color or positional offsets)
can be passed as keyword arguments::
Expand Down
Loading

0 comments on commit ed4a36e

Please sign in to comment.