makutamoto / bdf-to-image Goto Github PK
View Code? Open in Web Editor NEWConverts bdf fonts to image file.
License: MIT License
Converts bdf fonts to image file.
License: MIT License
bdftoimg terminates with UnicodeDcodeError.
/home/a3/PycharmProjects/pythonProject/venv/bin/python /home/a3/PycharmProjects/pythonProject/bdftoimg.py /home/a3/Documents/bdf-to-image-master/shnm6x12r.png out.img
Traceback (most recent call last):
File "/home/a3/PycharmProjects/pythonProject/bdftoimg.py", line 38, in
inputData = f.read()
File "/usr/lib/python3.8/codecs.py", line 322, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x89 in position 0: invalid start byte
I guessed, a BDF file is basically a hex file, so I changed with 'open(inputFile) as f:' to 'with open(inputFile, 'rb') as f:'
That did not help either, Regex seems to have problems with hex data.
Traceback (most recent call last):
File "/home/a3/PycharmProjects/pythonProject/bdftoimg.py", line 48, in
for char in clauseRegex.finditer(inputData):
TypeError: cannot use a string pattern on a bytes-like object
Any thoughts an this problem ?
Cheers, Adrian
Excuse me, but I still have a real problem, I think.
I am trying to convert bitocra/bitocra.bdf to an image file.
It terminates with the following exception:
/home/a3/PycharmProjects/pythonProject/venv/bin/python /home/a3/PycharmProjects/pythonProject/bdftoimg.py /home/a3/Documents/bitmap-fonts/bitmap/bitocra/bitocra.bdf out.png
Traceback (most recent call last):
File "/home/a3/PycharmProjects/pythonProject/bdftoimg.py", line 55, in
bin = int(line, 16)
ValueError: invalid literal for int() with base 16: 'ENDCHAR'
The exception occurs after processing the last STARTCHAR / ENDCHAR section, which is followed by ENDFONT.
I have been trying to get the shnm6x12r.bdf file but where unable to.
if you want to see the font I have been working on, I need an email address for sending, it can be downloaded from the internet.
I hope you can help with this problem (I am not regExp person ...).
Cheers, Adrian
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.