Skip to content

Commit

Permalink
Merge pull request #174 from kumattau/mdi-6.3.95
Browse files Browse the repository at this point in the history
PR: Update Material Design Icons to 5.9.55 and add support for new mayor version 6.x - 6.3.95
  • Loading branch information
dalthviz authored Oct 20, 2021
2 parents 4a58e5c + 3d8bdca commit 1ceafa1
Show file tree
Hide file tree
Showing 10 changed files with 6,832 additions and 22 deletions.
14 changes: 9 additions & 5 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.4.55 with its 5555 icons.](https://cdn.materialdesignicons.com/5.4.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 Expand Up @@ -178,11 +182,11 @@ Once installed, run `qta-browser` from a shell to start the browser.
MIT License. Copyright 2015 - The Spyder development team.
See the [LICENSE](LICENSE) file for details.

The Font Awesome, Elusive Icons and Material Design Icons fonts are licensed under the [SIL Open Font License](https://en.wikipedia.org/wiki/SIL_Open_Font_License).
The Font Awesome and Elusive Icons fonts are licensed under the [SIL Open Font License](https://en.wikipedia.org/wiki/SIL_Open_Font_License).

The Phosphor font is licensed under the MIT License.

The Remix Icon font is licensed under the Apache License Version 2.0.
The Material Design Icons and Remix Icon fonts are licensed under the [Apache License Version 2.0](http://www.apache.org/licenses/LICENSE-2.0).

Microsoft's Codicons are licensed under a [Creative Commons Attribution 4.0 International Public License](https://github.com/microsoft/vscode-codicons/blob/master/LICENSE).

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
17 changes: 11 additions & 6 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.4.55 with its 5555
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,7 +36,9 @@ The following prefixes are currently available to use:
.. _449 icons of various brands.: https://fontawesome.com/icons?d=gallery&s=brands&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 5.4.55 with its 5555 icons.: https://cdn.materialdesignicons.com/5.4.55/
.. _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

Examples
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
6 changes: 3 additions & 3 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 Expand Up @@ -127,7 +127,7 @@ def __init__(self):
fa5s_button,
fa5b_button,
elusive_button,
mdi_button,
mdi6_button,
music_button,
heart_button,
rot_button,
Expand Down
9 changes: 6 additions & 3 deletions qtawesome/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,10 @@ def _instance():
'fontawesome5-brands-webfont.ttf',
'fontawesome5-brands-webfont-charmap.json'),
('ei', 'elusiveicons-webfont.ttf', 'elusiveicons-webfont-charmap.json'),
('mdi', 'materialdesignicons-webfont.ttf',
'materialdesignicons-webfont-charmap.json'),
('mdi', 'materialdesignicons5-webfont.ttf',
'materialdesignicons5-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 1ceafa1

Please sign in to comment.