esphome-glyphsets 0.2.0
legitimate font utility package
Archive ships a root-level test treeReads Python shell-command output stream
SHA-2563875fd581f8605b5038315dac5913423474a3eb0c1cb2849d9841ad3c9e8b1e7
Evidence
18:43… :: 3.13
19Classifier: Topic :: Software Development :: Libraries
20Requires-Python: >=3.9
21Description-Content-Type: text/markdown
22License-File: LICENSE
23
24# esphome-glyphsets
25
26<p align="center">
27 <a href="https://github.com/esphome/esphome-glyphsets/actions/workflows/ci.yml?query=branch%3Amain">
28 <img src="https://img.shields.io/github/actions/workflow/status/esphome/esphome-glyphsets/ci.yml?branch=main&label=CI&logo=github&style=flat-square" alt="CI Sta …
1__version__ = "0.2.0"
2
3import pathlib
4
5FILE_PATH = pathlib.Path(__file__).resolve()
⋯7 lines
13 return sorted(
14 f.stem
15 for f in GLYPHSETS_DEFINITIONS_PATH.iterdir()
16 if f.is_file() and f.suffix == ".yaml"
17 )
18
⋯5 lines
24 return []
25 character_set = {
26 int(line.partition(" ")[0][2:], 16)
27 for line in nam_path.read_text().splitlines()
28 if line.startswith("0x")
29 }
30 return sorted(character_set)
1import copy
2import yaml
3import plistlib
4import os
5import gflanguages
6from fontTools.unicodedata.Scripts import NAMES as SCRIPT_NAMES
7import unicodedata
8import functools
9from glyphsets.helpers import Colors, headline
10import tabulate
11import glyphsLib
12import youseedee
13import random
14
15from glyphsLib.glyphdata import get_glyph, _lookup_attributes_by_unicode
16
17# Call get_glyph once so that GLYPHDATA gets filled in glyphsLib
18get_glyph("A")
19# If I import GLYPHDATA at the top of the file, it doesn't get filled
20from glyphsLib.glyphdata import GLYPHDATA # noqa E402
21
22assert type(GLYPHDATA) is glyphsLib.glyphdata.GlyphData
23
24root_folder = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "data"))
25tool_folder = os.path.abspath(os.path.dirname(__file__))
26
27
28def sort_unic …
30:3… glyph_b = get_glyph(b)
31 if glyph_a.unicode and glyph_b.unicode:
32 return int(glyph_a.unicode, 16) - int(glyph_b.unicode, 16)
33 elif glyph_a.unicode:
34 return -1
35 elif glyph_b.unicode:
36 r …
⋯4 lines
68
69def read_nam_file(path):
70 character_set = set()
71 with open(path, "r") as f:
72 nam_lines = f.readlines()
73 for line in nam_lines:
74 unicode = line.split(" ")[0]
75 if unicode.startswith("0x"):
⋯4 lines
Showing the top 5 files — 2 more files (17 regions) not shown.
No evidence locations were recorded for this file. Raw result