robhagemans / monobit Goto Github PK
View Code? Open in Web Editor NEWTools for working with monochrome bitmap fonts
License: MIT License
Tools for working with monochrome bitmap fonts
License: MIT License
Hello, I installed this to try to convert some Japanese FONTX files. When I typed "monobit-convert --help" in my terminal, I got a long python error message. Here it is in full:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.9/bin/monobit-convert", line 5, in
from monobit.scripts.convert import main
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/monobit/init.py", line 12, in
from .pack import Pack, operations as _pack_operations
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/monobit/pack.py", line 10, in
from .font import Font, FontProperties
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/monobit/font.py", line 14, in
from .glyph import Glyph
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/monobit/glyph.py", line 11, in
from .encoding import is_graphical, is_blank
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/monobit/encoding.py", line 1346, in
for _file in files('monobit.charmaps.freedos').iterdir():
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/resources.py", line 147, in files
return _common.from_package(_get_package(package))
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/_common.py", line 14, in from_package
return fallback_resources(package.spec)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/_common.py", line 18, in fallback_resources
package_directory = pathlib.Path(spec.origin).parent
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/pathlib.py", line 1082, in new
self = cls._from_parts(args, init=False)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/pathlib.py", line 707, in _from_parts
drv, root, parts = self._parse_args(args)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/pathlib.py", line 691, in _parse_args
a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not NoneType
I get the same error when I type "monobit-banner --help" too.
I'm running on a Mid-2014 Macbook Pro with MacOS Catalina 10.15.7
The YAFF Working But DRAW Not Working For The Majoritary, But A Tiny Pretty Working.
A Error Out Is :::: ERROR: tuple.index(x): x not in tuple
You Can Fix It?
with python 3.9 on cygwin.
is possible to add --overline effect option for banner utility?
a line horizontal in center render.
There is no information, apart from browsing source code, what are dependences of the script. For example, I wanted to convert BDF font to PNG format (bitmap), but the script crashed due to not existing saver. I went into source code to look for some answer, and I finally find out the Image saver/loader require PIL library to be installed. In the image.py
the failed import is caught but no information is printed (even with the --debug
flag).
There should be at least information about this in README, but I guess ideally it would be if KeyError
for png exception could be caught at formats.py
and info about missing PIL (Pillow) library would be included.
Hello/Hi Again A Bug Where I Cant Change Color As Image So Before I Can Change The Color
And The Default Color Writed Is False So What Color Default?
Im Tired You Regressing This Program Stop It!
ERROR: tuple index out of range
before do not make this error.ERROR: tuple index out of range
in the VT100.yaff and 0x83 make error is ERROR: min() arg is an empty sequence
.Hi,
It seems like this tool has the potential to maybe help me out?
I'm looking to convert the devil face emoji to the sixel representation described here:
https://vt100.net/dec/vt320/soft_characters
So basically:
How do I convert the devil face emoji (or any emoji) into a sequence like this:
ESC P 1;1;1;0;0;2;0;0 { P ???owYn||~ywo?? / ?IRJaVNn^NVbJRI ESC \ [etc etc]}
It's the decoding to sixel that I don't really want to do by hand....
Not really an issue, but if you ever look into supporting Atari (GEM) bitmap fonts again. you may want to look at https://github.com/th-otto/gemfedit/blob/master/tools/fntconv.c. That repo also has the 6x6 system font (system08.fnt, was used for small icon lables) and the 16x32 system font (system20.fnt, only present in TT machines). And of course, that tool uses its own text-based format ;)
Is possible to create a New banner utility for sound spectral, the points is marked into spectral, the top is high frequency the bottom is the low frequency.
Greetings, I was elated to find this project -it would have saved me huge amounts of time back in '95 - '98. I'm hoping monobit
can help me migrate some fonts forward. Trying monobit-convert load
out with some pft
files I see output like the following, where I'm wondering if the right-bearing
info is just a warning or a fatal error?
name: ^Q
spacing: proportional
bounding-box: 0 0
font-id: ^Q
converter: monobit v0.36
source-name: amdl1103.pft
source-format: ChiWriter (0x0)
history: load -format=pcpaint
shift-up: 255
0x20:
-
right-bearing: 37
0x011f:
-
right-bearing: 8
0x0120:
-
right-bearing: 37
⋮
monobit-convert
will produce a .png
file, but the visual result is not intelligible to me. Trying BDF output gets the following error consistently:
ERROR: BDF default glyph must have a character or codepoint.
ERROR: integer division or modulo by zero
GitHub isn't allowing me to attach the pft
files to help with investigation, so I've added them to a G-Drive folder here. Note that these are non-Roman fonts, they have Ethiopic glyphs:
https://drive.google.com/drive/folders/1Ttg30yOE6kAYosndFpHMrjm-Z6zKbNOq?usp=share_link
thanks!
When converting FON file to PNG I've noticed that it has 1px padding around each character (except for the outer edge of the image). while searching how to set padding in help, I've noticed that it says that it should actually default to 0. After explicitly setting padding to 0, the resulting image was as expected. Either the help is wrong or padding does not default to 0.
I get an error when using full paths to files in Windows 10
monobit-convert D:\Soft\_Tools_\Font\setfont-ibm.yaff D:\Soft\_Tools_\Font\33.png
ERROR: 'D:\\Soft\\_Tools_\\Font\\setfont-ibm.yaff' is not in the subpath of '\\' OR one path is relative and the other is absolute.
Hi!
test.zip
Here are the test files for the research. You understand if you look them with any HEX Editor.
BIN00 - characters are encoded from 0 to 127.
BIN20 - characters are encoded from 32 to 159 (the number corresponds to the value of the ascii-table of the computer).
HFONT - normal font.
File size is always 1152.
Character size W8*H9.
Total number of characters 128.
Hello,
Thank you for this project which seems very clean and very well organized!!!
I would like to be sure that your project could help mine, which generates new letter renders for now.
I am generating black and white letters (could be any color on transparent background, or vector graphics as well), as shown here: https://github.com/labonneimpression/pix2chocolate#example-3---multiple-letter-chocolate-biscuits
using mostly python scripts and various executables.
For now my output file format is .png with background, but I can for sure end up other raster or vector formats if needed, without problem.
I would like to output some day a font that I could use in LibreOffice or Inkscape, or maybe any web page, loadable by CSS font-face, out of my generate letters image.
Could you please advise a way to use your tool to convert my raster or vector letter images into a proper font file for desktop/web applications?
Thanks!!
Hey, I made a bitmap font myself but I drew it in a png. As I understand a .draw would be a good intermediate representation to get to other formats, is there a way to convert from png to draw?
In case this is not possible, is there a format I can easily convert to from a .png?
I'm observing that conversion to the bdf
format currently does not work. Here is a minimal, reproducible example:
$ wget https://github.com/fcambus/spleen/raw/master/spleen-6x12.bdf &> /dev/null
$ python3 convert.py spleen-6x12.bdf spleen.yaff &> /dev/null
$ python3 convert.py spleen.yaff spleen.bdf
ERROR: 'get-ordinal'
The error is thrown at line 478 of bdf.py
:
xlfd_props['DEFAULT_CHAR'] = font.get_ordinal(font.default_char)
Note the Font
class defined in font.py
does not define a get_ordinal()
method but I'm not sure how to fix it.
I would like to store a canonical version of a font in the YAFF format, that supports multiple codepages.
i.e. rather than making multiple copies for each different codepages (CP886, CP1251, etc...), I want a single font file that contains the remapping info (since the glyph bitmaps won't change). Is this possible? Currently it only seems possible to embed 2 encodings per YAFF (Unicode and encoding:
).
I'm thinking an extension to the existing character label, to allow per character encoding to specified...?
e.g.
0x41:
latin_a:
+cp437: 0x12
+1251: 0x44
....
.@..
@.@.
@@@.
@.@.
@.@.
Hi, I have stumbled upon http://fileformats.archiveteam.org, from its FAQ :
The purpose of this wiki is to "Solve the File Format Problem".
The File Format Problem in this context is that over the last century, many types of electronic information have been presented in formats that are non-intuitive and subject to the rapidly-shifting interests of what is newest and best. As a result, thousands of programs, documents, images and binary files are in danger of being unreadable to later generations as no readily available information about accessing them is to be found. Various projects have been launched in the last 20 years to deal with this problem, but they all lack a groundswell of directed volunteers working to once and for all get all the disparate information into one place and easily referenced by all. This is the goal of this project.
The project started on November 1st, 2012. All are invited to register and contribute. The goal is to have a massive bulk of knowledge in one place for all to use and incorporate into other similar directories and sites, providing a needed resource for generations to come.
I have seen .bdf and .hex formats listed, but not .yaff. Do you think of this format being relevant enough to be written in the wiki as an interface format for bitmap fonts ?
It might just be my bad luck with the first font I selected, but I noticed that monobit-banner is dropping the last 'column' of bits:
................
................
................
................
................
................
@@.@@@...@@.@@@.
.@@...@...@@...@
.@....@...@....@
.@....@...@....@
.@....@...@....@
.@....@...@....@
.@....@...@....@
@@@..@@@.@@@..@@
................
................
................
This uses apple-mac/Espy_Serif_14.yaff
(from The hoard), and text n n
. This is solvable by adding a space to the input text n n
:
..................
..................
..................
..................
..................
..................
@@.@@@...@@.@@@...
.@@...@...@@...@..
.@....@...@....@..
.@....@...@....@..
.@....@...@....@..
.@....@...@....@..
.@....@...@....@..
@@@..@@@.@@@..@@@.
..................
..................
..................
I'm not sure this is actually the result of an issue with the font, or in the monobit-banner
code.
It's not world-shattering...
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.