mirror of
https://gitlab.com/MisterBiggs/bdfparse.git
synced 2025-06-17 06:56:40 +00:00
Compare commits
No commits in common. "master" and "2019.4" have entirely different histories.
0
__init__.py
Normal file
0
__init__.py
Normal file
@ -8,34 +8,6 @@ class Font:
|
|||||||
self.cols = self.properties["FONTBOUNDINGBOX"][0]
|
self.cols = self.properties["FONTBOUNDINGBOX"][0]
|
||||||
self.rows = self.properties["FONTBOUNDINGBOX"][1]
|
self.rows = self.properties["FONTBOUNDINGBOX"][1]
|
||||||
self.shape = (self.rows, self.cols)
|
self.shape = (self.rows, self.cols)
|
||||||
self.charNames = {
|
|
||||||
" ": "space",
|
|
||||||
"-": "minus",
|
|
||||||
"+": "plus",
|
|
||||||
"0": "zero",
|
|
||||||
"1": "one",
|
|
||||||
"2": "two",
|
|
||||||
"3": "three",
|
|
||||||
"4": "four",
|
|
||||||
"5": "five",
|
|
||||||
"6": "six",
|
|
||||||
"7": "seven",
|
|
||||||
"8": "eight",
|
|
||||||
"9": "nine",
|
|
||||||
"!": "exclam",
|
|
||||||
"@": "at",
|
|
||||||
"#": "numbersign",
|
|
||||||
"$": "dollar",
|
|
||||||
"%": "percent",
|
|
||||||
"&": "ampersand",
|
|
||||||
"*": "asterisk",
|
|
||||||
"(": "parenleft",
|
|
||||||
")": "parenright",
|
|
||||||
",": "comma",
|
|
||||||
".": "period",
|
|
||||||
"/": "slash",
|
|
||||||
"?": "question",
|
|
||||||
}
|
|
||||||
|
|
||||||
def parse_properties(self, bdfFile):
|
def parse_properties(self, bdfFile):
|
||||||
|
|
||||||
@ -221,8 +193,16 @@ class Font:
|
|||||||
def word(self, word: str):
|
def word(self, word: str):
|
||||||
matrix = np.zeros(self.shape)
|
matrix = np.zeros(self.shape)
|
||||||
for char in word:
|
for char in word:
|
||||||
if char in self.charNames.keys():
|
if char is " ":
|
||||||
arr = self.chars[self.charNames[char]]
|
arr = np.zeros(self.shape)
|
||||||
|
elif char is "!":
|
||||||
|
arr = self.chars["exclam"]
|
||||||
|
elif char is "%":
|
||||||
|
arr = self.chars["percent"]
|
||||||
|
elif char is ",":
|
||||||
|
arr = self.chars["comma"]
|
||||||
|
elif char is ".":
|
||||||
|
arr = self.chars["period"]
|
||||||
else:
|
else:
|
||||||
arr = self.chars[char]
|
arr = self.chars[char]
|
||||||
|
|
@ -1 +0,0 @@
|
|||||||
from .bdfparse import Font
|
|
6
setup.py
6
setup.py
@ -9,14 +9,14 @@ with open("README.md", "r") as fh:
|
|||||||
long_description = fh.read()
|
long_description = fh.read()
|
||||||
|
|
||||||
setuptools.setup(
|
setuptools.setup(
|
||||||
name="bdfparse",
|
name="bdf_to_numpy",
|
||||||
version="2019.8",
|
version="2019.4",
|
||||||
author="Anson Biggs",
|
author="Anson Biggs",
|
||||||
author_email="anson@ansonbiggs.com",
|
author_email="anson@ansonbiggs.com",
|
||||||
description="A package for reading .bdf files into NumPy arrays.",
|
description="A package for reading .bdf files into NumPy arrays.",
|
||||||
long_description=long_description,
|
long_description=long_description,
|
||||||
long_description_content_type="text/markdown",
|
long_description_content_type="text/markdown",
|
||||||
url="https://gitlab.com/MisterBiggs/bdfparse",
|
url="https://gitlab.com/MisterBiggs/bdf-to-numpy",
|
||||||
packages=setuptools.find_packages(),
|
packages=setuptools.find_packages(),
|
||||||
classifiers=[
|
classifiers=[
|
||||||
"Programming Language :: Python :: 3.7",
|
"Programming Language :: Python :: 3.7",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user